From cb8b672b991d76d880d4e71a440cbc9a70f5e40d Mon Sep 17 00:00:00 2001
From: Clemens Wallrath <uagzs@student.kit.edu>
Date: Mon, 11 Jan 2016 13:01:41 +0100
Subject: [PATCH] Makes ArmarXPlotter follow Timeserver time

Notably it won't continue scrolling when the time is stopped
---
 .../ArmarXPlotter/ArmarXPlotter.cpp                   | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/source/RobotAPI/gui-plugins/SensorActorWidgetsPlugin/ArmarXPlotter/ArmarXPlotter.cpp b/source/RobotAPI/gui-plugins/SensorActorWidgetsPlugin/ArmarXPlotter/ArmarXPlotter.cpp
index df065c634..4bcb989e7 100644
--- a/source/RobotAPI/gui-plugins/SensorActorWidgetsPlugin/ArmarXPlotter/ArmarXPlotter.cpp
+++ b/source/RobotAPI/gui-plugins/SensorActorWidgetsPlugin/ArmarXPlotter/ArmarXPlotter.cpp
@@ -23,6 +23,7 @@
 #include "ArmarXPlotter.h"
 #include "ArmarXPlotterDialog.h"
 
+#include <ArmarXCore/core/time/TimeUtil.h>
 #include <ArmarXCore/observers/ObserverObjectFactories.h>
 #include <ArmarXCore/observers/variant/DataFieldIdentifier.h>
 #include <ArmarXCore/observers/exceptions/local/InvalidChannelException.h>
@@ -293,7 +294,7 @@ namespace armarx
 
         //        int size = shownInterval*1000/updateInterval;
         GraphDataMap::iterator it = dataMap.begin();
-        IceUtil::Time curTime = IceUtil::Time::now();
+        IceUtil::Time curTime = TimeUtil::GetTime();
 
         for (; it != dataMap.end(); ++it)
         {
@@ -452,7 +453,7 @@ namespace armarx
         }
         else
         {
-            pollingTask = new PeriodicTask<ArmarXPlotter>(this, & ArmarXPlotter::pollingExec, pollingInterval, false, "DataPollingTask");
+            pollingTask = new PeriodicTask<ArmarXPlotter>(this, & ArmarXPlotter::pollingExec, pollingInterval, false, "DataPollingTask", false);
             pollingTask->start();
             timer->start();
         }
@@ -585,7 +586,7 @@ namespace armarx
             pollingTask->stop();
         }
 
-        pollingTask = new PeriodicTask<ArmarXPlotter>(this, & ArmarXPlotter::pollingExec, pollingInterval, false, "DataPollingTask");
+        pollingTask = new PeriodicTask<ArmarXPlotter>(this, & ArmarXPlotter::pollingExec, pollingInterval, false, "DataPollingTask", false);
         pollingTask->start();
     }
 
@@ -618,7 +619,7 @@ namespace armarx
         std::map<std::string, VariantPtr> newData;
 
         // first clear to old entries
-        auto now = IceUtil::Time::now();
+        auto now = TimeUtil::GetTime();
         GraphDataMap::iterator itmap = dataMaptoAppend.begin();
 
         for (; itmap != dataMaptoAppend.end(); ++itmap)
@@ -664,7 +665,7 @@ namespace armarx
         }
 
         // now get new data
-        IceUtil::Time time = IceUtil::Time::now();
+        IceUtil::Time time = TimeUtil::GetTime();
         map<string, DataFieldIdentifierBaseList >::iterator it = channelsSplittedByObserver.begin();
 
         try
-- 
GitLab