1
0
forked from M-Labs/thermostat

ch_tuning -> autotuning_channels

This commit is contained in:
atse 2024-09-09 15:10:16 +08:00
parent 6b30c33c1b
commit 0833813909

View File

@ -167,22 +167,22 @@ class MainWindow(QtWidgets.QMainWindow):
@pyqtSlot(int, PIDAutotuneState) @pyqtSlot(int, PIDAutotuneState)
def _on_pid_autotune_state_changed(self, _ch, _state): def _on_pid_autotune_state_changed(self, _ch, _state):
ch_tuning = [] autotuning_channels = []
for ch in range(self.NUM_CHANNELS): for ch in range(self.NUM_CHANNELS):
if self._autotuners.get_state(ch) in { if self._autotuners.get_state(ch) in {
PIDAutotuneState.STATE_READY, PIDAutotuneState.STATE_READY,
PIDAutotuneState.STATE_RELAY_STEP_UP, PIDAutotuneState.STATE_RELAY_STEP_UP,
PIDAutotuneState.STATE_RELAY_STEP_DOWN, PIDAutotuneState.STATE_RELAY_STEP_DOWN,
}: }:
ch_tuning.append(ch) autotuning_channels.append(ch)
if len(ch_tuning) == 0: if len(autotuning_channels) == 0:
self.background_task_lbl.setText("Ready.") self.background_task_lbl.setText("Ready.")
self.loading_spinner.hide() self.loading_spinner.hide()
self.loading_spinner.stop() self.loading_spinner.stop()
else: else:
self.background_task_lbl.setText( self.background_task_lbl.setText(
"Autotuning channel {ch}...".format(ch=ch_tuning) f"Autotuning channel {autotuning_channels}..."
) )
self.loading_spinner.start() self.loading_spinner.start()
self.loading_spinner.show() self.loading_spinner.show()