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

Merge branch 'ArmarXPlotterFix' into 'master'

Fixed CSV export in ArmarXPlotter class

When trying to export simulation data of ControlX with the csv export feature the plotter class produced a malformed csv with only one column containing a concatenation of the data values + iso formated time string.  I introduced a fix that writes the columns in the correct order, includes separators and spares out the time string.

See merge request !7
parents 34532dc8 62f8da71
No related branches found
No related tags found
No related merge requests found
......@@ -234,7 +234,7 @@ namespace armarx
{
logstream << "Timestamp";
for (auto& channel : selectedChannels)
for (auto & channel : selectedChannels)
{
logstream << "," << channel.toStdString();
}
......@@ -740,11 +740,15 @@ namespace armarx
if (logstream.is_open() && dataMaptoAppend.size() > 0)
{
logstream << (time - logStartTime).toMilliSecondsDouble();
logstream << (time - logStartTime).toMilliSecondsDouble() << ",";
for (const auto& elem : dataMaptoAppend)
for (auto& channel : selectedChannels)
{
logstream << "," /*<< elem.first << ","*/ << elem.second->getOutputValueOnly();
logstream << dataMaptoAppend.at(channel.toStdString())->Variant::getOutputValueOnly();
if (!selectedChannels.endsWith(channel))
{
logstream << ",";
}
}
logstream << std::endl;
......
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