From ee4965f4d4d1fc5d40be24b99341620e32386d40 Mon Sep 17 00:00:00 2001 From: Christian Kolset Date: Mon, 27 Jul 2026 17:34:30 -0600 Subject: Enhance protocol layers: implement I/O locking for thread safety in serial communication --- devices/serial_device.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'devices') diff --git a/devices/serial_device.py b/devices/serial_device.py index ca551c6..dc92b12 100644 --- a/devices/serial_device.py +++ b/devices/serial_device.py @@ -313,6 +313,16 @@ class SerialDevice(BaseDevice): color=_COLORS[color_idx % len(_COLORS)], )) color_idx += 1 + # Write-only action channels — motor must be enabled (ME) before VS/MA take effect + for cmd, label in (("ME", "Enable"), ("MD", "Disable")): + channels.append(ChannelConfig( + channel_id=f"{mid}_{cmd}", + name=f"{mid} {label}", + unit="", + min_value=0.0, max_value=1.0, + color=_COLORS[color_idx % len(_COLORS)], + )) + color_idx += 1 return channels or [ChannelConfig("M1_TP", "M1 TP", "counts", color=_COLORS[0])] return [] -- cgit v1.2.3