Commit 14da9d79 authored by Kevin Coulomb's avatar Kevin Coulomb
Browse files

Correction pour avoir des stats sur les conteneurs peres

parent 09ace590
......@@ -134,8 +134,7 @@ void Stats_window::start_draw() {
// Draw the ...
Statistic *stat_temp = new Statistic();
Container *temp = _trace->search_container(String(_selected_containers[i]->get_name().to_string()));
// temp-> plutot ?????
fill_stat(temp, stat_temp, Interval(_start_time, _end_time));
temp->fill_stat(stat_temp, Interval(_start_time, _end_time));
// Bug des que c'est un noeud ^^
......
......@@ -208,17 +208,17 @@ void Container::finish(const Date &time) {
_state_tree = new BinaryTree<StateChange>(_states,_n_states);
}
/*************************************/
void fill_stat(Container * cont, Statistic * stat, Interval I){
void Container::fill_stat( Statistic * stat, Interval I){
bool is_first_added = false;
// If the container is a proc -> no child container
if(cont->get_children()->empty()) {
Node<StateChange> * node = cont->get_states()->get_root();
browse_stat_state(node,stat,I,is_first_added);
browse_stat_link(cont,stat,I);
if(this->get_children()->empty()) {
browse_stat_link(this,stat,I);
}
stat->set_nb_event(cont->get_event_number());
Node<StateChange> * node = this->get_states()->get_root();
browse_stat_state(node,stat,I,is_first_added);
stat->set_nb_event(this->get_event_number());
}
......@@ -256,10 +256,11 @@ void browse_stat_state(Node<StateChange> * node, Statistic * stats, Interval I,
// Else node is before the interval
if(node->get_right_child()){
browse_stat_state(node->get_right_child(),stats,I,is_displayed);
}
}
}
void browse_stat_link(Container * cont, Statistic * S, Interval I){
//TODO
......
......@@ -265,6 +265,12 @@ public:
* \param time Time to set destruction time if it was not destroy
*/
void finish(const Date &time);
/*!
* \fn fill_stat( Statistic * stat, Interval I)
* \brief Fill the stat element with the corresponding data to be displayed
*/
void fill_stat( Statistic * stat, Interval I);
};
/*!
......@@ -280,7 +286,6 @@ void browse_stat_state(Node<StateChange> * node, Statistic * stats, Interval I,
* \fn fill_stat(Container * cont, Statistic * stat, Interval I)
* \brief Fill the stat element with the corresponding data to be displayed
*/
void fill_stat(Container * cont, Statistic * stat, Interval I);
void browse_stat_link(Container * cont, Statistic * S, Interval I);
#endif
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