Skip to content

Commit

Permalink
Change variables to be explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
yomach authored Jun 6, 2024
1 parent 61c37ac commit 7ea9879
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions qualang_tools/control_panel/manual_output_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,23 +248,21 @@ def set_amplitude(self, element, value, ignore_missing_elements=False):

prev_value = self.analog_data[element]["amplitude"]
if value != 0:
value = (value - prev_value) * (1 / self.ANALOG_WAVEFORM_AMPLITUDE)
value = _round_to_fixed_point_accuracy(value)
if value == 0:
delta_value = (value - prev_value) * (1 / self.ANALOG_WAVEFORM_AMPLITUDE)
delta_value = _round_to_fixed_point_accuracy(delta_value)
if delta_value == 0:
return
self.analog_data[element]["amplitude"] = _floor_to_fixed_point_accuracy(
prev_value + value * self.ANALOG_WAVEFORM_AMPLITUDE
)
set_value = _floor_to_fixed_point_accuracy(prev_value + delta_value * self.ANALOG_WAVEFORM_AMPLITUDE)
else:
self.analog_data[element]["amplitude"] = 0.0

set_value = 0.0
self.analog_data[element]["amplitude"] = set_value

while not self.analog_job.is_paused():
sleep(0.01)

self.analog_qm.set_io_values(
int(self.analog_elements.index(element)) + len(self.analog_elements),
float(value),
float(set_value),
)
self.analog_job.resume()

Expand Down

0 comments on commit 7ea9879

Please sign in to comment.