Attention une mise à jour du service Gitlab va être effectuée le mardi 30 novembre entre 17h30 et 18h00. Cette mise à jour va générer une interruption du service dont nous ne maîtrisons pas complètement la durée mais qui ne devrait pas excéder quelques minutes. Cette mise à jour intermédiaire en version 14.0.12 nous permettra de rapidement pouvoir mettre à votre disposition une version plus récente.

Commit 9682ab76 authored by Kevin Coulomb's avatar Kevin Coulomb
Browse files

For selecting processors

parent 11dd25e9
......@@ -65,6 +65,78 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_3" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_6" >
<property name="text" >
<string>Filter (default 0)</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_10" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<spacer name="verticalSpacer_9" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<spacer name="verticalSpacer_7" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<spacer name="verticalSpacer_5" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<spacer name="verticalSpacer_2" >
<property name="orientation" >
......@@ -85,6 +157,45 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_13" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<spacer name="verticalSpacer_12" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<spacer name="verticalSpacer_4" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<spacer name="verticalSpacer" >
<property name="orientation" >
......@@ -98,6 +209,19 @@ p, li { white-space: pre-wrap; }
</property>
</spacer>
</item>
<item>
<spacer name="verticalSpacer_11" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
......@@ -115,6 +239,9 @@ p, li { white-space: pre-wrap; }
<item>
<widget class="QLineEdit" name="endTime" />
</item>
<item>
<widget class="QLineEdit" name="filter" />
</item>
<item>
<widget class="QTreeWidget" name="_nodes_selected" >
<column>
......
......@@ -254,22 +254,16 @@ bool Interface_console::draw_trace(const string & filename, const int format){
*Message::get_instance() << "Try to use file: " << filename << " instead of a previous parsed file: " << _file_opened << Message::ende;
}
Interval interval(_time_start, ((0==_time_end)?_trace->get_max_date():_time_end) );
// Interval interval(_time_start, ((0==_time_end)?_trace->get_max_date():_time_end) );
if (_DRAW_OPENGL == format) {
drawing_ogl.build(_render_opengl, _trace, 0, interval);
drawing_ogl.build(_render_opengl, _trace);
_render_opengl->build();
_render_opengl->updateGL();
_render_opengl->refresh_scroll_bars();
_file_opened = filename;/* store filename for a future export */
}else if (format == _DRAW_OPENGL_PARTIAL ){
/////////////////////////////////TODO
drawing_ogl.build_partial(_render_opengl,_trace,0);
_render_opengl->build();
_render_opengl->updateGL();
_render_opengl->refresh_scroll_bars();
}else if (_DRAW_SVG == format) {
drawing_svg.build(&svg, _trace, 0, interval);
drawing_svg.build(&svg, _trace);
svg.end();
}else{/* error */
*Message::get_instance() << "No kind of render recognized" << Message::ende;
......
......@@ -13,11 +13,9 @@ Command_window::Command_window( QWidget *parent, Interface_graphic * i) : QMainW
CKFP(_ui_end_box = qFindChild<QLineEdit*>(this, "endTime"), "Cannot find the end argument box in the .ui file");
CKFP(_ui_tree_box = qFindChild<QTreeWidget*>(this, "_nodes_selected"), "Cannot find the tree argument box in the .ui file");
// CKFP(_ui_arg4_box = qFindChild<QLineEdit*>(this, "lineEdit_4"), "Cannot find the fourth argument in the .ui file");
CKFP(_ui_filter_box = qFindChild<QLineEdit*>(this, "filter"), "Cannot find the filter argument box in the .ui file");
// CKFP(_ui_arg5_box = qFindChild<QLineEdit*>(this, "lineEdit_2"), "Cannot find the fifth argument box in the .ui file");
CKFP(_ui_tree_box = qFindChild<QTreeWidget*>(this, "_nodes_selected"), "Cannot find the tree argument box in the .ui file");
}
void Command_window::set_trace( Trace * t){
......@@ -35,18 +33,52 @@ void Command_window::on_execute_button_clicked(){
const QString cmd = _ui_cmd_box->text();
QString start_time = _ui_start_box->text();
QString end_time = _ui_end_box->text();
QString filter = _ui_filter_box->text();
if(_ui_start_box->text()== "" || _ui_start_box->text()=="t0")
if(_ui_start_box->text()== "" ||
_ui_start_box->text()=="t0")
start_time = "0";
if(_ui_end_box->text() == "" || _ui_end_box->text()=="t1")
if(_ui_end_box->text() == "" ||
_ui_end_box->text()=="t1")
end_time = QString::fromStdString(_trace->get_max_date().to_string());
if(_ui_filter_box->text()== "" ||
_ui_filter_box->text()<0)
filter = "0";
set_selected_nodes();
if(cmd=="PROC"){
start_time = "0";
end_time = QString::fromStdString(_trace->get_max_date().to_string());
filter = "0";
}
else if(cmd == "DATE"){
filter = "0";
_selected_containers.clear();
}
else if(cmd == "SMALL"){
_selected_containers.clear();
start_time = "0";
end_time = QString::fromStdString(_trace->get_max_date().to_string());
}
else if(cmd == "RECT")
filter = "0";
else if(cmd == "PROCREST"){
start_time = "0";
end_time = QString::fromStdString(_trace->get_max_date().to_string());
}
else if (cmd == "lapinou")
return;
else if( cmd == "TIME"){
_selected_containers.clear();
}
_trace->set_selected_container(&_selected_containers);
_trace->set_interval_constrained(new Interval(start_time.toDouble(),end_time.toDouble()));
_trace->set_filter(filter.toDouble());
_console->get_console()->draw_trace(_console->get_filename(),Interface_console::_DRAW_OPENGL_PARTIAL);
_console->get_console()->draw_trace(_console->get_filename(),Interface_console::_DRAW_OPENGL);
// if(_ui_tree_box->text() !="" )
// arg<< _ui_tree_box->text();
......@@ -104,9 +136,9 @@ void Command_window::set_container_names() {
_nodes_selected->insertTopLevelItems(0, items);
}
void Command_window::set_container_names_rec(QTreeWidgetItem *current_node, Container *current_container) {
void Command_window::set_container_names_rec(QTreeWidgetItem *current_node, const Container *current_container) {
const list<Container *> *children = current_container->get_children();
QFlags<Qt::ItemFlag> flg = Qt::ItemIsUserCheckable | Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsTristate;
QFlags<Qt::ItemFlag> flg = Qt::ItemIsUserCheckable | Qt::ItemIsSelectable | Qt::ItemIsEnabled/* | Qt::ItemIsTristate*/;
for (list<Container *>::const_iterator it = children->begin();
it != children->end();
......@@ -122,21 +154,52 @@ void Command_window::set_container_names_rec(QTreeWidgetItem *current_node, Cont
}
void Command_window::set_selected_nodes(){
void Command_window::set_selected_nodes()
{
// We delete the previous selected containers
if(!_selected_containers.empty()) {
if(!_selected_containers.empty())
{
_selected_containers.clear();
}
// We fill the new selected containers
// TODO : Use the tree instead of the list
QTreeWidgetItemIterator it(_nodes_selected);
while (*it) {
if ((*it)->checkState(0) == Qt::Checked){
while (*it)
{
if ((*it)->checkState(0) == Qt::Checked)
{
_selected_containers.push_back(_trace->search_container((*it)->text(0).toStdString()));
}
it ++;
}
// _number_of_selected_container = _selected_containers.size();
/* bool b;
for( vector<const Container *>::const_iterator iter = _selected_containers.begin();
iter != _selected_containers.end();
iter ++)
{
b = false;
if(*iter)
{
if((*iter)->get_parent())
{
for( unsigned int i = 0 ;
i<_selected_containers.size() ;
i++ )
{
if(_selected_containers[i]==(*iter)->get_parent())
{
b = true;
// break;
}
}
if(!b)
{
_selected_containers.push_back((*iter)->get_parent());
fprintf(stdout,"adding parent\n");
b = false;
}
}
}
}*/
}
......@@ -40,14 +40,15 @@ private :
QLineEdit* _ui_cmd_box;
QLineEdit* _ui_start_box;
QLineEdit* _ui_end_box;
QLineEdit* _ui_filter_box;
QTreeWidget* _ui_tree_box;
std::vector<Container *> _selected_containers;
std::vector<const Container *> _selected_containers;
Interface_graphic *_console;
// QLineEdit* _ui_arg4_box;
// QLineEdit* _ui_arg5_box;
// void set_option(QString s);
void set_container_names();
void set_container_names_rec(QTreeWidgetItem *current_node, Container *current_container);
void set_container_names_rec(QTreeWidgetItem *current_node, const Container *current_container);
public :
void set_selected_nodes();
Command_window( QWidget *parent, Interface_graphic * i);
......
......@@ -192,49 +192,54 @@ public:
**********************************/
/*!
* \fn build(T* draw_object, Trace* trace, double zoom, const Interval & interval)
* \brief The trace building function.
* \param draw_object the kind of object which will be drawn (OpenGL, SVG...).
* \param trace the trace data.
* \param zoom The level of zoom where we do not draw under
* \param interval The interval we want to display in
*/
void build(T* draw_object, Trace* trace, double zoom, const Interval & interval) {
draw_object->start_draw();
draw_object->start_draw_containers();
browse_container_tree(draw_object, trace);
draw_object->end_draw_containers();
browse_entities(draw_object,zoom,interval);
draw_object->end_draw();
}
/*!
* \fn build_partial(T* draw_object, Trace* trace, double zoom, const Interval & interval, std::vector<Container *> container)
* \fn build(T* draw_object, Trace* trace)
* \brief The trace building function that do not draw all the containers but only a part.
* \param draw_object the kind of object which will be drawn (OpenGL, SVG...).
* \param trace the trace data.
* \param zoom The level of zoom where we do not draw under
* \param interval The interval we want to display in
* \param container the set of container that are to be drawn
*/
void build_partial(T* draw_object, Trace* trace, double zoom) {
Interval * interval = trace->get_interval_constrained();
std::vector<Container *> *container = trace->get_selected_container();
void build(T* draw_object, Trace* trace) {
double zoom = trace->get_filter();
Interval * interval;// = trace->get_interval_constrained();
std::vector<const Container *> *container = trace->get_selected_container();
if(container == NULL ||
container->empty()){
container = new vector<const Container *>();
trace->set_interval_constrained(new Interval(0,trace->get_max_date()));
trace->set_filter(0);
std::stack<Container *> containers;
for (std::list<Container *>::const_iterator i = trace->get_root_containers()->begin();
i != trace->get_root_containers()->end();
i++){
containers.push(*i);
container->push_back(*i);
}
add(container,&containers);
/*
for(list<Container*>::const_iterator it = trace->get_root_containers()->begin() ;
it != trace->get_root_containers()->end();
it ++){
container->push_back(*it);
}
// trace->get_interval_constrained()->_left = 0;
// trace->get_interval_constrained()->_right = trace->get_max_date();*/
}
for(int i = 0 ; (*container)[i]!=NULL ; i++)
std::cout << " Conteur : " << i << std::endl;
// for(unsigned int i = 0 ; i < container->size() ; i++)
// std::cout << " Conteur : " << (*container)[i]->get_name().to_string() << std::endl;
interval = trace->get_interval_constrained();
draw_object->start_draw();
draw_object->start_draw_containers();
browse_container_tree_partial(draw_object, trace,container);
browse_container_tree(draw_object, trace,container);
draw_object->end_draw_containers();
browse_entities_partial(draw_object,zoom,interval,container);
browse_entities(draw_object,zoom,interval,container);
draw_object->end_draw();
}
......@@ -244,32 +249,11 @@ public:
* Browsing functions.
*
**********************************/
/*
* \fn browse_container_tree(T* draw_object, Trace* trace)
* \brief Function that browses the containers of the trace argument and make them painted with a T object
*/
inline void browse_container_tree(T* draw_object, Trace* trace){
/*** Drawing containers ***/
int position = 0;
const list<Container *> *root_containers = trace->get_root_containers();
if (root_containers->empty()) {
*Message::get_instance() << "There is no container. The trace can not be drawn." << Message::endw;
}
else
for (list<Container *>::const_iterator i = root_containers->begin();
i != root_containers->end();
i++)
position += browse_container(draw_object, *i, position, 0);
}/* end browse_container_tree */
/*
* \fn browse_container_tree_partial(T* draw_object, Trace* trace, std::vector<Container *> container)
* \fn browse_container_tree(T* draw_object, Trace* trace, std::vector<Container *> container)
* \brief Function that browses the containers of the trace argument that are in the set container and make them painted with a T object
*/
inline void browse_container_tree_partial(T* draw_object, Trace* trace, std::vector<Container *> *container){
inline void browse_container_tree(T* draw_object, Trace* trace, std::vector< const Container *> *container){
/*** Drawing containers ***/
int position = 0;
......@@ -283,54 +267,8 @@ public:
i++)
// Use the fact a container is selected implies all his ancestors are
if(is_in_set(*i,container))
position += browse_container_partial(draw_object, *i, position, 0,container);
}/* end browse_container_tree_partial */
/*
* \fn browse_container(T* draw_object, const Container *container, int position, int depth)
* \brief Recursive function that browse a container to draw it with a T painting object in position, knowing the current depth in the tree
*/
int browse_container(T* draw_object, const Container *container, int position, int depth) {
int size = 0;
// Draw children
const list<Container *> *children = container->get_children();
for (list<Container *>::const_iterator i = children->begin();
i != children->end();
i++) {
size += browse_container(draw_object, (*i), position+size, depth+1);
}
// Store the position to draw links
_container_positions[container] = position + size; // First line after children
// Use one line for states and events
if (!container->get_states()->empty() || !container->get_events()->empty()) {
size++;
_entity_containers.push_back(container);
}
// Use one line for each variable
if (container->get_variable_number() > 0) {
_variable_containers.push_back(container);
size += container->get_variable_number();
}
if (size < 1) // Minimum size
size = 1;
// Push containers with links to draw
if (!container->get_links()->empty())
_link_containers.push_back(container);
// Draw this container
draw_container(draw_object, position, size, depth, container->get_name().to_string());
return size;
}
position += browse_container(draw_object, *i, position, 0,container);
}/* end browse_container_tree */
/*
......@@ -338,7 +276,7 @@ public:
* \brief Recursive function that browse a container to draw it if it is in the set of container with a T painting object in position, knowing the current depth in the tree
*/
int browse_container_partial(T* draw_object, const Container *container, int position, int depth, std::vector<Container *> *set_container) {
int browse_container(T* draw_object, const Container *container, int position, int depth, std::vector< const Container *> *set_container) {
int size = 0;
// Draw children
......@@ -347,7 +285,7 @@ public:
i != children->end();
i++) {
if(is_in_set(*i,set_container))
size += browse_container_partial(draw_object, (*i), position+size, depth+1,set_container);
size += browse_container(draw_object, (*i), position+size, depth+1,set_container);
}
// Store the position to draw links
......@@ -393,117 +331,10 @@ public:
draw_object->draw_container(x, y, _container_width, height);
draw_object->draw_container_text(x, y+height/2, text);
}
/*!
* \brief Browse the states list and draw them
*/
inline void browse_entities(T* draw_object, double zoom, const Interval& interval) {
const Container *container;
BinaryTree<StateChange> *state_tree;
BinaryTree<Event> *event_tree;
const list<Link *> *link_list;
Link *link;
const map<VariableType *, Variable *> *variable_map;
Variable *var;
const list<pair<Date, Double> > *variable_values;
int position;
Element_pos lvl_zoom;
if(zoom>=0)
lvl_zoom = zoom;
else
lvl_zoom = 0;
draw_object->start_draw_states();
for (list<const Container *>::const_iterator c = _entity_containers.begin();
c != _entity_containers.end();
c++) {
container = *c;
position = (int)_container_positions[container];
state_tree = container->get_states();
event_tree = container->get_events();
if (!state_tree->empty() || !event_tree->empty()) {
// Browse states
DrawTree<T, StateChange>(draw_object, position, lvl_zoom,
_container_height, _container_v_space, _state_height, _state_v_space)
.draw_tree(state_tree, interval);
// Browse events
DrawTree<T, Event>(draw_object, position, lvl_zoom,
_container_height, _container_v_space, _state_height, _state_v_space)
.draw_tree(event_tree, interval);
}
}/* end while (!_stack_states.empty()) */
draw_object->end_draw_states();
draw_object->start_draw_arrows();
for (list<const Container *>::const_iterator c = _link_containers.begin();
c != _link_containers.end();
c++) {
container = *c;
// Browse links
link_list = container->get_links();
for (list<Link *>::const_iterator it = link_list->begin();
it != link_list->end();
it++) {
link = *it;
draw_link(draw_object, link->get_start_time().get_value(), link->get_end_time().get_value(),
_container_positions[link->get_source()], _container_positions[link->get_destination()]);
}/* end for */
}/* end while (!_stack_states.empty()) */
draw_object->end_draw_arrows();
draw_object->start_draw_counter();
for (list<const Container *>::const_iterator c = _entity_containers.begin();
c != _entity_containers.end();
c++) {
container = *c;
position = (int)_container_positions[container];
if (!container->get_states()->empty() || !container->get_events()->empty())
position++;