Commit 9838c37d authored by Augustin Degomme's avatar Augustin Degomme

- use <limits> instead of limits.h in Interval select to avoid potential compilation problems

- re enable horizontal scrolling (ctrl + mouse wheel) which was broken since 1202
- avoid negative advancement values in parser splitted
parent 6421ce9d
......@@ -71,7 +71,7 @@
#include "interface/Interval_select.hpp"
#include "limits.h"
#include <limits>
using namespace std;
......
......@@ -70,10 +70,17 @@ Serializer<Container>::Instance().clear();
Serializer<ContainerType>::Instance().clear();
Serializer<EntityType>::Instance().clear();
std::list<ContainerType*> conts_types;
std::list<ContainerType *> conts_types;
std::list<Container*> conts;
std::ifstream ifs(_file_to_parse.c_str());
std::ifstream ifs(_file_to_parse.c_str(),std::ios::in);
if(ifs.fail())
{
message << "Error while opening file" << _file_to_parse << Message::ende;
return;
}
QT_TRY {
boost::archive::text_iarchive ia(ifs);
ia.register_type(static_cast<StateType *>(NULL));
ia.register_type(static_cast<EventType *>(NULL));
ia.register_type(static_cast<VariableType *>(NULL));
......@@ -87,6 +94,8 @@ Serializer<EntityType>::Instance().clear();
ia.register_type(static_cast<Integer *>(NULL));
ia.register_type(static_cast<Name *>(NULL));
ia.register_type(static_cast<String *>(NULL));
printf("test : %d\n", ia.get_library_version());
ia >> conts_types;
trace.set_container_types(conts_types);
//int test;
......@@ -103,7 +112,7 @@ Serializer<EntityType>::Instance().clear();
{
bool xml_success = trace.load_config_from_xml(QString(Info::Splitter::xml_filename.c_str()));
if(!xml_success){
message << "Error while parsing" << Info::Splitter::xml_filename << Message::ende;
std::cerr << "Error while parsing" << Info::Splitter::xml_filename << std::endl;
}
}
......@@ -129,7 +138,11 @@ Serializer<EntityType>::Instance().clear();
Date d;
ia >>d;
trace.set_max_date(d);
}QT_CATCH(boost::archive::archive_exception e) {
std::cerr << "failed while restoring serialized file !" << e.what() << " with file " << _file_to_parse <<std::endl;
return;
}
//we count the number of containers to load, in order to have a pseudo relevant loaded percentage to display_build
//we should do this with ITC, but that would mean to handle all of the loading here or to have a feedback from trace and containers
......@@ -217,6 +230,9 @@ void ParserSplitted::releasefile(){
}
float ParserSplitted::get_percent_loaded() const {
if(_nb_itc!=0)
return (double)_loaded_itc/(double)_nb_itc;
else
return 0.0;
}
#endif
......@@ -693,7 +693,7 @@ void Hook_event::replace_scale(Element_pos new_scale){
_core->launch_action(_core->_STATE_ZOOM_BOX_VALUE, &buf);
// updateRender();
updateRender();
refresh_scroll_bars(true);
}
}
......
......@@ -518,7 +518,7 @@ void Trace::dump(std::string path, std::string filename) {
std::string file;
file += path + "/" + filename + "/" + filename +".vite";
// i = _root_containers.begin();
std::ofstream ofs(file.c_str());
std::ofstream ofs(file.c_str(),std::ios::out);
boost::archive::text_oarchive oa(ofs);
......
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