Skip to content

Commit

Permalink
add parameters enabling lock watching for individual channels
Browse files Browse the repository at this point in the history
  • Loading branch information
bleykauf committed Sep 27, 2024
1 parent fd6c5f6 commit 8d7fec3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
10 changes: 9 additions & 1 deletion linien-gui/linien_gui/ui/relocking_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ def on_connection_established(self) -> None:
param2ui(self.parameters.automatic_relocking, self.automaticRelockingCheckbox)

for channel in ("control", "error", "monitor"):
ui2param(
getattr(self, f"watchLock{channel.capitalize()}CheckBox"),
getattr(self.parameters, f"watch_lock_{channel}"),
)
param2ui(
getattr(self.parameters, f"watch_lock_{channel}"),
getattr(self, f"watchLock{channel.capitalize()}CheckBox"),
)
ui2param(
getattr(self, f"plot{channel.capitalize()}ThresholdCheckBox"),
getattr(self.settings, f"show_{channel}_threshold"),
Expand All @@ -98,7 +106,7 @@ def on_connection_established(self) -> None:
getattr(self.parameters, f"watch_lock_{channel}_max"),
getattr(self, f"watchLock{channel.capitalize()}MaxSpinBox"),
)
# Connect changed parameters/settings to callback callback functions
# Connect changed parameters/settings to callback functions
for param in (
getattr(self.settings, f"show_{channel}_threshold"),
getattr(self.parameters, f"watch_lock_{channel}_min"),
Expand Down
9 changes: 9 additions & 0 deletions linien-server/linien_server/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,15 @@ def __init__(self):
self.watch_lock = Parameter(start=False, restorable=True, loggable=True)
"""Watch the lock state and set `lock_lost` to True if lock is lost."""

self.watch_lock_control = Parameter(start=False, restorable=True, loggable=True)
"""Watch the lock state on the control channel."""

self.watch_lock_error = Parameter(start=False, restorable=True, loggable=True)
"""Watch the lock state on the error channel."""

self.watch_lock_monitor = Parameter(start=False, restorable=True, loggable=True)
"""Watch the lock state on the monitor channel."""

self.automatic_relocking = Parameter(start=False, restorable=True)
"""Attempt relocking if lock is lost."""

Expand Down

0 comments on commit 8d7fec3

Please sign in to comment.