Skip to content
Snippets Groups Projects
Commit 4eeac276 authored by Mirko Wächter's avatar Mirko Wächter
Browse files

fixed infinite loop in plotter and insertion of un-initialized variables

parent 98fd740b
No related branches found
No related tags found
No related merge requests found
......@@ -211,6 +211,7 @@ namespace armarx
loggingDir = dialog->ui.editLoggingDirectory->text();
ui.btnLogToFile->setChecked(false);
curves.clear();
dataMap.clear();
ui.qwtPlot->detachItems();
clearBarList();
}
......@@ -632,10 +633,10 @@ namespace armarx
for (; itmap != dataMaptoAppend.end(); ++itmap)
{
std::vector<TimeData>& dataVec = itmap->second;
int stepSize = dataVec.size() * 0.01;
int stepSize = std::max<int>(1, dataVec.size() * 0.01);
int thresholdIndex = -1;
for (unsigned int i = 0; dataVec.size(); i += stepSize)
for (unsigned int i = 0; i < dataVec.size(); i += stepSize)
{
// only delete if entries are older than 2*showninterval
// and delete then all entries that are older than showninterval.
......@@ -694,7 +695,10 @@ namespace armarx
{
// ARMARX_IMPORTANT << "Variant: " << VariantPtr::dynamicCast(variants[i]);
VariantPtr var = VariantPtr::dynamicCast(variants[i]);
if (!var->getInitialized())
{
continue;
}
if (VariantType::IsBasicType(var->getType()))
{
dataMaptoAppend[DataFieldIdentifierPtr::dynamicCast(it->second[i])->getIdentifierStr()].push_back(TimeData(time, var));
......@@ -737,7 +741,7 @@ namespace armarx
}
catch (...)
{
handleExceptions();
ARMARX_WARNING << deactivateSpam(5) << GetHandledExceptionString();
}
return newData;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment