Changeset 2b48418d in OpenModelica


Ignore:
Timestamp:
2019-01-18T16:35:28+01:00 (5 years ago)
Author:
Adeel Asghar <adeel.asghar@…>
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
Message:

Adapt to oms_setTolerance

Location:
OMEdit/OMEditGUI
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • OMEdit/OMEditGUI/Modeling/Commands.cpp

    r5cdb13db r2b48418d  
    28762876      return;
    28772877    }
    2878     if (!OMSProxy::instance()->setTolerance(mpLibraryTreeItem->getNameStructure(), mpWCSystemSimulationInformation->mTolerance)) {
     2878    if (!OMSProxy::instance()->setTolerance(mpLibraryTreeItem->getNameStructure(), mpWCSystemSimulationInformation->mAbsoluteTolerance,
     2879                                            mpWCSystemSimulationInformation->mRelativeTolerance)) {
    28792880      setFailed(true);
    28802881      return;
     
    28852886      return;
    28862887    }
    2887     if (!OMSProxy::instance()->setTolerance(mpLibraryTreeItem->getNameStructure(), mpSCSystemSimulationInformation->mTolerance)) {
     2888    if (!OMSProxy::instance()->setTolerance(mpLibraryTreeItem->getNameStructure(), mpSCSystemSimulationInformation->mAbsoluteTolerance,
     2889                                            mpSCSystemSimulationInformation->mRelativeTolerance)) {
    28882890      setFailed(true);
    28892891      return;
  • OMEdit/OMEditGUI/OMS/OMSProxy.cpp

    r0bae201 r2b48418d  
    13681368 * \return
    13691369 */
    1370 bool OMSProxy::setTolerance(QString cref, double tolerance)
     1370bool OMSProxy::setTolerance(QString cref, double absoluteTolerance, double relativeTolerance)
    13711371{
    13721372  QString command = "oms_setTolerance";
    13731373  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);
    13771377  logResponse(command, status, &commandTime);
    13781378  return statusToBool(status);
  • OMEdit/OMEditGUI/OMS/OMSProxy.h

    r5cdb13db r2b48418d  
    131131  bool setTLMConnectionParameters(QString crefA, QString crefB, const oms_tlm_connection_parameters_t *pParameters);
    132132  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);
    134134  void setWorkingDirectory(QString path);
    135135  bool simulate_asynchronous(QString cref);
  • OMEdit/OMEditGUI/OMS/SystemSimulationInformationDialog.cpp

    r5ab86e24 r2b48418d  
    4949{
    5050  mFixedStepSize = 0.0;
    51   mTolerance = 0.0;
     51  mAbsoluteTolerance = 0.0;
     52  mRelativeTolerance = 0.0;
    5253}
    5354
     
    5556{
    5657  mFixedStepSize = 0.0;
    57   mTolerance = 0.0;
     58  mAbsoluteTolerance = 0.0;
     59  mRelativeTolerance = 0.0;
    5860
    5961  mDescription = "";
     
    106108    mpFixedStepSizeTextBox = new QLineEdit;
    107109    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);
    112118  } else { // oms_system_sc
    113119    // fixed step size
     
    115121    mpFixedStepSizeTextBox = new QLineEdit;
    116122    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);
    121131  }
    122132  // buttons
     
    147157    pMainLayout->addWidget(mpFixedStepSizeLabel, row, 0);
    148158    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);
    151163  } else { // oms_system_sc
    152164    pMainLayout->addWidget(mpFixedStepSizeLabel, row, 0);
    153165    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);
    156170  }
    157171  pMainLayout->addWidget(mpButtonBox, row++, 0, 1, 2, Qt::AlignRight);
     
    205219  } else if (mpGraphicsView->getModelWidget()->getLibraryTreeItem()->isWCSystem()) {
    206220    wcSystemSimulationInformation.mFixedStepSize = mpFixedStepSizeTextBox->text().toDouble();
    207     wcSystemSimulationInformation.mTolerance = mpToleranceTextBox->text().toDouble();
     221    wcSystemSimulationInformation.mAbsoluteTolerance = mpAbsoluteToleranceTextBox->text().toDouble();
     222    wcSystemSimulationInformation.mRelativeTolerance = mpRelativeToleranceTextBox->text().toDouble();
    208223  } else { // oms_system_sc
    209224    scSystemSimulationInformation.mFixedStepSize = mpFixedStepSizeTextBox->text().toDouble();
    210     scSystemSimulationInformation.mTolerance = mpToleranceTextBox->text().toDouble();
     225    wcSystemSimulationInformation.mAbsoluteTolerance = mpAbsoluteToleranceTextBox->text().toDouble();
     226    wcSystemSimulationInformation.mRelativeTolerance = mpRelativeToleranceTextBox->text().toDouble();
    211227  }
    212228  // system simulation information command
  • OMEdit/OMEditGUI/OMS/SystemSimulationInformationDialog.h

    r5ab86e24 r2b48418d  
    5858
    5959  double mFixedStepSize;
    60   double mTolerance;
     60  double mAbsoluteTolerance;
     61  double mRelativeTolerance;
    6162};
    6263
     
    6768
    6869  double mFixedStepSize;
    69   double mTolerance;
    7070
    7171  QString mDescription;
     
    9696  Label *mpFixedStepSizeLabel;
    9797  QLineEdit *mpFixedStepSizeTextBox;
    98   Label *mpToleranceLabel;
    99   QLineEdit *mpToleranceTextBox;
     98  Label *mpAbsoluteToleranceLabel;
     99  QLineEdit *mpAbsoluteToleranceTextBox;
     100  Label *mpRelativeToleranceLabel;
     101  QLineEdit *mpRelativeToleranceTextBox;
    100102  QPushButton *mpOkButton;
    101103  QPushButton *mpCancelButton;
Note: See TracChangeset for help on using the changeset viewer.