修改水流量传感器支持,增加2代传感器

This commit is contained in:
2026-07-01 16:17:35 +08:00
parent 8ea65703a1
commit 6e63361554
2 changed files with 82 additions and 5 deletions
@@ -34,6 +34,7 @@ class Scanner:
self.last_update_time = 0
self.location = 0
self.velocity = 0
self.motor_power = 'on'
self.daq_info = {}
@@ -207,6 +208,11 @@ class MotorManager(QObject):
self.scanner(index).daq_info['temp'] = data['daq_temp']
if 'daq_online' in data:
self.scanner(index).daq_info['online'] = data['daq_online']
if 'daq_power' in data:
self.scanner(index).daq_info['power'] = data['daq_power']
if 'motor_power' in data:
self.scanner(index).motor_power = data['motor_power']
if self.scanner(index).state in [ScannerState.MOVING_UP, ScannerState.MOVING_DOWN]:
self.scanner(index).last_moving_time = time.time()