monitor.graphmonitor
Base class for graph (system monitor style) monitors.
- SubMonitor newGraphMonitor(Monitored, Statistics, Values...)(Monitored monitored);
Create and return a reference to a graph monitor with specified parameters.
Parameters:Examples:Monitored Type of monitored object. Must have a sendStatistics signal that passes a Statistics struct. Statistics Struct used by the Monitorable to send statistics to the GraphMonitor. Values Strings specifying names of values measured. Must correspond with public data members of Statistics. struct StatisticsExample { int a; int b; } class MonitoredExample { private: StatisticsExample statistics_; public: mixin Signal!(StatisticsExample) sendStatistics; void update() { //send statistics sendStatistics.emit(statistics_); //reset statistics for next measurement statistics_.a = statistics_.b = 0; } //stuff done between updates void doStuff(){statistics_.a++;} void doSomethingElse(){statistics_.b++;} SubMonitor monitor() { //get a graph monitor monitoring this object return newGraphMonitor!(MonitoredExample, StatisticsExample, "a")(this); } }
- class GraphMonitor(Monitored,Statistics,Values...): SubMonitor;
Monitor that measures statistics of monitored object and stores them in GraphData.
Parameters:- GraphData data_;
Graph data.
- string[] graphNames_;
Names of the graphs.
- void delegate() disconnect_;
Disconnects the monitor from monitorable's sendStatistics.
- pure GraphData data();
- pure string[] graphNames();
Get names of the graphs.
- this(Monitored monitored, GraphData graphData, string[] graphNames);
Construct a GraphMonitor.
Parameters:Monitored monitored Object to monitor. GraphData graphData Graph data to store statistics in. string[] graphNames Names of graphs in graphData. - void receiveStatistics(Statistics statistics);
Receive statistics data from the monitored object.
- class GraphMonitorView(GraphMonitor): SubMonitorView;
GUI view for GraphMonitor.
Allows the user to view a system monitor style graph, select which values to view, pan and zoom the view and change graph resolution.
Parameters:GraphMonitor Type of GraphMonitor (template specialization) viewed. - GraphMonitor monitor_;
Graph monitor viewed.
- GUILineGraph graph_;
Graph widget.
- GUIButton[string] valueButtons_;
Buttons used to toggle display of values on the graph.
- float scaleXDefault_;
Default graph X scale to return to after zooming.
- float zoomMult_;
Zoom multiplier corresponding to one zoom level.
- this(GraphMonitor monitor);
Construct a GraphMonitorView viewing specified monitor.
- void initGraph();
Initialize the graph widget.
- void initMouse();
Initialize mouse control.
- void initToggles();
Initialize buttons that toggle values' graph display.
- void initMenu();
Initialize menu.
- void resolutionIncrease();
Decrease graph data point time - used by resolution + button.
- void resolutionDecrease();
Increase graph data point time - used by resolution - button.
- void sum();
- void average();
- void zoom(float relative);
Zoom by specified number of levels.
- void pan(Vector2f relative);
Pan view with specified offset.
- void resetView();
Restore default view.