Changeset 2f917908 in OpenModelica
- Timestamp:
- 2021-11-24T09:57:33+01:00 (2 years ago)
- Parents:
- 7bb55ae
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
OMEdit/OMEditLIB/Plotting/PlotWindowContainer.cpp
r74ea5aef r2f917908 582 582 data << QString::number(timeVector.at(i)); 583 583 foreach (PlotCurve *pPlotCurve, pPlotWindow->getPlot()->getPlotCurvesList()) { 584 double value; 584 585 if (pPlotCurve && pPlotCurve->mYAxisVector.size() > i) { // parameters have just start and stop points in the dataset 585 OMCInterface::convertUnits_res convertUnit = MainWindow::instance()->getOMCProxy()->convertUnits(pPlotCurve->getYDisplayUnit(), pPlotCurve->getYUnit()); 586 if (convertUnit.unitsCompatible) { 587 data << StringHandler::number(Utilities::convertUnit(pPlotCurve->mYAxisVector.at(i), convertUnit.offset, convertUnit.scaleFactor)); 588 } else { 589 data << StringHandler::number(pPlotCurve->mYAxisVector.at(i)); 590 } 586 value = pPlotCurve->mYAxisVector.at(i); 591 587 } else if (pPlotCurve && pPlotCurve->mYAxisVector.size() > 0) { // Set last value to have constant values for parameters 592 data << StringHandler::number(pPlotCurve->mYAxisVector.last()); 593 } else { // otherwise set value to 0. But perhaps we should never reach there. 594 data << StringHandler::number(0); 588 value = pPlotCurve->mYAxisVector.last(); 589 } else { // otherwise set value to 0.0 but perhaps we should never reach there. 590 value = 0.0; 591 } 592 OMCInterface::convertUnits_res convertUnit = MainWindow::instance()->getOMCProxy()->convertUnits(pPlotCurve->getYDisplayUnit(), pPlotCurve->getYUnit()); 593 if (convertUnit.unitsCompatible) { 594 data << StringHandler::number(Utilities::convertUnit(value, convertUnit.offset, convertUnit.scaleFactor)); 595 } else { 596 data << StringHandler::number(value); 595 597 } 596 598 }
Note: See TracChangeset
for help on using the changeset viewer.