Skip to content

Commit

Permalink
Change FMI version type from double to QString
Browse files Browse the repository at this point in the history
  • Loading branch information
atrosinenko authored and adeas31 committed Oct 2, 2018
1 parent b144bb4 commit 1f1ae50
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion OMEdit/OMEditGUI/MainWindow.cpp
Expand Up @@ -864,7 +864,7 @@ void MainWindow::exportModelFMU(LibraryTreeItem *pLibraryTreeItem)
// set the folder as working directory
MainWindow::instance()->getOMCProxy()->changeDirectory(modelDirectoryPath);
// buildModelFMU parameters
double version = OptionsDialog::instance()->getFMIPage()->getFMIExportVersion();
QString version = OptionsDialog::instance()->getFMIPage()->getFMIExportVersion();
QString type = OptionsDialog::instance()->getFMIPage()->getFMIExportType();
QString FMUName = OptionsDialog::instance()->getFMIPage()->getFMUNameTextBox()->text();
QSettings *pSettings = Utilities::getApplicationSettings();
Expand Down
4 changes: 2 additions & 2 deletions OMEdit/OMEditGUI/OMC/OMCProxy.cpp
Expand Up @@ -2311,10 +2311,10 @@ OMCInterface::getSimulationOptions_res OMCProxy::getSimulationOptions(QString cl
* \param platforms
* \return
*/
QString OMCProxy::buildModelFMU(QString className, double version, QString type, QString fileNamePrefix, QList<QString> platforms, bool includeResources)
QString OMCProxy::buildModelFMU(QString className, QString version, QString type, QString fileNamePrefix, QList<QString> platforms, bool includeResources)
{
fileNamePrefix = fileNamePrefix.isEmpty() ? "<default>" : fileNamePrefix;
QString fmuFileName = mpOMCInterface->buildModelFMU(className, QString::number(version), type, fileNamePrefix, platforms, includeResources);
QString fmuFileName = mpOMCInterface->buildModelFMU(className, version, type, fileNamePrefix, platforms, includeResources);
if (!fmuFileName.isEmpty()) {
MainWindow::instance()->getLibraryWidget()->getLibraryTreeModel()->loadDependentLibraries(getClassNames());
}
Expand Down
2 changes: 1 addition & 1 deletion OMEdit/OMEditGUI/OMC/OMCProxy.h
Expand Up @@ -206,7 +206,7 @@ class OMCProxy : public QObject
QString checkAllModelsRecursive(QString className);
bool isExperiment(QString className);
OMCInterface::getSimulationOptions_res getSimulationOptions(QString className, double defaultTolerance = 1e-6);
QString buildModelFMU(QString className, double version, QString type, QString fileNamePrefix, QList<QString> platforms, bool includeResources = true);
QString buildModelFMU(QString className, QString version, QString type, QString fileNamePrefix, QList<QString> platforms, bool includeResources = true);
QString translateModelXML(QString className);
QString importFMU(QString fmuName, QString outputDirectory, int logLevel, bool debugLogging, bool generateInputConnectors, bool generateOutputConnectors);
QString importFMUModelDescription(QString fmuModelDescriptionName, QString outputDirectory, int logLevel, bool debugLogging, bool generateInputConnectors, bool generateOutputConnectors);
Expand Down
12 changes: 6 additions & 6 deletions OMEdit/OMEditGUI/Options/OptionsDialog.cpp
Expand Up @@ -774,7 +774,7 @@ void OptionsDialog::readDebuggerSettings()
void OptionsDialog::readFMISettings()
{
if (mpSettings->contains("FMIExport/Version")) {
mpFMIPage->setFMIExportVersion(mpSettings->value("FMIExport/Version").toDouble());
mpFMIPage->setFMIExportVersion(mpSettings->value("FMIExport/Version").toString());
}
if (mpSettings->contains("FMIExport/Type")) {
mpFMIPage->setFMIExportType(mpSettings->value("FMIExport/Type").toString());
Expand Down Expand Up @@ -4516,9 +4516,9 @@ FMIPage::FMIPage(OptionsDialog *pOptionsDialog)
* Sets the FMI export version
* \param version
*/
void FMIPage::setFMIExportVersion(double version)
void FMIPage::setFMIExportVersion(QString version)
{
if (version == 1.0) {
if (version == "1.0" || version == "1") {
mpVersion1RadioButton->setChecked(true);
} else {
mpVersion2RadioButton->setChecked(true);
Expand All @@ -4530,12 +4530,12 @@ void FMIPage::setFMIExportVersion(double version)
* Gets the FMI export version
* \return
*/
double FMIPage::getFMIExportVersion()
QString FMIPage::getFMIExportVersion()
{
if (mpVersion1RadioButton->isChecked()) {
return 1.0;
return "1.0";
} else {
return 2.0;
return "2.0";
}
}

Expand Down
4 changes: 2 additions & 2 deletions OMEdit/OMEditGUI/Options/OptionsDialog.h
Expand Up @@ -869,8 +869,8 @@ class FMIPage : public QWidget
Q_OBJECT
public:
FMIPage(OptionsDialog *pOptionsDialog);
void setFMIExportVersion(double version);
double getFMIExportVersion();
void setFMIExportVersion(QString version);
QString getFMIExportVersion();
void setFMIExportType(QString type);
QString getFMIExportType();
QLineEdit* getFMUNameTextBox() {return mpFMUNameTextBox;}
Expand Down

0 comments on commit 1f1ae50

Please sign in to comment.