From 03ebf81c360e429ef1e4f8bae48fe524f712589a Mon Sep 17 00:00:00 2001 From: Tim Moore Date: Thu, 3 Dec 2009 19:31:08 +0100 Subject: Hover text for event-style graphs Don't draw the data value for an event; only display it in hover text. * grapher/Graph.hxx (window2GraphCoords): new function * grapher/Graph.cxx (window2GraphCoords): ditto * grapher/GraphStyle.cxx (GraphStyleEvent::dataIndexAtPoint): new function implementation. --- grapher/Graph.hxx | 1 + 1 file changed, 1 insertion(+) (limited to 'grapher/Graph.hxx') diff --git a/grapher/Graph.hxx b/grapher/Graph.hxx index b9efb2a2..044a66d3 100644 --- a/grapher/Graph.hxx +++ b/grapher/Graph.hxx @@ -41,6 +41,7 @@ namespace systemtap std::tr1::shared_ptr _playButton; DatasetList& getDatasets() { return _datasets; } int64_t getTimeAtPoint(double x); + void window2GraphCoords(double x, double y, double& xgraph, double& ygraph); protected: DatasetList _datasets; int64_t _left; -- cgit From 5891de489db0e172162279247fb633a719fa3756 Mon Sep 17 00:00:00 2001 From: Tim Moore Date: Mon, 7 Dec 2009 12:43:56 +0100 Subject: option to display graph times relative to the start time This avoids having humongous numbers displayed on the graphs' x axis. Also, the dialog for adding a data set to a graph was cleaned up. * grapher/graph-dialog.glade: Add check box for display of relative time and a label for the data set list. Force the list of data sets to be larger. * grapher/Graph.hxx (_timeBase): new member * grapher/Graph.cxx (draw): Subtract _timeBase from displayed time value. * grapher/GraphWidget.hxx (DataModelColumns): Add a column for a data set's title, which is optional at the moment. * grapher/GraphWidget.hxx (_globalTimeBase, _timeBaseInitialized, _relativeTimesButton, _displayRelativeTimes): new members * grapher/GraphWidget.hxx (GraphWidget): Hook up check button for displaying relative time. (on_expose_event): Determine base time if needed; set base time in graphs. (onDataDialogOpen): Insert graph data set's name (key) and title into the list of data sets. --- grapher/Graph.hxx | 1 + 1 file changed, 1 insertion(+) (limited to 'grapher/Graph.hxx') diff --git a/grapher/Graph.hxx b/grapher/Graph.hxx index 044a66d3..93e23deb 100644 --- a/grapher/Graph.hxx +++ b/grapher/Graph.hxx @@ -39,6 +39,7 @@ namespace systemtap double _xOffset; double _yOffset; std::tr1::shared_ptr _playButton; + int64_t _timeBase; DatasetList& getDatasets() { return _datasets; } int64_t getTimeAtPoint(double x); void window2GraphCoords(double x, double y, double& xgraph, double& ygraph); -- cgit From f669d095ba7fe5a623b31abc05b4f6664059803b Mon Sep 17 00:00:00 2001 From: Tim Moore Date: Mon, 7 Dec 2009 19:19:45 +0100 Subject: add copyright and license to grapher files --- grapher/Graph.hxx | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'grapher/Graph.hxx') diff --git a/grapher/Graph.hxx b/grapher/Graph.hxx index 93e23deb..4dcb5169 100644 --- a/grapher/Graph.hxx +++ b/grapher/Graph.hxx @@ -1,3 +1,11 @@ +// systemtap grapher +// Copyright (C) 2009 Red Hat Inc. +// +// This file is part of systemtap, and is free software. You can +// redistribute it and/or modify it under the terms of the GNU General +// Public License (GPL); either version 2, or (at your option) any +// later version. + #ifndef SYSTEMTAP_GRAPH_HXX #define SYSTEMTAP_GRAPH_HXX 1 -- cgit From cfd482078cd4805076cc6fd7e4e8642b97a03b25 Mon Sep 17 00:00:00 2001 From: Tim Moore Date: Tue, 8 Dec 2009 12:44:03 +0100 Subject: refactor list of data sets out of GraphWidget into a global data structure. Also, add a sigc signal for broadcasting data set changes. * grapher/GraphData.hxx (GraphDataList) new typedef (getGraphData, graphDataSignal): new functions * grapher/Graph.hxx (DatasetList): remove typedef in favor of systemtap::GraphDataList * grapher/GraphWidget.cxx (GraphWidget, onGraphDataChanged): Use graphDataSignal to notice new data sets that need to be added. Use the global data set list instead of one embedded in GraphWidget. * grapher/StapParser.hxx: delete the _widget member; use signals to broadcast that there are new data sets instead of calling into the widget. --- grapher/Graph.hxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'grapher/Graph.hxx') diff --git a/grapher/Graph.hxx b/grapher/Graph.hxx index 4dcb5169..c928fec2 100644 --- a/grapher/Graph.hxx +++ b/grapher/Graph.hxx @@ -19,7 +19,6 @@ 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); @@ -48,11 +47,11 @@ namespace systemtap double _yOffset; std::tr1::shared_ptr _playButton; int64_t _timeBase; - DatasetList& getDatasets() { return _datasets; } + GraphDataList& getDatasets() { return _datasets; } int64_t getTimeAtPoint(double x); void window2GraphCoords(double x, double y, double& xgraph, double& ygraph); protected: - DatasetList _datasets; + GraphDataList _datasets; int64_t _left; int64_t _right; double _top; -- cgit