From 81ca3c1c6c8b36d0964ca0959a87b399aab943ae Mon Sep 17 00:00:00 2001 From: Andreas Nicolai Date: Tue, 7 Jan 2025 09:18:11 +0100 Subject: [PATCH] Added user interface option for tsv unconnected variable output flag (closes #48) --- MasterSimulatorUI/src/MSIMViewSimulation.cpp | 16 ++++++++++++++-- MasterSimulatorUI/src/MSIMViewSimulation.h | 2 ++ MasterSimulatorUI/src/MSIMViewSimulation.ui | 17 ++++++++++++----- 3 files changed, 28 insertions(+), 7 deletions(-) diff --git a/MasterSimulatorUI/src/MSIMViewSimulation.cpp b/MasterSimulatorUI/src/MSIMViewSimulation.cpp index 20779783..2f6d05d7 100644 --- a/MasterSimulatorUI/src/MSIMViewSimulation.cpp +++ b/MasterSimulatorUI/src/MSIMViewSimulation.cpp @@ -38,8 +38,8 @@ MSIMViewSimulation::MSIMViewSimulation(QWidget *parent) : { m_ui->setupUi(this); - connect(&MSIMProjectHandler::instance(), SIGNAL(modified(unsigned int,void*)), - this, SLOT(onModified(unsigned int,void*))); + connect(&MSIMProjectHandler::instance(), &MSIMProjectHandler::modified, + this, &MSIMViewSimulation::onModified); blockMySignals(this, true); @@ -117,6 +117,7 @@ void MSIMViewSimulation::onModified(unsigned int modificationType, void * /*data m_ui->checkBoxAdjustStepSize->setChecked( project().m_adjustStepSize); m_ui->checkBoxWriteInternalVariables->setChecked( project().m_writeInternalVariables); + m_ui->checkBoxWriteUnconnectedVariables->setChecked( project().m_writeUnconnectedFileReaderVars); m_ui->checkBoxPreventOversteppingOfEndTime->setChecked( project().m_preventOversteppingOfEndTime); blockMySignals(this, false); @@ -536,6 +537,15 @@ void MSIMViewSimulation::on_checkBoxWriteInternalVariables_toggled(bool checked) } +void MSIMViewSimulation::on_checkBoxWriteUnconnectedVariables_toggled(bool checked) { + MASTER_SIM::Project p = project(); // create copy of project + p.m_writeUnconnectedFileReaderVars = checked; + + MSIMUndoSimulationSettings * cmd = new MSIMUndoSimulationSettings(tr("Simulation setting changed"), p); + cmd->push(); +} + + void MSIMViewSimulation::on_checkBoxPreventOversteppingOfEndTime_toggled(bool checked) { MASTER_SIM::Project p = project(); // create copy of project p.m_preventOversteppingOfEndTime = checked; @@ -553,3 +563,5 @@ void MSIMViewSimulation::on_checkBoxSkipUnzip_toggled(bool) { updateCommandLine(); } + + diff --git a/MasterSimulatorUI/src/MSIMViewSimulation.h b/MasterSimulatorUI/src/MSIMViewSimulation.h index 67b79bd6..f0bdf550 100644 --- a/MasterSimulatorUI/src/MSIMViewSimulation.h +++ b/MasterSimulatorUI/src/MSIMViewSimulation.h @@ -65,6 +65,7 @@ private slots: void on_pushButtonShowLogfile_clicked(); void on_checkBoxWriteInternalVariables_toggled(bool checked); + void on_checkBoxWriteUnconnectedVariables_toggled(bool checked); void on_checkBoxPreventOversteppingOfEndTime_toggled(bool checked); @@ -72,6 +73,7 @@ private slots: void on_checkBoxSkipUnzip_toggled(bool checked); + private: void updateCommandLine(); diff --git a/MasterSimulatorUI/src/MSIMViewSimulation.ui b/MasterSimulatorUI/src/MSIMViewSimulation.ui index 8764456c..396a5cad 100644 --- a/MasterSimulatorUI/src/MSIMViewSimulation.ui +++ b/MasterSimulatorUI/src/MSIMViewSimulation.ui @@ -221,16 +221,23 @@ - - + + + + Write internal variables as outputs + + - - + + + + + - Write internal variables as outputs + Write not connected variables from file reader slaves