refactor: drop firmware-version display, move Enable toggle to Controller
Firmware version is already printed to the log at connect() time (HendiCtrl/Pololu1376) - remove the live GUI/websocket firmware reporting entirely (Connectable, HeaterHendi/StirrerPololu1376, Heater/StirrerTask, web GUI) as redundant. Also move the Heater panel's Closed-loop checkbox into the Controller panel and rename it "Enable" - the Controller panel now shows a live Enabled (green) / Disabled (gray) status badge next to its heading, matching the Connected/Disconnected badges on the Heater/ Stirrer panels. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YaPLuRPpyjWcwhMvCvpHCL
This commit is contained in:
@@ -23,13 +23,11 @@ class HeaterHendi(AHeater):
|
||||
def connect(self):
|
||||
ok = self.hendi.connect()
|
||||
self.connected = ok
|
||||
self.firmware_version = self.hendi.sw_ver if ok else None
|
||||
return ok
|
||||
|
||||
def disconnect(self):
|
||||
self.hendi.disconnect()
|
||||
self.connected = False
|
||||
self.firmware_version = None
|
||||
|
||||
def activate(self, enable):
|
||||
if not self.connected:
|
||||
|
||||
@@ -23,13 +23,11 @@ class StirrerPololu1376(AStirrer):
|
||||
def connect(self):
|
||||
ok = self.drv.connect()
|
||||
self.connected = ok
|
||||
self.firmware_version = self.drv.firmware_version if ok else None
|
||||
return ok
|
||||
|
||||
def disconnect(self):
|
||||
self.drv.disconnect()
|
||||
self.connected = False
|
||||
self.firmware_version = None
|
||||
|
||||
@contextmanager
|
||||
def remote_open(self):
|
||||
|
||||
@@ -4,16 +4,15 @@ from utils.value import AttributeChange
|
||||
class Connectable(AttributeChange):
|
||||
"""Observable hardware-connection state shared by AHeater/AStirrer.
|
||||
|
||||
Simulated devices are always connected and report no firmware version;
|
||||
real (serial) devices start disconnected and only flip once connect()
|
||||
actually reaches the hardware.
|
||||
Simulated devices are always connected; real (serial) devices start
|
||||
disconnected and only flip once connect() actually reaches the
|
||||
hardware.
|
||||
"""
|
||||
|
||||
def __init__(self, simulated):
|
||||
AttributeChange.__init__(self)
|
||||
self.simulated = simulated
|
||||
self.connected = simulated
|
||||
self.firmware_version = None
|
||||
|
||||
def connect(self):
|
||||
return self.connected
|
||||
|
||||
Reference in New Issue
Block a user