Skip to content

Commit

Permalink
use 'double' value for comparison of enums
Browse files Browse the repository at this point in the history
  • Loading branch information
bleykauf committed Sep 24, 2024
1 parent 98efc46 commit 17faf8b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion linien-gui/linien_gui/ui/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def on_connection_established(self):

def change_sweep_control_visibility(self, *args):
autolock_running = (
self.parameters.autolock_status.value == AutolockStatus.LOCKING
self.parameters.autolock_status.value.value == AutolockStatus.LOCKING
)
optimization = self.parameters.optimization_running.value
locked = self.parameters.lock.value
Expand Down
5 changes: 4 additions & 1 deletion linien-gui/linien_gui/ui/plot_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,10 @@ def mouseReleaseEvent(self, event):
if xdiff / xmax < 0.01: # it was a click
pass
else: # it was a selection
if self.parameters.autolock_status.value == AutolockStatus.SELECTING:
if (
self.parameters.autolock_status.value.value
== AutolockStatus.SELECTING
):
last_combined_error_signal = self.last_plot_data[2]
self.control.exposed_start_autolock(
# we pickle it here because otherwise a netref is
Expand Down
2 changes: 1 addition & 1 deletion linien-gui/linien_gui/ui/right_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def optimization_status_changed(self, value: bool) -> None:
def enable_or_disable_panels(self, *args) -> None:
locked = self.parameters.lock.value
autolock_running = (
self.parameters.autolock_status.value == AutolockStatus.LOCKING
self.parameters.autolock_status.value.value == AutolockStatus.LOCKING
)
optimization_running = self.parameters.optimization_running.value

Expand Down
2 changes: 1 addition & 1 deletion linien-server/linien_server/autolock/autolock.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def try_to_start_autolock(self, plot_data: bytes) -> None:
"""
if (
self.parameters.pause_acquisition.value
or self.parameters.autolock_status.value != AutolockStatus.LOCKING
or self.parameters.autolock_status.value.value != AutolockStatus.LOCKING
):
return

Expand Down

0 comments on commit 17faf8b

Please sign in to comment.