Skip to content

Commit

Permalink
Fixed a bug where one of the LED positions was skipped
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahsoka committed Jun 3, 2021
1 parent 0aa4a35 commit e2f5637
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions beskar/pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@ def __init__(self, parent):

self.parent = parent

self.led_position = LED_position_gen(start_at_zero=True)
self.led_position_gen = LED_position_gen(start_at_zero=True)
self.led_position = next(self.led_position_gen)

self.scans = 1

Expand Down Expand Up @@ -408,7 +409,6 @@ def on_ok_button_clicked(self):
self.parent.dark_current_widget.update_data()
dark_current = stats.mean(self.parent.dark_current_widget.samples)

led_position = next(self.led_position)
length = 64 if len(self.led_position) == 3 else 65
# print(f"length={length}")
self.progress_bar.setMaximum(length)
Expand All @@ -427,14 +427,14 @@ def on_ok_button_clicked(self):
f'{self.parent.device_name}/ai1', min_val=-10, max_val=10
)
samples = task.read(10)
self.bar_charts[scan_number][2][led_position[0], led_position[1]] = max(samples) - dark_current
self.bar_charts[scan_number][2][self.led_position[0], self.led_position[1]] = max(samples) - dark_current
self.bar_charts[scan_number][1].dataProxy().resetArray(
self.bar_charts[scan_number][2].tolist(convert_to_bar_data=True)
)

self.progress_bar.setValue(progress + 1)

led_position = next(self.led_position)
self.led_position = next(self.led_position_gen)

if self.bar_charts_tab.currentIndex() == scan_number:
if self.bar_charts[scan_number][2].last_values_zero():
Expand Down

0 comments on commit e2f5637

Please sign in to comment.