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 <akira@narux.de>
This commit is contained in:
2023-08-31 15:56:01 +02:00
parent c56c33f4e5
commit 0494ce53ad
2 changed files with 8 additions and 2 deletions

View File

@@ -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:

View File

@@ -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 "