From 572a176d481c329b370ce52e7bec1a49ed76c225 Mon Sep 17 00:00:00 2001 From: Tim Moore Date: Tue, 1 Dec 2009 12:02:24 +0100 Subject: change time type from double to int64_t * grapher/Graph.hxx (Graph): Change variables holding the time limits of the displayed graph from double to int64_t. * grapher/Graph.cxx (Graph::draw): Do calculations of time differences using int64_t. (Graph::getExtents, Graph::setExtents): Change left and right arguments to int64_t. * grapher/GraphData.hxx (GraphDataBase): Change time type to int64_t. (GraphDataBase::elementAsString): New function. (GraphData::elementAsString): Implementation of that function. * grapher/StapParser.cxx (parseData): Parse time values from the stap script as 64 bit values. --- grapher/Graph.hxx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'grapher/Graph.hxx') diff --git a/grapher/Graph.hxx b/grapher/Graph.hxx index aad63767..e0e864d6 100644 --- a/grapher/Graph.hxx +++ b/grapher/Graph.hxx @@ -11,6 +11,7 @@ namespace systemtap class Graph : public CairoWidget { public: + typedef std::vector > DatasetList; friend class GraphWidget; Graph(double x = 0.0, double y = 0.0); virtual void draw(Cairo::RefPtr cr); @@ -20,9 +21,9 @@ namespace systemtap bool getAutoScaling() const { return _autoScaling; } void setAutoScaling(bool val) { _autoScaling = val; } void addGraphData(std::tr1::shared_ptr data); - void getExtents(double& left, double& right, double& top, double& bottom) + void getExtents(int64_t& left, int64_t& right, double& top, double& bottom) const; - void setExtents(double left, double right, double top, double bottom); + void setExtents(int64_t left, int64_t right, double top, double bottom); // extents of the whole graph area double _width; double _height; @@ -36,11 +37,12 @@ namespace systemtap bool _autoScrolling; double _zoomFactor; std::tr1::shared_ptr _playButton; + DatasetList& getDatasets() { return _datasets; } + int64_t getTimeAtPoint(double x); protected: - typedef std::vector > DatasetList; DatasetList _datasets; - double _left; - double _right; + int64_t _left; + int64_t _right; double _top; double _bottom; }; -- cgit