Skip to content

Commit

Permalink
Add $cpuTime variable to the variables list if cpu time flag is set (#…
Browse files Browse the repository at this point in the history
…7587)

Fixes #7551
  • Loading branch information
adeas31 committed Jun 21, 2021
1 parent e30a43b commit 170459c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions OMEdit/OMEditLIB/Plotting/VariablesWidget.cpp
Expand Up @@ -736,6 +736,13 @@ bool VariablesTreeModel::insertVariablesItems(QString fileName, QString filePath
std::sort(variablesList.begin(), variablesList.end(), StringHandler::naturalSortForResultVariables);
// remove time from variables list
variablesList.removeOne("time");
/* Fixes issue #7551
* Add the $cpuTime variable to the list if cpu time flag is set.
* We read the variables from model_init.xml file that doesn't contain $cpuTime variable but is present in model_res.mat file.
*/
if (simulationOptions.isValid() && simulationOptions.getCPUTime()) {
variablesList.append("$cpuTime");
}
QStringList variables;
foreach (QString plotVariable, variablesList) {
QString parentVariable = "";
Expand Down

0 comments on commit 170459c

Please sign in to comment.