Skip to content

Commit

Permalink
Ignore the unknown simulation flag
Browse files Browse the repository at this point in the history
Show a warning to the user about the invalid flag
  • Loading branch information
adeas31 committed Oct 9, 2020
1 parent bb3b4e1 commit a6863ee
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions OMEdit/OMEditLIB/Simulation/SimulationDialog.cpp
Expand Up @@ -872,8 +872,19 @@ void SimulationDialog::initializeFields(bool isReSimulate, SimulationOptions sim
}
i++;
}
} else { // put everything else in the Additional Simulation Flags textbox
additionalSimulationFlags.insert(simulationFlag, value);
} else { // put everything else in the Additional Simulation Flags textbox only if the simulation flag is valid
bool isValidSimulationFlag = false;
for (int i = FLAG_UNKNOWN + 1 ; i < FLAG_MAX ; i++) {
if (QString(FLAG_NAME[i]).compare(simulationFlag) == 0) {
additionalSimulationFlags.insert(simulationFlag, value);
isValidSimulationFlag = true;
break;
}
}
if (!isValidSimulationFlag) {
MessagesWidget::instance()->addGUIMessage(MessageItem(MessageItem::Modelica, tr("Ignoring unknown simulation flag: %1").arg(simulationFlag),
Helper::simulationKind, Helper::warningLevel));
}
}
}
QStringList additionalSimulationFlagsList;
Expand Down

0 comments on commit a6863ee

Please sign in to comment.