Skip to content

Commit 03bce47

Browse files
committed
Fix issues with transition_to_buffered. Fixes smart cache not updating
correctly and adds necessary abort function boilerplate.
1 parent baa00c8 commit 03bce47

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

labscript_devices/Windfreak/blacs_workers.py

+21-4
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,31 @@ def transition_to_buffered(self, device_name, h5file, initial_values, fresh):
132132
for i in channels:
133133
for sub in self.subchnls:
134134
self.program_static_value(i,sub,data[sub+str(i)])
135-
136-
# update smart cache to reflect programmed values
137-
self.smart_cache['STATIC_DATA'] = data
138-
135+
# update smart cache to reflect programmed values
136+
self.smart_cache['STATIC_DATA'][f'channel {i:d}'][sub] = data[sub+str(i)]
139137

140138
return self.final_values
141139

142140
def shutdown(self):
143141
# save current state the memory
144142
self.synth.save()
145143
self.synth.close()
144+
145+
def abort_transition_to_buffered(self):
146+
"""Special abort shot configuration code belongs here.
147+
"""
148+
return self.transition_to_manual(True)
149+
150+
def abort_buffered(self):
151+
"""Special abort shot code belongs here.
152+
"""
153+
return self.transition_to_manual(True)
154+
155+
def transition_to_manual(self,abort = False):
156+
"""Simple transition_to_manual method where no data is saved."""
157+
if abort:
158+
# If we're aborting the run, reset to original value
159+
self.program_manual(self.initial_values)
160+
# If we're not aborting the run, stick with buffered value. Nothing to do really!
161+
# return the current values in the device
162+
return True

0 commit comments

Comments
 (0)