Rename Sud's Download/Upload to Save/Load throughout

Renames everywhere the concept appears: Sud.download()/upload() ->
save()/load(), the 'Download'/'Upload' websocket messages ->
'Save'/'Load', the brewpi_gui menu actions, handlers and
sud_download_path -> sud_save_path, and the demo script. Behavior is
unchanged - this is naming only, from the client's perspective (save
to / load from a local file) rather than the server's.
This commit is contained in:
2026-06-20 23:58:21 +02:00
parent 5d884ca3da
commit 13e507e2b5
6 changed files with 51 additions and 51 deletions
+6 -6
View File
@@ -3712,8 +3712,8 @@
<property name="title">
<string>&amp;File</string>
</property>
<addaction name="actionSudDownload"/>
<addaction name="actionSudUpload"/>
<addaction name="actionSudSave"/>
<addaction name="actionSudLoad"/>
</widget>
<widget class="QMenu" name="menu_Help">
<property name="title">
@@ -3765,17 +3765,17 @@
<string>Stop</string>
</property>
</action>
<action name="actionSudDownload">
<action name="actionSudSave">
<property name="text">
<string>&amp;Download Sud...</string>
<string>&amp;Save Sud...</string>
</property>
<property name="toolTip">
<string>Save the running Sud's schedule to a local sud.json</string>
</property>
</action>
<action name="actionSudUpload">
<action name="actionSudLoad">
<property name="text">
<string>&amp;Upload Sud...</string>
<string>&amp;Load Sud...</string>
</property>
<property name="toolTip">
<string>Replace the running Sud's schedule with a local sud.json</string>
+15 -15
View File
@@ -209,8 +209,8 @@ class Window(QtWidgets.QMainWindow, Ui_MainWindow):
self.actionStart.triggered.connect(self.on_action_sud_start)
self.actionPause.triggered.connect(self.on_action_sud_pause)
self.actionStop.triggered.connect(self.on_action_sud_stop)
self.actionSudDownload.triggered.connect(self.on_action_sud_download)
self.actionSudUpload.triggered.connect(self.on_action_sud_upload)
self.actionSudSave.triggered.connect(self.on_action_sud_save)
self.actionSudLoad.triggered.connect(self.on_action_sud_load)
self.Slider_pwr_soll.valueChanged.connect(self.on_slider_pwr_soll_changed)
self.Slider_temp_soll.valueChanged.connect(self.on_slider_temp_soll_changed)
self.Slider_speed_soll.valueChanged.connect(self.on_slider_stirrer_speed_soll_changed)
@@ -227,7 +227,7 @@ class Window(QtWidgets.QMainWindow, Ui_MainWindow):
self.checkbox_heater_activate_initial_update = True
self.checkbox_stirrer_activate_initial_update = True
self.heatrate_soll_initial_update = True
self.sud_download_path = None
self.sud_save_path = None
# Latest values sampled by the plot timer - written from the
# websocket recv thread, read from the GUI thread; plain floats so
@@ -263,10 +263,10 @@ class Window(QtWidgets.QMainWindow, Ui_MainWindow):
self.plot.reset()
self.ws_client.connect(uri=self.plainTextUri.toPlainText())
# Fetch the schedule for the Automatic tab's forecast preview - not
# a user-initiated download, so sud_download_path stays None and
# a user-initiated save, so sud_save_path stays None and
# on_sud_changed() routes the reply to update_sud_forecast() instead
# of a save dialog.
self.msg_sud.send({'Download': True})
self.msg_sud.send({'Save': True})
def on_plot_timer(self):
self.plot.sample(
@@ -352,23 +352,23 @@ class Window(QtWidgets.QMainWindow, Ui_MainWindow):
def on_action_sud_stop(self):
self.msg_sud.send({'Stop': True})
def on_action_sud_download(self):
def on_action_sud_save(self):
# Pick the destination up front, on the GUI thread - the actual
# write happens in on_sud_changed(), which runs off a worker thread
# and must not touch Qt (e.g. open a file dialog) itself.
path, _ = QtWidgets.QFileDialog.getSaveFileName(self, "Download Sud", filter="JSON files (*.json)")
path, _ = QtWidgets.QFileDialog.getSaveFileName(self, "Save Sud", filter="JSON files (*.json)")
if not path:
return
self.sud_download_path = path
self.msg_sud.send({'Download': True})
self.sud_save_path = path
self.msg_sud.send({'Save': True})
def on_action_sud_upload(self):
path, _ = QtWidgets.QFileDialog.getOpenFileName(self, "Upload Sud", filter="JSON files (*.json)")
def on_action_sud_load(self):
path, _ = QtWidgets.QFileDialog.getOpenFileName(self, "Load Sud", filter="JSON files (*.json)")
if not path:
return
with open(path) as f:
data = json.load(f)
self.msg_sud.send({'Upload': data})
self.msg_sud.send({'Load': data})
def on_pot_changed(self, msg):
print("on_pot_changed {}".format(msg))
@@ -458,10 +458,10 @@ class Window(QtWidgets.QMainWindow, Ui_MainWindow):
self.sud_loaded = True
for key in msg:
if "Json" in key:
if self.sud_download_path:
with open(self.sud_download_path, 'w') as f:
if self.sud_save_path:
with open(self.sud_save_path, 'w') as f:
json.dump(msg['Json'], f, indent='\t')
self.sud_download_path = None
self.sud_save_path = None
else:
self.update_sud_forecast(msg['Json'])
elif "Name" in key:
+10 -10
View File
@@ -1255,12 +1255,12 @@ class Ui_MainWindow(object):
self.actionPause.setObjectName("actionPause")
self.actionStop = QtWidgets.QAction(MainWindow)
self.actionStop.setObjectName("actionStop")
self.actionSudDownload = QtWidgets.QAction(MainWindow)
self.actionSudDownload.setObjectName("actionSudDownload")
self.actionSudUpload = QtWidgets.QAction(MainWindow)
self.actionSudUpload.setObjectName("actionSudUpload")
self.menu_File.addAction(self.actionSudDownload)
self.menu_File.addAction(self.actionSudUpload)
self.actionSudSave = QtWidgets.QAction(MainWindow)
self.actionSudSave.setObjectName("actionSudSave")
self.actionSudLoad = QtWidgets.QAction(MainWindow)
self.actionSudLoad.setObjectName("actionSudLoad")
self.menu_File.addAction(self.actionSudSave)
self.menu_File.addAction(self.actionSudLoad)
self.menubar.addAction(self.menu_File.menuAction())
self.menubar.addAction(self.menu_Help.menuAction())
self.toolBar.addAction(self.actionStart)
@@ -1306,7 +1306,7 @@ class Ui_MainWindow(object):
self.actionPause.setToolTip(_translate("MainWindow", "Pause"))
self.actionStop.setText(_translate("MainWindow", "Stop"))
self.actionStop.setToolTip(_translate("MainWindow", "Stop"))
self.actionSudDownload.setText(_translate("MainWindow", "&Download Sud..."))
self.actionSudDownload.setToolTip(_translate("MainWindow", "Save the running Sud\'s schedule to a local sud.json"))
self.actionSudUpload.setText(_translate("MainWindow", "&Upload Sud..."))
self.actionSudUpload.setToolTip(_translate("MainWindow", "Replace the running Sud\'s schedule with a local sud.json"))
self.actionSudSave.setText(_translate("MainWindow", "&Save Sud..."))
self.actionSudSave.setToolTip(_translate("MainWindow", "Save the running Sud\'s schedule to a local sud.json"))
self.actionSudLoad.setText(_translate("MainWindow", "&Load Sud..."))
self.actionSudLoad.setToolTip(_translate("MainWindow", "Replace the running Sud\'s schedule with a local sud.json"))