boost::optional<diagnostics::guide> guide_;\r
boost::circular_buffer<std::pair<double, bool>> line_data_;\r
\r
- std::vector<float> tick_data_;\r
+ std::vector<double> tick_data_;\r
bool tick_tag_;\r
color c_;\r
public:\r
target.Draw(*guide_);\r
\r
glBegin(GL_LINE_STRIP);\r
- glColor4f(c_.red, c_.green, c_.blue, 0.7f); \r
+ glColor4f(c_.red, c_.green, c_.blue, 0.8f); \r
for(size_t n = 0; n < line_data_.size(); ++n) \r
if(line_data_[n].first > -0.5)\r
glVertex3d(x+n*dx, std::max(0.05, std::min(0.95, (1.0f-line_data_[n].first)*0.8 + 0.1f)), 0.0); \r
\r
implementation(const printer& parent_printer) \r
: parent_printer_(parent_printer)\r
- , name_(parent_printer_ ? narrow(parent_printer_()) : "")\r
+ , name_("")\r
, counter_(0){}\r
\r
void update(const std::string& name, double value)\r
implementation& operator=(implementation&);\r
};\r
\r
-graph::graph(const std::string& name) : impl_(env::properties().get("configuration.diagnostics.graphs", true) ? new implementation(name) : nullptr)\r
+graph::graph(const std::string& name, bool start) : impl_(env::properties().get("configuration.diagnostics.graphs", true) ? new implementation(name) : nullptr)\r
{\r
- if(impl_)\r
- context::register_drawable(impl_);\r
+ if(start)\r
+ graph::start();\r
}\r
\r
-graph::graph(const printer& parent_printer) : impl_(env::properties().get("configuration.diagnostics.graphs", true) ? new implementation(parent_printer) : nullptr)\r
+graph::graph(const printer& parent_printer, bool start) : impl_(env::properties().get("configuration.diagnostics.graphs", true) ? new implementation(parent_printer) : nullptr)\r
{\r
+ if(start)\r
+ graph::start();\r
+}\r
+\r
+void graph::start()\r
+{ \r
if(impl_)\r
context::register_drawable(impl_);\r
}\r
}\r
}\r
\r
-safe_ptr<graph> create_graph(const std::string& name)\r
+safe_ptr<graph> create_graph(const std::string& name, bool start)\r
{\r
- return safe_ptr<graph>(new graph(name));\r
+ return safe_ptr<graph>(new graph(name, start));\r
}\r
-safe_ptr<graph> create_graph(const printer& parent_printer)\r
+safe_ptr<graph> create_graph(const printer& parent_printer, bool start)\r
{\r
- return safe_ptr<graph>(new graph(parent_printer));\r
+ return safe_ptr<graph>(new graph(parent_printer, start));\r
}\r
\r
\r