Skip to content

Commit

Permalink
gvle.simulating.plot: fix empty columns managment
Browse files Browse the repository at this point in the history
As soon as an empty column header is detected, we assume this is the
end of the dataset to plot.
(closes vle-forge#127)
  • Loading branch information
Chabrier committed Jun 20, 2016
1 parent b3188e2 commit 7f50983
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion gvle.simulating.plot/src/sim_plot/sim_plot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,9 @@ void SimPlot::simulationGetStep()
{
QString portName;
vle::value::Value *vHead = mat->get(i, 0);
if (vHead == NULL) {
break;
}
QString colHeader = QString(vHead->toString().value().c_str());
QStringList list1 = colHeader.split(":");
if (list1.size() > 1)
Expand All @@ -395,6 +398,8 @@ void SimPlot::simulationGetStep()
portNames.append(portName);
}

uint nbColumns = i;

for (i = mViewLastRow.value(matViewName); i < mat->rows(); i++)
{
double t;
Expand All @@ -408,7 +413,7 @@ void SimPlot::simulationGetStep()
continue;
}

for (uint j = 1; j < mat->columns(); j++)
for (uint j = 1; j < nbColumns; j++)
{
vle::value::Value *vCell;
QString portName = portNames.at(j);
Expand Down

0 comments on commit 7f50983

Please sign in to comment.