Remove manual tab override/enable checkboxes from browser and PyQt clients
Drops the tc-enable, heater-activate and stirrer-activate checkboxes and all associated state, signal connections, initial-sync flags, and channel-handler logic. Regenerates main_window.py from the updated .ui. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DF16nV2ispNw1C9SbvqbRQ
This commit is contained in:
+2
-52
@@ -423,9 +423,6 @@ class Window(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
self.sud_state = None
|
||||
self.sud_user_message = None
|
||||
self._confirm_box = None
|
||||
# Mirrors the server's TempController.enabled - gates the
|
||||
# temp/heatrate setpoint controls (see on_tempctrl_changed()).
|
||||
self.tc_enabled = False
|
||||
# Global, not Sud-specific - from the 'System' channel's one-time
|
||||
# startup message. warp_factor defaults to 1.0 (no scaling) until
|
||||
# that arrives, or for a server that doesn't send it at all.
|
||||
@@ -523,9 +520,6 @@ class Window(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
self.msg_system.set_recv_handler(lambda msg: self.recv_signal.emit(self.on_system_changed, msg))
|
||||
|
||||
self.setupUi(self)
|
||||
# Matches tc_enabled's default (False) until the server says otherwise.
|
||||
self.Slider_temp_soll.setEnabled(False)
|
||||
self.doubleSpinBox_heatrate_soll.setEnabled(False)
|
||||
# Permanent (right-aligned, not cleared by showMessage()/clearMessage())
|
||||
# label for static environment info - distinct from the status bar's
|
||||
# transient step/schedule messages.
|
||||
@@ -559,9 +553,6 @@ class Window(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
|
||||
self.doubleSpinBox_heatrate_soll.valueChanged.connect(self.on_heatrate_soll_changed)
|
||||
|
||||
self.checkbox_heater_activate.stateChanged.connect(self.on_checkbox_changed)
|
||||
self.checkbox_stirrer_activate.stateChanged.connect(self.on_checkbox_stirrer_activate_changed)
|
||||
self.checkbox_tc_enable.stateChanged.connect(self.on_checkbox_tc_enable_changed)
|
||||
# Show the last value we had before the GUI last closed (see
|
||||
# closeEvent()) right away, rather than the spinbox's bare design-time
|
||||
# default - blockSignals so this doesn't queue a spurious 'AmbientTemp'
|
||||
@@ -590,8 +581,6 @@ class Window(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
self.slider_pwr_initial_update = True
|
||||
self.slider_temp_soll_initial_update = True
|
||||
self.slider_speed_initial_update = True
|
||||
self.checkbox_heater_activate_initial_update = True
|
||||
self.checkbox_stirrer_activate_initial_update = True
|
||||
self.heatrate_soll_initial_update = True
|
||||
self.sud_save_path = None
|
||||
|
||||
@@ -660,8 +649,6 @@ class Window(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
self.slider_pwr_initial_update = True
|
||||
self.slider_temp_soll_initial_update = True
|
||||
self.slider_speed_initial_update = True
|
||||
self.checkbox_heater_activate_initial_update = True
|
||||
self.checkbox_stirrer_activate_initial_update = True
|
||||
self.heatrate_soll_initial_update = True
|
||||
self.plot.reset()
|
||||
self.ws_client.connect(uri=self.plainTextUri.toPlainText())
|
||||
@@ -735,12 +722,6 @@ class Window(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
self.sud_state = None
|
||||
self.sud_user_message = None
|
||||
self._close_confirm_dialog()
|
||||
self.tc_enabled = False
|
||||
self.checkbox_tc_enable.blockSignals(True)
|
||||
self.checkbox_tc_enable.setChecked(False)
|
||||
self.checkbox_tc_enable.blockSignals(False)
|
||||
self.Slider_temp_soll.setEnabled(False)
|
||||
self.doubleSpinBox_heatrate_soll.setEnabled(False)
|
||||
# ambient_temp (the server's last echoed reading, shown in the
|
||||
# status bar) is no longer trustworthy, but the spinbox itself is
|
||||
# a client-owned setting (see closeEvent()/connect()) - leave it
|
||||
@@ -852,22 +833,10 @@ class Window(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
print("on_slider_pwr_soll_changed {}".format(value))
|
||||
self.msg_heater.send({'Power': value})
|
||||
|
||||
def on_checkbox_changed(self, value):
|
||||
print("on_checkbox_changed {}".format(value))
|
||||
self.msg_heater.send({'Activate': int(value == 2)})
|
||||
|
||||
def on_slider_stirrer_speed_soll_changed(self, value):
|
||||
print("on_slider_stirrer_speed_soll_changed {}".format(value))
|
||||
self.msg_stirrer.send({'Speed': value})
|
||||
|
||||
def on_checkbox_stirrer_activate_changed(self, value):
|
||||
print("on_checkbox_stirrer_activate_changed {}".format(value))
|
||||
self.msg_stirrer.send({'Activate': int(value == 2)})
|
||||
|
||||
def on_checkbox_tc_enable_changed(self, value):
|
||||
print("on_checkbox_tc_enable_changed {}".format(value))
|
||||
self.msg_tempctrl.send({'Enable': value == 2})
|
||||
|
||||
def on_action_sud_start(self):
|
||||
self.msg_sud.send({'Start': True})
|
||||
|
||||
@@ -965,13 +934,6 @@ class Window(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
self.doubleSpinBox_heatrate_soll.blockSignals(True)
|
||||
self.doubleSpinBox_heatrate_soll.setValue(subsubmsg['Set'])
|
||||
self.doubleSpinBox_heatrate_soll.blockSignals(False)
|
||||
elif "Enabled" in key:
|
||||
self.tc_enabled = msg['Enabled']
|
||||
self.checkbox_tc_enable.blockSignals(True)
|
||||
self.checkbox_tc_enable.setChecked(self.tc_enabled)
|
||||
self.checkbox_tc_enable.blockSignals(False)
|
||||
self.Slider_temp_soll.setEnabled(self.tc_enabled)
|
||||
self.doubleSpinBox_heatrate_soll.setEnabled(self.tc_enabled)
|
||||
if "Ist" in key:
|
||||
submsg = msg['Ist']
|
||||
if 'Temp' in submsg:
|
||||
@@ -984,13 +946,7 @@ class Window(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
|
||||
def on_heater_changed(self, msg):
|
||||
for key in msg:
|
||||
if "Activate" in key:
|
||||
if self.checkbox_heater_activate_initial_update:
|
||||
self.checkbox_heater_activate.blockSignals(True)
|
||||
self.checkbox_heater_activate.setCheckState(2 if msg['Activate'] == 1 else 0)
|
||||
self.checkbox_heater_activate.blockSignals(False)
|
||||
self.checkbox_heater_activate_initial_update = False
|
||||
elif "PowerSet" in key:
|
||||
if "PowerSet" in key:
|
||||
self.plot_power_set = msg['PowerSet']
|
||||
self.lcdNumber_power_heater.display(msg['PowerSet'])
|
||||
elif "Power" in key:
|
||||
@@ -1018,13 +974,7 @@ class Window(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
def on_stirrer_changed(self, msg):
|
||||
print("on_stirrer_changed {}".format(msg))
|
||||
for key in msg:
|
||||
if "Activate" in key:
|
||||
if self.checkbox_stirrer_activate_initial_update:
|
||||
self.checkbox_stirrer_activate.blockSignals(True)
|
||||
self.checkbox_stirrer_activate.setCheckState(2 if msg['Activate'] == 1 else 0)
|
||||
self.checkbox_stirrer_activate.blockSignals(False)
|
||||
self.checkbox_stirrer_activate_initial_update = False
|
||||
elif "Speed" in key:
|
||||
if "Speed" in key:
|
||||
self.stirrer_speed_ist = msg['Speed']
|
||||
self._update_step_plates()
|
||||
if self.slider_speed_initial_update:
|
||||
|
||||
Reference in New Issue
Block a user