diff --git a/src/core/Core.cpp b/src/core/Core.cpp index 2bc57ed9bd3d5511f90865faa331dace5974d28b..a5a0a1e981c2cec1a8c66dfab4ac2f57f444e2cd 100644 --- a/src/core/Core.cpp +++ b/src/core/Core.cpp @@ -324,9 +324,9 @@ bool Core::draw_trace(const string & filename, const int format) { thread.start(); time_elapsed.start(); buf_txt.str(""); - + bool parsing_finished=false; emit run_parsing(); - while( !(parser->is_end_of_parsing() || thread.isFinished())) { + while( !parsing_finished) { //#ifdef WIN32 // Sleep(1000); @@ -363,6 +363,9 @@ bool Core::draw_trace(const string & filename, const int format) { } }else{ #endif + + + //locks the mutex and automatically unlocks it when going out of scope QMutexLocker locker(&mutex); if(format != _STATE_SPLITTING) { @@ -386,10 +389,11 @@ bool Core::draw_trace(const string & filename, const int format) { } #if defined(USE_ITC) && defined(BOOST_SERIALIZE) finished.wait(&mutex); + } #endif - + parsing_finished=true; } cout << QObject::tr("Loading of the trace : ").toStdString() << loaded << "%" ; diff --git a/src/interface/Interface_graphic.cpp b/src/interface/Interface_graphic.cpp index 84a3b97aafc0b91b49220fef23eeba0bb4b67a0f..b4c1845dd8524616087a63537f4cc9344214e6cb 100644 --- a/src/interface/Interface_graphic.cpp +++ b/src/interface/Interface_graphic.cpp @@ -870,30 +870,37 @@ void Interface_graphic::on_show_settings_triggered() { //if (!_ui_node_selection) { // _ui_node_selection = new Node_select(this, 0); - if(!_ui_node_selection->get_trace() && _core->get_trace()){//first use - _ui_node_selection->set_trace(_core->get_trace()); - - } + if(_core->get_trace() != NULL) { + 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())); // To close the window when we quit the application //connect(quit, SIGNAL(triggered()), _ui_node_selection, SLOT(close())); //} - _ui_node_selection->show(); } void Interface_graphic::on_interval_selection_triggered() { //if (!_ui_node_selection) { // _ui_node_selection = new Node_select(this, 0); + if(_core->get_trace() != NULL) { if(!_ui_interval_selection->get_trace() && _core->get_trace()){//first use _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())); // To close the window when we quit the application //connect(quit, SIGNAL(triggered()), _ui_node_selection, SLOT(close())); //} - _ui_interval_selection->show(); } void Interface_graphic::on_actionCommand_triggered(){ diff --git a/src/render/Render_opengl.cpp b/src/render/Render_opengl.cpp index b2bac0c9e1ae0392b581b1f82592885513c8bd34..28f666684bb8e8019690c28a16f00309dcad3c32 100644 --- a/src/render/Render_opengl.cpp +++ b/src/render/Render_opengl.cpp @@ -207,7 +207,7 @@ void Render_opengl::paintGL(){ 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 */ makeCurrent(); - static int arrows_drawn=0; + //static int arrows_drawn=0; glClearDepth(1.0); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); diff --git a/src/trace/Container.cpp b/src/trace/Container.cpp index c5c4d4d2eaa8efdb597e2608027b42bccceb7db6..87522b744a6c4a349c056bc88b505cad72903d7e 100644 --- a/src/trace/Container.cpp +++ b/src/trace/Container.cpp @@ -80,10 +80,11 @@ using namespace std; Container::Container(): _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 , _events(NULL) #endif + , _event_tree(NULL) , _n_variables(0){} Container::Container(Name name, Date creation_time, ContainerType *type, Container *parent, map<string, Value *> &opt): @@ -785,7 +786,7 @@ _state_tree=NULL; std::list<std::pair<Date, Double> >::const_iterator it_val = ((*it)->_variables[i]).get_values()->begin(); for(; it_val!=((*it)->_variables[i]).get_values()->end(); - it++){ + it_val++){ pair<Date, Double> t= *it_val; _variables[type]->add_value(t.first, t.second); }