Attention une mise à jour du serveur va être effectuée le vendredi 16 avril entre 12h et 12h30. Cette mise à jour va générer une interruption du service de quelques minutes.

Commit 7be547a8 authored by Augustin Degomme's avatar Augustin Degomme

removes a few warnings, a bug in core that happened sometimes and prevented...

removes a few warnings, a bug in core that happened sometimes and prevented trace from displaying, a bug with variables in Container finish with itc, and adds a message when trying to use interval or node selection with no trace loaded
parent 10364166
...@@ -324,9 +324,9 @@ bool Core::draw_trace(const string & filename, const int format) { ...@@ -324,9 +324,9 @@ bool Core::draw_trace(const string & filename, const int format) {
thread.start(); thread.start();
time_elapsed.start(); time_elapsed.start();
buf_txt.str(""); buf_txt.str("");
bool parsing_finished=false;
emit run_parsing(); emit run_parsing();
while( !(parser->is_end_of_parsing() || thread.isFinished())) { while( !parsing_finished) {
//#ifdef WIN32 //#ifdef WIN32
// Sleep(1000); // Sleep(1000);
...@@ -363,6 +363,9 @@ bool Core::draw_trace(const string & filename, const int format) { ...@@ -363,6 +363,9 @@ bool Core::draw_trace(const string & filename, const int format) {
} }
}else{ }else{
#endif #endif
//locks the mutex and automatically unlocks it when going out of scope //locks the mutex and automatically unlocks it when going out of scope
QMutexLocker locker(&mutex); QMutexLocker locker(&mutex);
if(format != _STATE_SPLITTING) { if(format != _STATE_SPLITTING) {
...@@ -386,10 +389,11 @@ bool Core::draw_trace(const string & filename, const int format) { ...@@ -386,10 +389,11 @@ bool Core::draw_trace(const string & filename, const int format) {
} }
#if defined(USE_ITC) && defined(BOOST_SERIALIZE) #if defined(USE_ITC) && defined(BOOST_SERIALIZE)
finished.wait(&mutex); finished.wait(&mutex);
} }
#endif #endif
parsing_finished=true;
} }
cout << QObject::tr("Loading of the trace : ").toStdString() << loaded << "%" ; cout << QObject::tr("Loading of the trace : ").toStdString() << loaded << "%" ;
......
...@@ -870,30 +870,37 @@ void Interface_graphic::on_show_settings_triggered() { ...@@ -870,30 +870,37 @@ void Interface_graphic::on_show_settings_triggered() {
//if (!_ui_node_selection) { //if (!_ui_node_selection) {
// _ui_node_selection = new Node_select(this, 0); // _ui_node_selection = new Node_select(this, 0);
if(!_ui_node_selection->get_trace() && _core->get_trace()){//first use if(_core->get_trace() != NULL) {
_ui_node_selection->set_trace(_core->get_trace()); if(!_ui_node_selection->get_trace()){//first use
_ui_node_selection->set_trace(_core->get_trace());
} }
_ui_node_selection->show();
}else{
error("Must load a trace before using node selection on a trace");
}
//connect( _ui_node_selection, SIGNAL(settings_changed()), this, SLOT(update_settings())); //connect( _ui_node_selection, SIGNAL(settings_changed()), this, SLOT(update_settings()));
// To close the window when we quit the application // To close the window when we quit the application
//connect(quit, SIGNAL(triggered()), _ui_node_selection, SLOT(close())); //connect(quit, SIGNAL(triggered()), _ui_node_selection, SLOT(close()));
//} //}
_ui_node_selection->show();
} }
void Interface_graphic::on_interval_selection_triggered() { void Interface_graphic::on_interval_selection_triggered() {
//if (!_ui_node_selection) { //if (!_ui_node_selection) {
// _ui_node_selection = new Node_select(this, 0); // _ui_node_selection = new Node_select(this, 0);
if(_core->get_trace() != NULL) {
if(!_ui_interval_selection->get_trace() && _core->get_trace()){//first use if(!_ui_interval_selection->get_trace() && _core->get_trace()){//first use
_ui_interval_selection->set_trace(_core->get_trace()); _ui_interval_selection->set_trace(_core->get_trace());
} }
_ui_interval_selection->show();
}else{
error("Must load a trace before using interval selection on a trace");
}
//connect( _ui_node_selection, SIGNAL(settings_changed()), this, SLOT(update_settings())); //connect( _ui_node_selection, SIGNAL(settings_changed()), this, SLOT(update_settings()));
// To close the window when we quit the application // To close the window when we quit the application
//connect(quit, SIGNAL(triggered()), _ui_node_selection, SLOT(close())); //connect(quit, SIGNAL(triggered()), _ui_node_selection, SLOT(close()));
//} //}
_ui_interval_selection->show();
} }
void Interface_graphic::on_actionCommand_triggered(){ void Interface_graphic::on_actionCommand_triggered(){
......
...@@ -207,7 +207,7 @@ void Render_opengl::paintGL(){ ...@@ -207,7 +207,7 @@ void Render_opengl::paintGL(){
resizeGL(Render_opengl::QGLWidget::width(), Render_opengl::QGLWidget::height()); resizeGL(Render_opengl::QGLWidget::width(), Render_opengl::QGLWidget::height());
Render_opengl::QGLWidget::setFocus(Qt::ActiveWindowFocusReason);/* give the focus to the render area for mouse and keyboard events */ Render_opengl::QGLWidget::setFocus(Qt::ActiveWindowFocusReason);/* give the focus to the render area for mouse and keyboard events */
makeCurrent(); makeCurrent();
static int arrows_drawn=0; //static int arrows_drawn=0;
glClearDepth(1.0); glClearDepth(1.0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
......
...@@ -80,10 +80,11 @@ using namespace std; ...@@ -80,10 +80,11 @@ using namespace std;
Container::Container(): Container::Container():
_name(), _creation_time(0.0), _destruction_time(0.0), _type(NULL), _parent(NULL), _name(), _creation_time(0.0), _destruction_time(0.0), _type(NULL), _parent(NULL),
_n_states(0), _state_tree(NULL), _n_events(0), _event_tree(NULL) _n_states(0), _state_tree(NULL), _n_events(0)
#ifdef USE_ITC #ifdef USE_ITC
, _events(NULL) , _events(NULL)
#endif #endif
, _event_tree(NULL)
, _n_variables(0){} , _n_variables(0){}
Container::Container(Name name, Date creation_time, ContainerType *type, Container *parent, map<string, Value *> &opt): Container::Container(Name name, Date creation_time, ContainerType *type, Container *parent, map<string, Value *> &opt):
...@@ -785,7 +786,7 @@ _state_tree=NULL; ...@@ -785,7 +786,7 @@ _state_tree=NULL;
std::list<std::pair<Date, Double> >::const_iterator it_val = ((*it)->_variables[i]).get_values()->begin(); std::list<std::pair<Date, Double> >::const_iterator it_val = ((*it)->_variables[i]).get_values()->begin();
for(; for(;
it_val!=((*it)->_variables[i]).get_values()->end(); it_val!=((*it)->_variables[i]).get_values()->end();
it++){ it_val++){
pair<Date, Double> t= *it_val; pair<Date, Double> t= *it_val;
_variables[type]->add_value(t.first, t.second); _variables[type]->add_value(t.first, t.second);
} }
......
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