@@ -516,6 +516,9 @@ void OptionsDialog::readFMISettings()
516516 if (mpSettings->contains (" FMIExport/Version" )) {
517517 mpFMIPage->setFMIExportVersion (mpSettings->value (" FMIExport/Version" ).toDouble ());
518518 }
519+ if (mpSettings->contains (" FMIExport/Type" )) {
520+ mpFMIPage->setFMIExportType (mpSettings->value (" FMIExport/Type" ).toString ());
521+ }
519522 if (mpSettings->contains (" FMI/FMUName" )) {
520523 mpFMIPage->getFMUNameTextBox ()->setText (mpSettings->value (" FMI/FMUName" ).toString ());
521524 }
@@ -855,6 +858,7 @@ void OptionsDialog::saveDebuggerSettings()
855858void OptionsDialog::saveFMISettings ()
856859{
857860 mpSettings->setValue (" FMIExport/Version" , mpFMIPage->getFMIExportVersion ());
861+ mpSettings->setValue (" FMIExport/Type" , mpFMIPage->getFMIExportType ());
858862 mpSettings->setValue (" FMI/FMUName" , mpFMIPage->getFMUNameTextBox ()->text ());
859863}
860864
@@ -1453,7 +1457,7 @@ LibrariesPage::LibrariesPage(OptionsDialog *pOptionsDialog)
14531457 mpSystemLibrariesTree->setColumnCount (2 );
14541458 mpSystemLibrariesTree->setTextElideMode (Qt::ElideMiddle);
14551459 QStringList systemLabels;
1456- systemLabels << tr (" Name" ) << tr ( " Version " ) ;
1460+ systemLabels << tr (" Name" ) << Helper::version ;
14571461 mpSystemLibrariesTree->setHeaderLabels (systemLabels);
14581462 connect (mpSystemLibrariesTree, SIGNAL (itemDoubleClicked (QTreeWidgetItem*,int )), SLOT (openEditSystemLibrary ()));
14591463 // system libraries buttons
@@ -1631,7 +1635,7 @@ AddSystemLibraryDialog::AddSystemLibraryDialog(LibrariesPage *pLibrariesPage)
16311635 mpNameComboBox->addItem (key,key);
16321636 }
16331637
1634- mpValueLabel = new Label (Helper::version);
1638+ mpValueLabel = new Label (Helper::version + " : " );
16351639 mpVersionTextBox = new QLineEdit (" default" );
16361640 mpOkButton = new QPushButton (Helper::ok);
16371641 connect (mpOkButton, SIGNAL (clicked ()), SLOT (addSystemLibrary ()));
@@ -3361,38 +3365,53 @@ void DebuggerPage::browseGDBPath()
33613365}
33623366
33633367/* !
3364- \class DebuggerPage
3365- \brief Creates an interface for debugger settings.
3366- */
3368+ * \class DebuggerPage
3369+ * \brief Creates an interface for debugger settings.
3370+ */
33673371/* !
3368- \param pParent - pointer to OptionsDialog
3369- */
3372+ * \brief FMIPage::FMIPage
3373+ * \param pParent - pointer to OptionsDialog
3374+ */
33703375FMIPage::FMIPage (OptionsDialog *pOptionsDialog)
33713376 : QWidget(pOptionsDialog)
33723377{
33733378 mpOptionsDialog = pOptionsDialog;
33743379 mpExportGroupBox = new QGroupBox (tr (" Export" ));
33753380 // FMI export version
3376- mpVersionLabel = new Label (Helper::version);
3381+ mpVersionGroupBox = new QGroupBox (Helper::version);
33773382 mpVersion1RadioButton = new QRadioButton (" 1.0" );
33783383 mpVersion2RadioButton = new QRadioButton (" 2.0" );
33793384 mpVersion2RadioButton->setChecked (true );
3380- // set the version group box layout
3381- QHBoxLayout *pVersionLayout = new QHBoxLayout ;
3385+ // set the version groupbox layout
3386+ QVBoxLayout *pVersionLayout = new QVBoxLayout ;
33823387 pVersionLayout->setAlignment (Qt::AlignTop | Qt::AlignLeft);
33833388 pVersionLayout->addWidget (mpVersion1RadioButton);
33843389 pVersionLayout->addWidget (mpVersion2RadioButton);
3390+ mpVersionGroupBox->setLayout (pVersionLayout);
3391+ // FMI export type
3392+ mpTypeGroupBox = new QGroupBox (Helper::type);
3393+ mpModelExchangeRadioButton = new QRadioButton (tr (" Model Exchange" ));
3394+ mpCoSimulationRadioButton = new QRadioButton (tr (" Co-Simulation" ));
3395+ mpModelExchangeCoSimulationRadioButton = new QRadioButton (tr (" Model Exchange and Co-Simulation" ));
3396+ mpModelExchangeCoSimulationRadioButton->setChecked (true );
3397+ // set the type groupbox layout
3398+ QVBoxLayout *pTypeLayout = new QVBoxLayout;
3399+ pTypeLayout->setAlignment (Qt::AlignTop | Qt::AlignLeft);
3400+ pTypeLayout->addWidget (mpModelExchangeRadioButton);
3401+ pTypeLayout->addWidget (mpCoSimulationRadioButton);
3402+ pTypeLayout->addWidget (mpModelExchangeCoSimulationRadioButton);
3403+ mpTypeGroupBox->setLayout (pTypeLayout);
33853404 // FMU name prefix
33863405 mpFMUNameLabel = new Label (tr (" FMU Name:" ));
33873406 mpFMUNameTextBox = new QLineEdit;
33883407 mpFMUNameTextBox->setPlaceholderText (" <default>" );
33893408 // set the export group box layout
33903409 QGridLayout *pExportLayout = new QGridLayout;
33913410 pExportLayout->setAlignment (Qt::AlignTop | Qt::AlignLeft);
3392- pExportLayout->addWidget (mpVersionLabel , 0 , 0 );
3393- pExportLayout->addLayout (pVersionLayout, 0 , 1 );
3394- pExportLayout->addWidget (mpFMUNameLabel, 1 , 0 );
3395- pExportLayout->addWidget (mpFMUNameTextBox, 1 , 1 );
3411+ pExportLayout->addWidget (mpVersionGroupBox , 0 , 0 , 1 , 2 );
3412+ pExportLayout->addWidget (mpTypeGroupBox, 1 , 0 , 1 , 2 );
3413+ pExportLayout->addWidget (mpFMUNameLabel, 2 , 0 );
3414+ pExportLayout->addWidget (mpFMUNameTextBox, 2 , 1 );
33963415 mpExportGroupBox->setLayout (pExportLayout);
33973416 // set the layout
33983417 QVBoxLayout *pMainLayout = new QVBoxLayout;
@@ -3402,6 +3421,11 @@ FMIPage::FMIPage(OptionsDialog *pOptionsDialog)
34023421 setLayout (pMainLayout);
34033422}
34043423
3424+ /* !
3425+ * \brief FMIPage::setFMIExportVersion
3426+ * Sets the FMI export version
3427+ * \param version
3428+ */
34053429void FMIPage::setFMIExportVersion (double version)
34063430{
34073431 if (version == 1.0 ) {
@@ -3411,6 +3435,11 @@ void FMIPage::setFMIExportVersion(double version)
34113435 }
34123436}
34133437
3438+ /* !
3439+ * \brief FMIPage::getFMIExportVersion
3440+ * Gets the FMI export version
3441+ * \return
3442+ */
34143443double FMIPage::getFMIExportVersion ()
34153444{
34163445 if (mpVersion1RadioButton->isChecked ()) {
@@ -3420,6 +3449,38 @@ double FMIPage::getFMIExportVersion()
34203449 }
34213450}
34223451
3452+ /* !
3453+ * \brief FMIPage::setFMIExportType
3454+ * Sets the FMI export type
3455+ * \param type
3456+ */
3457+ void FMIPage::setFMIExportType (QString type)
3458+ {
3459+ if (type.compare (" me" ) == 0 ) {
3460+ mpModelExchangeRadioButton->setChecked (true );
3461+ } else if (type.compare (" cs" ) == 0 ) {
3462+ mpCoSimulationRadioButton->setChecked (true );
3463+ } else {
3464+ mpModelExchangeCoSimulationRadioButton->setChecked (true );
3465+ }
3466+ }
3467+
3468+ /* !
3469+ * \brief FMIPage::getFMIExportType
3470+ * Gets the FMI export type
3471+ * \return
3472+ */
3473+ QString FMIPage::getFMIExportType ()
3474+ {
3475+ if (mpModelExchangeRadioButton->isChecked ()) {
3476+ return " me" ;
3477+ } else if (mpCoSimulationRadioButton->isChecked ()) {
3478+ return " cs" ;
3479+ } else {
3480+ return " me_cs" ;
3481+ }
3482+ }
3483+
34233484/* !
34243485 * \class TLMPage
34253486 * Creates an interface for TLM settings.
0 commit comments