Changeset bb66619 in OpenModelica


Ignore:
Timestamp:
2022-03-07T12:50:28+01:00 (2 years ago)
Author:
Adeel Asghar <adeel.asghar@…>
Children:
5531a60d
Parents:
7f7f27ed
Message:

Start reading the results

Location:
OMEdit/OMEditLIB/OMS
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • OMEdit/OMEditLIB/OMS/OMSSimulationOutputWidget.cpp

    r7f7f27ed rbb66619  
    6363QString OMSInteractiveCommands::_signals = QStringLiteral("signals");
    6464QString OMSInteractiveCommands::available = QStringLiteral("available");
     65QString OMSInteractiveCommands::results = QStringLiteral("results");
    6566
    6667/*!
     
    399400
    400401/*!
     402 * \brief OMSSimulationOutputWidget::parseSimulationResults
     403 * \param results
     404 */
     405void OMSSimulationOutputWidget::parseSimulationResults(const QVariant results)
     406{
     407  qDebug() << results.toMap();
     408}
     409
     410/*!
    401411 * \brief OMSSimulationOutputWidget::simulationProcessStarted
    402412 * Updates the simulation output window when the simulation has started.
     
    485495  if (data.startsWith(OMSInteractiveCommands::status.toStdString().c_str())) {
    486496    jsonData = data.mid(QString(OMSInteractiveCommands::status).length());
     497  } else if (data.startsWith(OMSInteractiveCommands::results.toStdString().c_str())) {
     498    jsonData = data.mid(QString(OMSInteractiveCommands::results).length());
    487499  } else {
    488500    writeSimulationOutput(QString("Unknown simulation data %1.\n").arg(QString(data)), StringHandler::Error);
     
    496508    if (data.startsWith(OMSInteractiveCommands::status.toStdString().c_str())) {
    497509      parseSimulationProgress(jsonDocument.result);
     510    } else if (data.startsWith(OMSInteractiveCommands::results.toStdString().c_str())) {
     511      parseSimulationResults(jsonDocument.result);
    498512    }
    499513  }
     
    509523void OMSSimulationOutputWidget::simulationReply(const QByteArray &reply, const QJsonObject &jsonObject)
    510524{
    511   writeSimulationOutput("client: " + reply + "\n", StringHandler::OMEditInfo);
     525  if (MainWindow::instance()->isDebug()) {
     526    writeSimulationOutput("client: " + reply + "\n", StringHandler::OMEditInfo);
     527  }
    512528  JsonDocument jsonDocument;
    513529  if (jsonDocument.parse(reply)) {
  • OMEdit/OMEditLIB/OMS/OMSSimulationOutputWidget.h

    r58da1139 rbb66619  
    6262  static QString _signals;
    6363  static QString available;
     64  static QString results;
    6465};
    6566
     
    143144  void parseSimulationProgress(const QVariant progress);
    144145  void parseSimulationVariables(const QVariant variables);
     146  void parseSimulationResults(const QVariant results);
    145147signals:
    146148  void sendRequest(const QJsonObject &jsonObject);
Note: See TracChangeset for help on using the changeset viewer.