From 62f8da7158f035f8f36b5bf3438598a3d5bb6033 Mon Sep 17 00:00:00 2001
From: Cornelius Goldbeck <cornelius.goldbeck@student.kit.edu>
Date: Mon, 22 Feb 2016 18:56:41 +0100
Subject: [PATCH] called variant base class method in plotter csv export to
 write value without time information; traversed plotted values in the right
 order so they match column order when creating csv file; added commmas in the
 right spots

---
 .../ArmarXPlotter/ArmarXPlotter.cpp                  | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/source/RobotAPI/gui-plugins/SensorActorWidgetsPlugin/ArmarXPlotter/ArmarXPlotter.cpp b/source/RobotAPI/gui-plugins/SensorActorWidgetsPlugin/ArmarXPlotter/ArmarXPlotter.cpp
index 759b4cb47..df065c634 100644
--- a/source/RobotAPI/gui-plugins/SensorActorWidgetsPlugin/ArmarXPlotter/ArmarXPlotter.cpp
+++ b/source/RobotAPI/gui-plugins/SensorActorWidgetsPlugin/ArmarXPlotter/ArmarXPlotter.cpp
@@ -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;
-- 
GitLab