Attention une mise à jour du serveur va être effectuée le lundi 17 mai entre 13h et 13h30. Cette mise à jour va générer une interruption du service de quelques minutes.

Commit 659c640b authored by Mathieu Faverge's avatar Mathieu Faverge

All entityvalues and Entitytype are now indexed by aliases instead of the full Name structure

parent 423247fd
......@@ -609,7 +609,7 @@ void Settings_window::on_reload_link_types_palette_btn_clicked() {
}
add_table_line(link_types_table, SLOT(link_types_color_changed(const QColor&)), SLOT(link_types_visible_changed(int)),
row, lt->get_name().to_string(), color, true);
row, lt->get_alias(), color, true);
}
_reload_links = true;
......@@ -643,7 +643,7 @@ void Settings_window::on_reload_event_types_palette_btn_clicked() {
}
add_table_line(event_types_table, SLOT(event_types_color_changed(const QColor&)), SLOT(event_types_visible_changed(int)),
row, et->get_name().to_string(), color, true);
row, et->get_alias(), color, true);
}
_reload_events = true;
}
......
......@@ -1050,7 +1050,7 @@ void Render_alternate::end_draw_arrows(){
//send datas to vbo
std::map<EntityValue*, std::pair<Vbo*, Vbo*> >::iterator it = _arrows.begin();
while(it != _arrows.end()){
std::cout << it->first->get_name().get_name() << std::endl;
std::cout << it->first->get_name() << std::endl;
it->second.first->config(_glsl);
it->second.second->config(_glsl);
it++;
......@@ -1090,7 +1090,7 @@ void Render_alternate::end_draw_events(){
_draw_event = false;
std::map<EntityValue*, std::pair<Vbo*, Vbo*> >::iterator it = _events.begin();
while(it != _events.end()){
std::cout << it->first->get_name().get_name() << std::endl;
std::cout << it->first->get_name() << std::endl;
it->second.first->config(_glsl);
it->second.second->config(_glsl);
it++;
......
......@@ -155,7 +155,7 @@ public:
// Draw the variable name
draw_object->draw_text(this->_pos_x_container_name,
this->_pos_y_container_name + 50 - pos_y,
var->get_type()->get_name().to_string());
var->get_type()->get_name());
// Draw the axis
draw_object->draw_axis(pos_x,
......
......@@ -6,13 +6,13 @@
** use, modify and/or redistribute the software under the terms of the
** CeCILL-A license as circulated by CEA, CNRS and INRIA at the following
** URL: "http://www.cecill.info".
**
**
** As a counterpart to the access to the source code and rights to copy,
** modify and redistribute granted by the license, users are provided
** only with a limited warranty and the software's author, the holder of
** the economic rights, and the successive licensors have only limited
** liability.
**
**
** In this respect, the user's attention is drawn to the risks associated
** with loading, using, modifying and/or developing or reproducing the
** software by the user in light of its specific status of free software,
......@@ -23,7 +23,7 @@
** their requirements in conditions enabling the security of their
** systems and/or data to be ensured and, more generally, to use and
** operate it in the same conditions as regards security.
**
**
** The fact that you are presently reading this means that you have had
** knowledge of the CeCILL-A license and that you accept its terms.
**
......@@ -37,7 +37,7 @@
** - MARCOUEILLE Jule
** - NOISETTE Pascal
** - REDONDY Arthur
** - VUCHENER Clément
** - VUCHENER Clément
**
*/
/*!
......@@ -62,7 +62,7 @@ protected:
double _legend_width;
double _legend_height;
std::set<const EntityValue*> _setstates;
public:
/*
* \brief The default constructor
......@@ -70,19 +70,19 @@ public:
DrawHDiagram() {
_startx = _START_HISTOGRAM_X_DEFAULT;
_starty = 100.0f;
this->_size_for_one_container = _HEIGHT_FOR_ONE_CONTAINER_DEFAULT;
this->_percentage_height_default = (this->_size_for_one_container - _START_HISTOGRAM_Y_DEFAULT) / 100.;
this->_pos_x_container_name = _POS_X_CONTAINER_NAME;
this->_pos_y_container_name = _POS_Y_CONTAINER_NAME;
/* Size for rectangles in the legend */
this->_width_for_rect_legend = 20.;
this->_height_for_rect_legend = 15.;
}
/*!
* \brief The destructor
*/
......@@ -105,49 +105,49 @@ public:
_draw_width = draw_object->width();
_legend_height = draw_object->height();
_legend_width = draw_object->width();
_graph_width = _draw_width - _startx - 30.;
_graph_width = _draw_width - _startx - 30.;
this->_containers_to_print = containers_to_print;
nbcont = this->_containers_to_print.size();
draw_object->start_draw();
draw_object->set_total_height((nbcont+1)*_WIDTH_HISTOGRAM_DEFAULT
+ 10.);
+ 10.);
draw_object->set_total_width(draw_object->width());
draw_object->draw_axis(_startx,
_starty - (nbcont-1)*_WIDTH_HISTOGRAM_DEFAULT,
_graph_width + 10.,
(nbcont+1)*_WIDTH_HISTOGRAM_DEFAULT);
draw_object->draw_horizontal_line(_startx,
_starty + _WIDTH_HISTOGRAM_DEFAULT,
_graph_width + 10.);
for (int i=25; i < 101; i+=25)
{
// Draw Up Scale
draw_object->draw_vertical_line(_startx + i*_graph_width/100.,
_starty + _WIDTH_HISTOGRAM_DEFAULT - 2.5,
5.);
draw_object->draw_text(_startx + i*_graph_width/100 - 10.,
this->_size_for_one_container-(_starty + _WIDTH_HISTOGRAM_DEFAULT + 15.),
QString::number(i, 'd', 1).toStdString()+"%");
// Draw Down Scale
draw_object->draw_vertical_line(_startx + i*_graph_width/100.,
_starty - (nbcont-1)*_WIDTH_HISTOGRAM_DEFAULT - 2.5,
5.);
draw_object->draw_text(_startx + i*_graph_width/100 - 10.,
this->_size_for_one_container-(_starty - (nbcont-1)*_WIDTH_HISTOGRAM_DEFAULT - 15.),
QString::number(i, 'd', 1).toStdString()+"%");
}
draw_object->draw_axis(_startx,
_starty - (nbcont-1)*_WIDTH_HISTOGRAM_DEFAULT,
_graph_width + 10.,
(nbcont+1)*_WIDTH_HISTOGRAM_DEFAULT);
draw_object->draw_horizontal_line(_startx,
_starty + _WIDTH_HISTOGRAM_DEFAULT,
_graph_width + 10.);
for (int i=25; i < 101; i+=25)
{
// Draw Up Scale
draw_object->draw_vertical_line(_startx + i*_graph_width/100.,
_starty + _WIDTH_HISTOGRAM_DEFAULT - 2.5,
5.);
draw_object->draw_text(_startx + i*_graph_width/100 - 10.,
this->_size_for_one_container-(_starty + _WIDTH_HISTOGRAM_DEFAULT + 15.),
QString::number(i, 'd', 1).toStdString()+"%");
// Draw Down Scale
draw_object->draw_vertical_line(_startx + i*_graph_width/100.,
_starty - (nbcont-1)*_WIDTH_HISTOGRAM_DEFAULT - 2.5,
5.);
draw_object->draw_text(_startx + i*_graph_width/100 - 10.,
this->_size_for_one_container-(_starty - (nbcont-1)*_WIDTH_HISTOGRAM_DEFAULT - 15.),
QString::number(i, 'd', 1).toStdString()+"%");
}
for(int i = 0 ; i < nbcont ; i ++) {
draw_diagram(draw_object, i);
draw_diagram(draw_object, i);
}
draw_legend(draw_object,
_POS_X_LEGEND_DEFAULT + _startx,
_POS_Y_LEGEND_DEFAULT + _starty - (nbcont+3)*_WIDTH_HISTOGRAM_DEFAULT);
this->end_draw(draw_object);
draw_legend(draw_object,
_POS_X_LEGEND_DEFAULT + _startx,
_POS_Y_LEGEND_DEFAULT + _starty - (nbcont+3)*_WIDTH_HISTOGRAM_DEFAULT);
this->end_draw(draw_object);
}
/*!
......@@ -159,63 +159,62 @@ public:
void draw_diagram(T* draw_object, const int container_id) {
Statistic *stat_temp;
std::map<const EntityValue*, stats*> temp_states;
double duration;
int pos_x, pos_y;
double duration;
int pos_x, pos_y;
std::string ctname;
stat_temp = new Statistic();
stat_temp = new Statistic();
this->_containers_to_print[container_id]->fill_stat(stat_temp, Interval(this->_start_time, this->_end_time));
temp_states = stat_temp->get_states();
duration = this->_end_time - this->_start_time;
temp_states = stat_temp->get_states();
duration = this->_end_time - this->_start_time;
// Printing of the trace
//std::cout << "nb states " << temp_states.size() << std::endl;
//std::cout << "nb states " << temp_states.size() << std::endl;
// Depending on the kind of diagram...
pos_x = _startx;
pos_y = _starty - container_id * _WIDTH_HISTOGRAM_DEFAULT;
// Draw the container name
ctname = this->_containers_to_print[container_id]->get_name().to_string();
draw_object->draw_text(_POS_X_CONTAINER_NAME,
this->_size_for_one_container-(pos_y + _WIDTH_HISTOGRAM_DEFAULT / 2. - 5.),
ctname);
// Draw the stats
for (std::map<const EntityValue *, stats *>::iterator it = temp_states.begin();
it != temp_states.end();
it ++)
{
double length = (*it).second->_total_length;
double percent = length / duration ;
double width = percent * _graph_width;
std::string name = (*it).first->get_name().to_string();
double red = 0.7;
double green = 0.7;
double blue = 0.75;
// We search for a color
if((*it).first->get_extra_fields()->find(std::string("Color")) != (*it).first->get_extra_fields()->end())
{
const Color *color = (const Color *)(*it).first->get_extra_fields()->find(std::string("Color"))->second;
red = color->get_red();
green = color->get_green();
blue = color->get_blue();
}
draw_object->draw_rect(pos_x, pos_y,
width, _WIDTH_HISTOGRAM_DEFAULT,
red, green, blue);
if ( width > 30. )
draw_object->draw_text(pos_x + width / 2 - 10.,
pos_x = _startx;
pos_y = _starty - container_id * _WIDTH_HISTOGRAM_DEFAULT;
// Draw the container name
ctname = this->_containers_to_print[container_id]->get_name().to_string();
draw_object->draw_text(_POS_X_CONTAINER_NAME,
this->_size_for_one_container-(pos_y + _WIDTH_HISTOGRAM_DEFAULT / 2. - 5.),
ctname);
// Draw the stats
for (std::map<const EntityValue *, stats *>::iterator it = temp_states.begin();
it != temp_states.end();
it ++)
{
double length = (*it).second->_total_length;
double percent = length / duration ;
double width = percent * _graph_width;
double red = 0.7;
double green = 0.7;
double blue = 0.75;
// We search for a color
if((*it).first->get_extra_fields()->find(std::string("Color")) != (*it).first->get_extra_fields()->end())
{
const Color *color = (const Color *)(*it).first->get_extra_fields()->find(std::string("Color"))->second;
red = color->get_red();
green = color->get_green();
blue = color->get_blue();
}
draw_object->draw_rect(pos_x, pos_y,
width, _WIDTH_HISTOGRAM_DEFAULT,
red, green, blue);
if ( width > 30. )
draw_object->draw_text(pos_x + width / 2 - 10.,
this->_size_for_one_container-(pos_y + _WIDTH_HISTOGRAM_DEFAULT / 2. - 5.),
QString::number(percent*100., 'f', 1).toStdString()+"%");
QString::number(percent*100., 'f', 1).toStdString()+"%");
pos_x += width;
this->_setstates.insert((*it).first);
pos_x += width;
this->_setstates.insert((*it).first);
}
}
delete stat_temp;
}
......@@ -236,26 +235,26 @@ public:
/* used to print legend on 3 rows */
int decalage = 0;
end = this->_setstates.end();
end = this->_setstates.end();
for (it = this->_setstates.begin();
it != end;
it ++, decalage ++) {
std::string name = (*it)->get_name().to_string();
std::string name = (*it)->get_name();
draw_object->draw_text(pos_x+w+_POS_X_LEGEND_DEFAULT,
this->_size_for_one_container-pos_y,
name.substr(0, 10));
if((*it)->get_extra_fields()->find(std::string("Color")) != (*it)->get_extra_fields()->end())
{
if((*it)->get_extra_fields()->find(std::string("Color")) != (*it)->get_extra_fields()->end())
{
const Color *color = (const Color *)(*it)->get_extra_fields()->find(std::string("Color"))->second;
draw_object->draw_rect(pos_x, pos_y, w, h, color->get_red(), color->get_green(), color->get_blue());
}
else
{
}
else
{
draw_object->draw_rect(pos_x, pos_y, w, h, 0.7, 0.7, 0.75);
}
}
switch(decalage%3) {
case 2:
pos_x += 100;
......@@ -272,5 +271,5 @@ public:
}
};
#endif
......@@ -6,13 +6,13 @@
** use, modify and/or redistribute the software under the terms of the
** CeCILL-A license as circulated by CEA, CNRS and INRIA at the following
** URL: "http://www.cecill.info".
**
**
** As a counterpart to the access to the source code and rights to copy,
** modify and redistribute granted by the license, users are provided
** only with a limited warranty and the software's author, the holder of
** the economic rights, and the successive licensors have only limited
** liability.
**
**
** In this respect, the user's attention is drawn to the risks associated
** with loading, using, modifying and/or developing or reproducing the
** software by the user in light of its specific status of free software,
......@@ -23,7 +23,7 @@
** their requirements in conditions enabling the security of their
** systems and/or data to be ensured and, more generally, to use and
** operate it in the same conditions as regards security.
**
**
** The fact that you are presently reading this means that you have had
** knowledge of the CeCILL-A license and that you accept its terms.
**
......@@ -37,7 +37,7 @@
** - MARCOUEILLE Jule
** - NOISETTE Pascal
** - REDONDY Arthur
** - VUCHENER Clément
** - VUCHENER Clément
**
*/
/*!
......@@ -53,7 +53,7 @@
*/
template<class T>
class DrawVDiagram : public DrawStats<T> {
public:
/*
* \brief The default constructor
......@@ -63,7 +63,7 @@ public:
set_geometrical_informations();
}
/*!
* \brief The destructor
*/
......@@ -90,9 +90,9 @@ public:
for(int i = 0 ; i < number_of_containers ; i ++) {
draw_container_name(draw_object, i);
draw_diagram(draw_object, i);
draw_legend(draw_object, i);
}
this->set_geometrical_informations_object(draw_object);
......@@ -107,12 +107,12 @@ public:
*/
virtual void draw_container_name(T* draw_object, const int container_id) const {
// Get the position for the i-th container name
const Element_pos pos_x = this->_pos_x_container_name;
const Element_pos pos_y = this->_size_for_one_container*(container_id+1)-this->_pos_y_container_name;
const std::string name = this->_containers_to_print[container_id]->get_name().to_string();
draw_object->draw_text(pos_x, pos_y, name);
}
......@@ -130,47 +130,44 @@ public:
// Printing of the trace
int pos_x = _START_HISTOGRAM_X_DEFAULT;
int pos_y = _START_HISTOGRAM_Y_DEFAULT - container_id*this->_size_for_one_container;
const double max_percentage = get_max_percentage(temp_states);
// Draw axes
draw_object->draw_axis(pos_x, pos_y, _WIDTH_HISTOGRAM_DEFAULT*(this->_states[container_id].size()+1), this->_percentage_height_default*100);
int pos_x = _START_HISTOGRAM_X_DEFAULT;
int pos_y = _START_HISTOGRAM_Y_DEFAULT - container_id*this->_size_for_one_container;
const double max_percentage = get_max_percentage(temp_states);
// Draw axes
draw_object->draw_axis(pos_x, pos_y, _WIDTH_HISTOGRAM_DEFAULT*(this->_states[container_id].size()+1), this->_percentage_height_default*100);
draw_object->draw_text(pos_x-35,
draw_object->draw_text(pos_x-35,
this->_size_for_one_container-(pos_y+this->_percentage_height_default*100-5),
QString::number(max_percentage*100., 'g', 3).toStdString()+"%");
draw_object->draw_horizontal_line(pos_x, pos_y+this->_percentage_height_default*100, _WIDTH_HISTOGRAM_DEFAULT*(this->_states[container_id].size()+1));
// Draw the stats
for (std::map<const EntityValue *, stats *>::iterator it = temp_states.begin();
it != temp_states.end();
it ++) {
std::string name = (*it).first->get_name().to_string();
// We have to convert the percentage in a rectangle and print it
const double length = (*it).second->_total_length;
const double height = length*100.*this->_percentage_height_default/(this->_end_time-this->_start_time);
// We search for a color
if((*it).first->get_extra_fields()->find(std::string("Color")) != (*it).first->get_extra_fields()->end()) {
draw_object->draw_horizontal_line(pos_x, pos_y+this->_percentage_height_default*100, _WIDTH_HISTOGRAM_DEFAULT*(this->_states[container_id].size()+1));
// Draw the stats
for (std::map<const EntityValue *, stats *>::iterator it = temp_states.begin();
it != temp_states.end();
it ++) {
// We have to convert the percentage in a rectangle and print it
const double length = (*it).second->_total_length;
const double height = length*100.*this->_percentage_height_default/(this->_end_time-this->_start_time);
// We search for a color
if((*it).first->get_extra_fields()->find(std::string("Color")) != (*it).first->get_extra_fields()->end()) {
const Color *color = (const Color *)(*it).first->get_extra_fields()->find(std::string("Color"))->second;
draw_object->draw_rect(pos_x, pos_y, _WIDTH_HISTOGRAM_DEFAULT, height/max_percentage, color->get_red(), color->get_green(), color->get_blue());
}
else {
}
else {
draw_object->draw_rect(pos_x, pos_y, _WIDTH_HISTOGRAM_DEFAULT, height/max_percentage, 0.7, 0.7, 0.75);
}
// We print the percentage above
draw_object->draw_text(pos_x,
}
// We print the percentage above
draw_object->draw_text(pos_x,
this->_size_for_one_container-(pos_y+height/max_percentage+1),
QString::number(length/(this->_end_time-this->_start_time)*100., 'f', 1).toStdString()+"%");
//std::cout << "State : " << name << " for " << (*it).second->_total_length*100./(this->_end_time-this->_start_time)<< "% between " << this->_start_time << " sec and " << this->_end_time << " sec" << std::endl;
pos_x += _WIDTH_HISTOGRAM_DEFAULT;
}
pos_x += _WIDTH_HISTOGRAM_DEFAULT;
}
// We check for the width
if(pos_x > this->_max_width){
......@@ -198,7 +195,9 @@ public:
for (std::map<const EntityValue *, stats *>::iterator it = this->_states[container_id].begin();
it != this->_states[container_id].end();
it ++, decalage ++) {
std::string name = (*it).first->get_name().to_string();
std::string name = (*it).first->get_name();
// We cut the name to don't exceed the place
draw_object->draw_text(pos_x+w+_POS_X_LEGEND_DEFAULT, pos_y, name.substr(0, 10));
......@@ -228,7 +227,7 @@ public:
}
/*!
/*!
* \fn get_max_percentage(std::map<const EntityValue*, stats*> &temp_states) const
* \brief Get the biggest percentage of times for all the stats
* \param temp_states The stats where we want to get the longest
......@@ -252,16 +251,16 @@ public:
}
/*!
/*!
* \fn set_geometrical_informations()
* \brief Set some infos for the displaying
*/
void set_geometrical_informations() {
this->_pos_x_container_name = _POS_X_CONTAINER_NAME;
this->_pos_y_container_name = this->_size_for_one_container - 50;
this->_percentage_height_default = (this->_size_for_one_container - _START_HISTOGRAM_Y_DEFAULT - 20) / 100.;
/* Size for rectangles in the legend */
this->_width_for_rect_legend = 20.;
this->_height_for_rect_legend = 15.;
......@@ -269,5 +268,5 @@ public:
}
};
#endif
......@@ -172,7 +172,7 @@ void Stats_window::set_trace(Trace *trace) {
for (it = states_types_list->begin();
it != end;
it++){
string name = (*it).second->get_name().to_string();
string name = (*it).second->get_alias();
QString temp(QString::fromStdString(name));
_kind_of_state_box->addItem(temp);
}
......@@ -189,7 +189,7 @@ void Stats_window::set_selected_nodes(string kind_of_state){
for (itstat = states_types_list->begin();
itstat != endstat;
itstat++){
if ((*itstat).second->get_name().to_string() == kind_of_state){
if ((*itstat).second->get_alias() == kind_of_state){
kind_of_container = (*itstat).second->get_container_type();
continue;
}
......
......@@ -642,10 +642,10 @@ public:
while (ancestor) {
if ((link = get_link(ancestor, x, y, d))) {
*Message::get_instance() << "<center><strong>Link</strong></center>"
<< "<strong>Value:</strong> " << link->get_value()->get_name().to_string() << "<br />"
<< "<strong>Value:</strong> " << link->get_value()->get_name() << "<br />"
<< "<strong>Source:</strong> " << link->get_source()->get_name().to_string() << "<br />"
<< "<strong>Destination:</strong> " << link->get_destination()->get_name().to_string() << "<br />"
<< "<strong>Type:</strong> " << link->get_type()->get_name().to_string() << "<br />"
<< "<strong>Type:</strong> " << link->get_type()->get_name() << "<br />"
<< "<strong>Date:</strong> " << link->get_start_time().get_value() << " - " << link->get_end_time().get_value() << "<br />"
<< "<strong>Duration:</strong> " << link->get_duration() << "<br />";
print_extra_fields("Link", link->get_extra_fields());
......@@ -661,10 +661,10 @@ public:
//if not found, the link may hav been assigned to the first root container.
if ((link = get_link(root_containers->front(), x, y, d))) {
*Message::get_instance() << "<center><strong>Link</strong></center>"
<< "<strong>Value:</strong> " << link->get_value()->get_name().to_string() << "<br />"
<< "<strong>Value:</strong> " << link->get_value()->get_name() << "<br />"
<< "<strong>Source:</strong> " << link->get_source()->get_name().to_string() << "<br />"
<< "<strong>Destination:</strong> " << link->get_destination()->get_name().to_string() << "<br />"
<< "<strong>Type:</strong> " << link->get_type()->get_name().to_string() << "<br />"
<< "<strong>Type:</strong> " << link->get_type()->get_name() << "<br />"
<< "<strong>Date:</strong> " << link->get_start_time().get_value() << " - " << link->get_end_time().get_value() << "<br />"
<< "<strong>Duration:</strong> " << link->get_duration() << "<br />";
print_extra_fields("Link", link->get_extra_fields());
......@@ -684,9 +684,9 @@ public:
if (!Info::Render::_no_events)
if ((event = find_event(container, x, d))) {
*Message::get_instance() << "<center><strong>Event</strong></center>"
<< "<strong>Value:</strong> " << event->get_value()->get_name().to_string() << "<br />"
<< "<strong>Value:</strong> " << event->get_value()->get_name() << "<br />"
<< "<strong>Container:</strong> " << event->get_container()->get_name().to_string() << "<br />"