summaryrefslogtreecommitdiff
path: root/devices/nidaqmx_device.py
diff options
context:
space:
mode:
authorChristian Kolset <ckolset@colostate.edu>2026-07-29 12:59:10 -0600
committerChristian Kolset <ckolset@colostate.edu>2026-07-29 12:59:10 -0600
commit9360dea6e6327004b905eb6d7c782cc7c0d3ba13 (patch)
tree54366e05a55f96cd4c676d71cfb2136d72392984 /devices/nidaqmx_device.py
parentb407a079000f6a4b04ecf38eca17c57719e7a7ec (diff)
Hide non-writable channels from Controls picker, gate writes on enabled+writable
Adds ChannelConfig.writable so the Controls editor can only bind to channels with a real write mapping (VS/MA/ME/MD/ST for CML, do*/DO for digital I/O, write_cmd-configured SCPI channels, holding-register Modbus channels) instead of read-only telemetry — this is exactly the class of mistake hit earlier (binding a motor-speed control to M1_TV instead of M1_VS). Also carries forward the enabled-channel gating for controls (hide disabled channels from the picker, block writes to them at _write() time) done alongside this investigation. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Diffstat (limited to 'devices/nidaqmx_device.py')
-rw-r--r--devices/nidaqmx_device.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/devices/nidaqmx_device.py b/devices/nidaqmx_device.py
index 88bb932..38cf93d 100644
--- a/devices/nidaqmx_device.py
+++ b/devices/nidaqmx_device.py
@@ -69,6 +69,7 @@ class NidaqmxDevice(BaseDevice):
channel_id=f"do{i}", name=f"DO {i}", unit="",
min_value=0.0, max_value=1.0,
color=_DO_COLORS[i % len(_DO_COLORS)],
+ writable=True,
))
info = DeviceInfo(