From e3a546d81cd115d7cd9105fc31ecccecfb48b71d Mon Sep 17 00:00:00 2001 From: Tim Moore Date: Tue, 22 Dec 2009 11:35:38 +0100 Subject: grapher: scroll continuously with time Don't scale graph based on how much data will fit. This didn't work very well and resulted in distracting, weird scale changes. We now assume that scripts output their time (x axis) in milliseconds. * grapher/Graph.hxx (setCurrentTime): New function. * grapher/Graph.cxx (Graph::draw): Assume a fixed default scale of 1 pixel = 5 milliseconds and don't do any autoscaling. * grapher/GraphWidget.cxx (GraphWidget constructor): Set global time base on startup. (on_expose_event): Don't search graphs for earliest time. * grapher/GraphWidget.hxx (_timeBaseInitialized): delete * grapher/Time.hxx: new file; interface to timeval. --- grapher/Graph.hxx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'grapher/Graph.hxx') diff --git a/grapher/Graph.hxx b/grapher/Graph.hxx index efabd22d..d9f615b3 100644 --- a/grapher/Graph.hxx +++ b/grapher/Graph.hxx @@ -50,12 +50,14 @@ public: GraphDataList& getDatasets() { return _datasets; } int64_t getTimeAtPoint(double x); void window2GraphCoords(double x, double y, double& xgraph, double& ygraph); + static void setCurrentTime(int64_t time) { _currentTime = time; } protected: GraphDataList _datasets; int64_t _left; int64_t _right; double _top; double _bottom; + static int64_t _currentTime; }; } #endif -- cgit