Changeset 2b48418d in OpenModelica
- Timestamp:
- 2019-01-18T16:35:28+01:00 (5 years ago)
- Branches:
- Added-citation-metadata, maintenance/v1.14, maintenance/v1.15, maintenance/v1.16, maintenance/v1.17, maintenance/v1.18, maintenance/v1.19, maintenance/v1.20, maintenance/v1.21, maintenance/v1.22, maintenance/v1.23, master, omlib-staging
- Children:
- 18e18bd
- Parents:
- 0bae201
- Location:
- OMEdit/OMEditGUI
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
OMEdit/OMEditGUI/Modeling/Commands.cpp
r5cdb13db r2b48418d 2876 2876 return; 2877 2877 } 2878 if (!OMSProxy::instance()->setTolerance(mpLibraryTreeItem->getNameStructure(), mpWCSystemSimulationInformation->mTolerance)) { 2878 if (!OMSProxy::instance()->setTolerance(mpLibraryTreeItem->getNameStructure(), mpWCSystemSimulationInformation->mAbsoluteTolerance, 2879 mpWCSystemSimulationInformation->mRelativeTolerance)) { 2879 2880 setFailed(true); 2880 2881 return; … … 2885 2886 return; 2886 2887 } 2887 if (!OMSProxy::instance()->setTolerance(mpLibraryTreeItem->getNameStructure(), mpSCSystemSimulationInformation->mTolerance)) { 2888 if (!OMSProxy::instance()->setTolerance(mpLibraryTreeItem->getNameStructure(), mpSCSystemSimulationInformation->mAbsoluteTolerance, 2889 mpSCSystemSimulationInformation->mRelativeTolerance)) { 2888 2890 setFailed(true); 2889 2891 return; -
OMEdit/OMEditGUI/OMS/OMSProxy.cpp
r0bae201 r2b48418d 1368 1368 * \return 1369 1369 */ 1370 bool OMSProxy::setTolerance(QString cref, double tolerance)1370 bool OMSProxy::setTolerance(QString cref, double absoluteTolerance, double relativeTolerance) 1371 1371 { 1372 1372 QString command = "oms_setTolerance"; 1373 1373 QStringList args; 1374 args << "\"" + cref + "\"" << QString::number( tolerance);1375 LOG_COMMAND(command, args); 1376 oms_status_enu_t status = oms_setTolerance(cref.toStdString().c_str(), tolerance, tolerance);1374 args << "\"" + cref + "\"" << QString::number(absoluteTolerance) << QString::number(relativeTolerance); 1375 LOG_COMMAND(command, args); 1376 oms_status_enu_t status = oms_setTolerance(cref.toStdString().c_str(), absoluteTolerance, relativeTolerance); 1377 1377 logResponse(command, status, &commandTime); 1378 1378 return statusToBool(status); -
OMEdit/OMEditGUI/OMS/OMSProxy.h
r5cdb13db r2b48418d 131 131 bool setTLMConnectionParameters(QString crefA, QString crefB, const oms_tlm_connection_parameters_t *pParameters); 132 132 bool setTLMSocketData(QString cref, QString address, int managerPort, int monitorPort); 133 bool setTolerance(QString cref, double tolerance);133 bool setTolerance(QString cref, double absoluteTolerance, double relativeTolerance); 134 134 void setWorkingDirectory(QString path); 135 135 bool simulate_asynchronous(QString cref); -
OMEdit/OMEditGUI/OMS/SystemSimulationInformationDialog.cpp
r5ab86e24 r2b48418d 49 49 { 50 50 mFixedStepSize = 0.0; 51 mTolerance = 0.0; 51 mAbsoluteTolerance = 0.0; 52 mRelativeTolerance = 0.0; 52 53 } 53 54 … … 55 56 { 56 57 mFixedStepSize = 0.0; 57 mTolerance = 0.0; 58 mAbsoluteTolerance = 0.0; 59 mRelativeTolerance = 0.0; 58 60 59 61 mDescription = ""; … … 106 108 mpFixedStepSizeTextBox = new QLineEdit; 107 109 mpFixedStepSizeTextBox->setValidator(pDoubleValidator); 108 // tolerance 109 mpToleranceLabel = new Label("Tolerance:"); 110 mpToleranceTextBox = new QLineEdit; 111 mpToleranceTextBox->setValidator(pDoubleValidator); 110 // absolute tolerance 111 mpAbsoluteToleranceLabel = new Label("Absolute Tolerance:"); 112 mpAbsoluteToleranceTextBox = new QLineEdit; 113 mpAbsoluteToleranceTextBox->setValidator(pDoubleValidator); 114 // relative tolerance 115 mpRelativeToleranceLabel = new Label("Relative Tolerance:"); 116 mpRelativeToleranceTextBox = new QLineEdit; 117 mpRelativeToleranceTextBox->setValidator(pDoubleValidator); 112 118 } else { // oms_system_sc 113 119 // fixed step size … … 115 121 mpFixedStepSizeTextBox = new QLineEdit; 116 122 mpFixedStepSizeTextBox->setValidator(pDoubleValidator); 117 // tolerance 118 mpToleranceLabel = new Label("Tolerance:"); 119 mpToleranceTextBox = new QLineEdit; 120 mpToleranceTextBox->setValidator(pDoubleValidator); 123 // absolute tolerance 124 mpAbsoluteToleranceLabel = new Label("Absolute Tolerance:"); 125 mpAbsoluteToleranceTextBox = new QLineEdit; 126 mpAbsoluteToleranceTextBox->setValidator(pDoubleValidator); 127 // relative tolerance 128 mpRelativeToleranceLabel = new Label("Relative Tolerance:"); 129 mpRelativeToleranceTextBox = new QLineEdit; 130 mpRelativeToleranceTextBox->setValidator(pDoubleValidator); 121 131 } 122 132 // buttons … … 147 157 pMainLayout->addWidget(mpFixedStepSizeLabel, row, 0); 148 158 pMainLayout->addWidget(mpFixedStepSizeTextBox, row++, 1); 149 pMainLayout->addWidget(mpToleranceLabel, row, 0); 150 pMainLayout->addWidget(mpToleranceTextBox, row++, 1); 159 pMainLayout->addWidget(mpAbsoluteToleranceLabel, row, 0); 160 pMainLayout->addWidget(mpAbsoluteToleranceTextBox, row++, 1); 161 pMainLayout->addWidget(mpRelativeToleranceLabel, row, 0); 162 pMainLayout->addWidget(mpRelativeToleranceTextBox, row++, 1); 151 163 } else { // oms_system_sc 152 164 pMainLayout->addWidget(mpFixedStepSizeLabel, row, 0); 153 165 pMainLayout->addWidget(mpFixedStepSizeTextBox, row++, 1); 154 pMainLayout->addWidget(mpToleranceLabel, row, 0); 155 pMainLayout->addWidget(mpToleranceTextBox, row++, 1); 166 pMainLayout->addWidget(mpAbsoluteToleranceLabel, row, 0); 167 pMainLayout->addWidget(mpAbsoluteToleranceTextBox, row++, 1); 168 pMainLayout->addWidget(mpRelativeToleranceLabel, row, 0); 169 pMainLayout->addWidget(mpRelativeToleranceTextBox, row++, 1); 156 170 } 157 171 pMainLayout->addWidget(mpButtonBox, row++, 0, 1, 2, Qt::AlignRight); … … 205 219 } else if (mpGraphicsView->getModelWidget()->getLibraryTreeItem()->isWCSystem()) { 206 220 wcSystemSimulationInformation.mFixedStepSize = mpFixedStepSizeTextBox->text().toDouble(); 207 wcSystemSimulationInformation.mTolerance = mpToleranceTextBox->text().toDouble(); 221 wcSystemSimulationInformation.mAbsoluteTolerance = mpAbsoluteToleranceTextBox->text().toDouble(); 222 wcSystemSimulationInformation.mRelativeTolerance = mpRelativeToleranceTextBox->text().toDouble(); 208 223 } else { // oms_system_sc 209 224 scSystemSimulationInformation.mFixedStepSize = mpFixedStepSizeTextBox->text().toDouble(); 210 scSystemSimulationInformation.mTolerance = mpToleranceTextBox->text().toDouble(); 225 wcSystemSimulationInformation.mAbsoluteTolerance = mpAbsoluteToleranceTextBox->text().toDouble(); 226 wcSystemSimulationInformation.mRelativeTolerance = mpRelativeToleranceTextBox->text().toDouble(); 211 227 } 212 228 // system simulation information command -
OMEdit/OMEditGUI/OMS/SystemSimulationInformationDialog.h
r5ab86e24 r2b48418d 58 58 59 59 double mFixedStepSize; 60 double mTolerance; 60 double mAbsoluteTolerance; 61 double mRelativeTolerance; 61 62 }; 62 63 … … 67 68 68 69 double mFixedStepSize; 69 double mTolerance;70 70 71 71 QString mDescription; … … 96 96 Label *mpFixedStepSizeLabel; 97 97 QLineEdit *mpFixedStepSizeTextBox; 98 Label *mpToleranceLabel; 99 QLineEdit *mpToleranceTextBox; 98 Label *mpAbsoluteToleranceLabel; 99 QLineEdit *mpAbsoluteToleranceTextBox; 100 Label *mpRelativeToleranceLabel; 101 QLineEdit *mpRelativeToleranceTextBox; 100 102 QPushButton *mpOkButton; 101 103 QPushButton *mpCancelButton;
Note: See TracChangeset
for help on using the changeset viewer.