From 0494ce53ad40a8828489fc3f146732e075112dab Mon Sep 17 00:00:00 2001 From: Sven Sager Date: Thu, 31 Aug 2023 15:56:01 +0200 Subject: [PATCH] fix: Simulator always sets process image to NULL This fixes the bug that the process image for the simulation is set to NULL, even though the "Start without changing actual process image" button is pressed. Signed-off-by: Sven Sager --- src/revpicommander/helper.py | 8 +++++++- src/revpicommander/revpicommander.py | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/revpicommander/helper.py b/src/revpicommander/helper.py index 04e203b..545008a 100644 --- a/src/revpicommander/helper.py +++ b/src/revpicommander/helper.py @@ -476,7 +476,13 @@ class ConnectionManager(QtCore.QThread): self.connection_disconnected.emit() def pyload_simulate(self, configrsc: str, procimg: str, clean_existing: bool): - """Start the simulator for piControl on local computer.""" + """ + Start the simulator for piControl on local computer. + + :param configrsc: piCtory configuration + :param procimg: Process image, which is a 4 kByte file for simulation + :param clean_existing: Reset the file to ZERO \x00 bytes + """ pi.logger.debug("ConnectionManager.start_simulate") if not exists(procimg) or clean_existing: diff --git a/src/revpicommander/revpicommander.py b/src/revpicommander/revpicommander.py index 094dd6d..a4033a6 100644 --- a/src/revpicommander/revpicommander.py +++ b/src/revpicommander/revpicommander.py @@ -316,7 +316,7 @@ class RevPiCommander(QtWidgets.QMainWindow, Ui_win_revpicommander): configrsc_file = helper.settings.value("simulator/configrsc", "", str) procimg_file = helper.settings.value("simulator/procimg", "", str) - if helper.cm.pyload_simulate(configrsc_file, procimg_file, diag.cbx_stop_remove.isChecked()): + if helper.cm.pyload_simulate(configrsc_file, procimg_file, diag.clean_procimg): QtWidgets.QMessageBox.information( self, self.tr("Simulator started..."), self.tr( "The simulator is running!\n\nYou can work with this simulator if your call "