Commit 0a5dbedb authored by Mathieu Faverge's avatar Mathieu Faverge
Browse files

Change stats viewer on index

parent 60c10f08
......@@ -83,7 +83,7 @@
</property>
</widget>
</item>
<item row="3" column="1" >
<item row="2" column="1" >
<widget class="QComboBox" name="_kind_of_diagram_box" >
<item>
<property name="text" >
......
......@@ -79,7 +79,9 @@ void Stats_window::init_window() {
void Stats_window::on_reload_button_clicked() {
std::string kind_of_diagram = _kind_of_diagram_box->currentText ().toStdString();
std::string kind_of_diagram = _kind_of_diagram_box->currentText().toStdString();
int toto = _kind_of_diagram_box->currentIndex();
std::cout << toto << endl;
// We delete the previous selected containers
if(!_selected_containers.empty()) {
_selected_containers.clear();
......@@ -109,24 +111,19 @@ void Stats_window::on_reload_button_clicked() {
// We create a drawer
DrawStats<Render_stats_opengl> *drawer;
if(kind_of_diagram == "Horizontal Histogram")
switch (toto)
{
case _HDIAGRAM_INDEX:
drawer = new DrawHDiagram<Render_stats_opengl>();
}
else if (kind_of_diagram == "Histogram")
{
break;
case _DIAGRAM_INDEX:
drawer = new DrawDiagram<Render_stats_opengl>();
}
else if (kind_of_diagram == "Chart")
{
break;
case _CHART_INDEX:
default:
*Message::get_instance() << kind_of_diagram << " not yet implemented" << Message::endw;
drawer = new DrawHDiagram<Render_stats_opengl>();
}
else
{
*Message::get_instance() << kind_of_diagram << " not yet implemented" << Message::endw;
drawer = new DrawDiagram<Render_stats_opengl>();
}
drawer->set_times(_start_time, _end_time);
drawer->build(_ui_stats_area, _selected_containers);
......
......@@ -23,6 +23,13 @@ class Stats_window;
#include "DrawDiagram.hpp"
#include "DrawHDiagram.hpp"
typedef enum stattype {
_HDIAGRAM_INDEX,
_DIAGRAM_INDEX,
_CHART_INDEX
} stattype_t;
/*!
* \brief Class used to display statistics of containers.
*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment