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) {
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 << "%" ;
......
......@@ -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(){
......
......@@ -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);
......
......@@ -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);
}
......
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