Commit 77e9be00 authored by Johnny Jazeix's avatar Johnny Jazeix
Browse files

Completion statistiques (en mode texte pour le moment)

parent 14da9d79
......@@ -25,168 +25,177 @@
<height>456</height>
</rect>
</property>
<widget class="QWidget" name="layoutWidget" >
<property name="geometry" >
<rect>
<x>20</x>
<y>87</y>
<width>621</width>
<height>351</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_3" >
<property name="sizeConstraint" >
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<item>
<layout class="QVBoxLayout" name="stats_area" >
<property name="sizeConstraint" >
<enum>QLayout::SetDefaultConstraint</enum>
</property>
</layout>
</item>
<item>
<widget class="QScrollBar" name="y_scroll" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="horizontalLayoutWidget_5" >
<widget class="QSplitter" name="splitter_2" >
<property name="geometry" >
<rect>
<x>20</x>
<y>10</y>
<width>621</width>
<height>79</height>
<width>601</width>
<height>421</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_5" >
<property name="sizeConstraint" >
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4" >
<property name="sizeConstraint" >
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<item>
<widget class="QLabel" name="label_4" >
<property name="text" >
<string>Selected node :</string>
</property>
</widget>
</item>
<item>
<widget class="QTreeWidget" name="_nodes_selected" >
<property name="selectionMode" >
<enum>QAbstractItemView::ExtendedSelection</enum>
</property>
<property name="selectionBehavior" >
<enum>QAbstractItemView::SelectItems</enum>
</property>
<property name="headerHidden" >
<bool>true</bool>
</property>
<column>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<widget class="QWidget" name="horizontalLayoutWidget" >
<layout class="QHBoxLayout" name="horizontalLayout_6" >
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4" >
<property name="sizeConstraint" >
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<item>
<widget class="QLabel" name="label_4" >
<property name="text" >
<string>1</string>
<string>Selected
node :</string>
</property>
</column>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout" >
</widget>
</item>
<item>
<widget class="QTreeWidget" name="_nodes_selected" >
<property name="selectionMode" >
<enum>QAbstractItemView::ExtendedSelection</enum>
</property>
<property name="selectionBehavior" >
<enum>QAbstractItemView::SelectItems</enum>
</property>
<property name="headerHidden" >
<bool>true</bool>
</property>
<column>
<property name="text" >
<string>1</string>
</property>
</column>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QSplitter" name="splitter" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<widget class="QWidget" name="horizontalLayoutWidget_5" >
<layout class="QHBoxLayout" name="horizontalLayout_5" >
<property name="sizeConstraint" >
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout1" >
<layout class="QVBoxLayout" name="verticalLayout" >
<property name="sizeConstraint" >
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<item>
<widget class="QLabel" name="label" >
<property name="text" >
<string>start time</string>
<layout class="QHBoxLayout" name="horizontalLayout1" >
<property name="sizeConstraint" >
<enum>QLayout::SetDefaultConstraint</enum>
</property>
</widget>
<item>
<widget class="QLabel" name="label" >
<property name="text" >
<string>start
time</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="_start_time_widget" />
</item>
</layout>
</item>
<item>
<widget class="QLineEdit" name="_start_time_widget" />
<layout class="QHBoxLayout" name="horizontalLayout_2" >
<property name="sizeConstraint" >
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<item>
<widget class="QLabel" name="label_3" >
<property name="text" >
<string>end
time</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="_end_time_widget" />
</item>
</layout>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2" >
<layout class="QHBoxLayout" name="horizontalLayout" >
<property name="sizeConstraint" >
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<item>
<widget class="QLabel" name="label_3" >
<widget class="QLabel" name="label_2" >
<property name="text" >
<string>end time</string>
<string>Kind of viewing</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="_end_time_widget" />
<widget class="QComboBox" name="comboBox" >
<item>
<property name="text" >
<string>Chart</string>
</property>
</item>
<item>
<property name="text" >
<string>Horizontal percentage</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout" >
<property name="sizeConstraint" >
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<item>
<widget class="QLabel" name="label_2" >
<property name="text" >
<string>Kind of viewing</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox" >
<layout class="QVBoxLayout" name="verticalLayout_2" >
<item>
<property name="text" >
<string>Chart</string>
</property>
<widget class="QPushButton" name="reload_button" >
<property name="text" >
<string>Reload</string>
</property>
</widget>
</item>
<item>
<property name="text" >
<string>Horizontal percentage</string>
</property>
<widget class="QPushButton" name="export_button" >
<property name="text" >
<string>Export</string>
</property>
</widget>
</item>
</widget>
</layout>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_2" >
</widget>
<widget class="QWidget" name="layoutWidget" >
<layout class="QHBoxLayout" name="horizontalLayout_3" >
<property name="sizeConstraint" >
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<item>
<widget class="QPushButton" name="reload_button" >
<property name="text" >
<string>Reload</string>
<layout class="QVBoxLayout" name="stats_area" >
<property name="sizeConstraint" >
<enum>QLayout::SetDefaultConstraint</enum>
</property>
</widget>
</layout>
</item>
<item>
<widget class="QPushButton" name="export_button" >
<property name="text" >
<string>Export</string>
<widget class="QScrollBar" name="y_scroll" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
</widget>
</widget>
<widget class="QMenuBar" name="menubar" >
......
......@@ -23,8 +23,8 @@ void Render_stats_opengl::initializeGL(){
makeCurrent();
glClearColor(1.0, 0.5, 0.55, 1.0);
//glClearColor(0.0, 0.0, 0.0, 0.0);
glEnable(GL_DEPTH_TEST);
doneCurrent();
}
......@@ -42,7 +42,7 @@ void Render_stats_opengl::resizeGL(int width, int height){
glOrtho(0, _render_width, 0, _render_height, 0, -1000);
glMatrixMode(GL_MODELVIEW);
cout << "resize: (" << width<<", "<<height<<")."<< endl;
//cout << "resize: (" << width<<", "<<height<<")"<< endl;
doneCurrent();
}
......
......@@ -6,7 +6,7 @@
#define DRAW_STATS_HPP
#include <string>
#include <list>
#include <vector>
#include "../message/Message.hpp"
#include "../trace/Trace.hpp"
......@@ -59,7 +59,7 @@ protected:
Trace *_trace;
std::list<Container *> _container_to_print;
std::vector<Container *> _containers_to_print;
// Geometrical informations about the stats shape.
/*!
......
......@@ -8,7 +8,6 @@ Statistic::Statistic(){
}
Statistic::~Statistic(){
// Delete states
for (map<const EntityValue *, stats *>::iterator it = _states.begin();
it != _states.end();
......@@ -21,8 +20,6 @@ void Statistic::add_state(EntityValue const* ent, double length){
map<const EntityValue *, stats*>::iterator i = _states.find(ent);
// If it does not exist, add a new entry
if (i == _states.end()) {
// _states[entity] = ent;
// _states[sta] = new stats(sta);
_states[ent] = new stats(length);
}
// Else update the state found
......@@ -36,15 +33,11 @@ void Statistic::add_link(Container * cont){
map<Container*, int>::iterator i = _link.find(cont);
// If it does not exist, add a new entry
if(i == _link.end()) {
// _link[target] = cont;
// _link[number] = 1;
_link[cont] = 1;
}
// Else update the link to the container found
else{
(*i).second ++;
// Ajout de l'underscore ?
_number_link ++;
}
}
......@@ -53,7 +46,7 @@ void Statistic::set_nb_event(int n){
_event = n;
}
const int Statistic::get_nb_event(){
int Statistic::get_nb_event(){
return _event;
}
......
......@@ -13,10 +13,10 @@ class Statistic;
*/
struct stats{
int _total_length;
double _total_length;
int _cardinal;
//Ajout
stats(int length, int cardinal = 1) : _total_length(length), _cardinal(cardinal){}
stats(double length, int cardinal = 1) : _total_length(length), _cardinal(cardinal){}
};
class Statistic{
......@@ -59,7 +59,7 @@ public :
*/
void set_nb_event(int number);
const int get_nb_event();
int get_nb_event();
map<const EntityValue*, stats*> get_states();
};
......
......@@ -129,7 +129,7 @@ void Stats_window::start_draw() {
// Draw containers
for(unsigned int i = 0 ; i < _selected_containers.size() ; i ++) {
// Draw the name
_ui_stats_area->draw_container_name(_DECALAGE_NAME_X, _HEIGHT_OF_A_STAT_Y * i + _DECALAGE_NAME_Y, _selected_containers[i]->get_name().to_string());
//_ui_stats_area->draw_container_name(_DECALAGE_NAME_X, _HEIGHT_OF_A_STAT_Y * i + _DECALAGE_NAME_Y, _selected_containers[i]->get_name().to_string());
// Draw the ...
Statistic *stat_temp = new Statistic();
......@@ -145,7 +145,7 @@ void Stats_window::start_draw() {
for (map<const EntityValue *, stats *>::iterator it = temp_map.begin();
it != temp_map.end();
it ++) {
cout << "State: " << (*it).first->get_name().to_string() << " for " << (*it).second << " seconds." << endl;
cout << "State: " << (*it).first->get_name().to_string() << " for " << (*it).second->_total_length << " seconds." << endl;
}
delete stat_temp;
......
......@@ -31,9 +31,9 @@ class Stats_window : public QMainWindow, protected Ui::stats_viewer {
Q_OBJECT
public:
static const int _DECALAGE_NAME_X = 10;
static const int _HEIGHT_OF_A_STAT_Y = 30;
static const int _DECALAGE_NAME_Y = 5;
// static const int _DECALAGE_NAME_X = 10;
// static const int _HEIGHT_OF_A_STAT_Y = 30;
// static const int _DECALAGE_NAME_Y = 5;
private:
......
Supports Markdown
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