Skip to content

Commit

Permalink
Map array plot to Modelica array that starts from one and not from zero
Browse files Browse the repository at this point in the history
  • Loading branch information
adeas31 committed Apr 12, 2022
1 parent 29821fa commit d2e9e4f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions OMPlot/OMPlot/OMPlotGUI/PlotWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@ void PlotWindow::plotArray(double time, PlotCurve *pPlotCurve)
readPLTArray(mpTextStream, currentVariable, alpha, intervalSize, it, arrLst);
for (int i = 0; i < arrLst.length(); i++)
{
pPlotCurve->addXAxisValue(i);
pPlotCurve->addXAxisValue(i+1);
pPlotCurve->addYAxisValue(arrLst[i]);
}
pPlotCurve->setData(pPlotCurve->getXAxisVector(), pPlotCurve->getYAxisVector(), pPlotCurve->getSize());
Expand Down Expand Up @@ -1037,7 +1037,7 @@ void PlotWindow::plotArray(double time, PlotCurve *pPlotCurve)
pPlotCurve->clearXAxisVector();
pPlotCurve->clearYAxisVector();
for (int j = 0; j < res.count(); j++){
pPlotCurve->addXAxisValue(j);
pPlotCurve->addXAxisValue(j+1);
pPlotCurve->addYAxisValue(res[j]);
}
pPlotCurve->setData(pPlotCurve->getXAxisVector(), pPlotCurve->getYAxisVector(), pPlotCurve->getSize());
Expand Down Expand Up @@ -1098,7 +1098,7 @@ void PlotWindow::plotArray(double time, PlotCurve *pPlotCurve)
pPlotCurve->clearXAxisVector();
pPlotCurve->clearYAxisVector();
for (int i = 0; i < vars.count(); i++){
pPlotCurve->addXAxisValue(i);
pPlotCurve->addXAxisValue(i+1);
pPlotCurve->addYAxisValue(res[i]);
}
pPlotCurve->setData(pPlotCurve->getXAxisVector(), pPlotCurve->getYAxisVector(), pPlotCurve->getSize());
Expand Down

0 comments on commit d2e9e4f

Please sign in to comment.