Commit a6eb2e10 authored by François Trahay's avatar François Trahay

revert commit #1406

parent 254b18b1
......@@ -31,10 +31,26 @@ include (CheckLibraryExists)
include (CMakeDependentOption)
### Required Packages
find_package(Qt4 COMPONENTS QtCore QtGui QtXml REQUIRED)
set(QT_USE_QTUITOOLS ON)
set(QT_USE_QTOPENGL ON)
include(${QT_USE_FILE})
# Try to find Qt5 : http://forum.openscenegraph.org/viewtopic.php?t=11431
set(USE_QT5 OFF)
# QUIET option disables messages if the package cannot be found.
find_package(Qt5Widgets QUIET)
if(Qt5Widgets_FOUND)
# CMake 2.8.8 or greater required for qt5 use
if("${CMAKE_VERSION}" VERSION_GREATER 2.8.7)
set(USE_QT5 ON)
endif()
endif()
if(USE_QT5)
set(CMAKE_AUTOMOC ON)
find_package(Qt5 COMPONENTS Core Xml Widgets OpenGL UiTools REQUIRED)
else(USE_QT5) # Try Qt4
find_package(Qt4 COMPONENTS QtCore QtGui QtXml REQUIRED)
set(QT_USE_QTUITOOLS ON)
set(QT_USE_QTOPENGL ON)
include(${QT_USE_FILE})
endif(USE_QT5)
#find_package(OpenGL)
find_package(GLU)
......@@ -96,7 +112,7 @@ check_include_files(string.h HAVE_STRING_H)
# Components : filesystem, iostreams, programoptions, python, regex,
# serialization, signals, system, thread, wave
if(VITE_ENABLE_SERIALIZATION)
find_package( Boost COMPONENTS serialization thread iostreams)
find_package( Boost COMPONENTS serialization thread iostreams system)
endif(VITE_ENABLE_SERIALIZATION)
if(VITE_ENABLE_VBO)
......
......@@ -102,6 +102,7 @@
#include "trace/EntityValue.hpp"
#include "trace/EntityTypes.hpp"
#include "trace/Entitys.hpp"
//#include "trace/tree/Interval.hpp"
#include "trace/Trace.hpp"
#include "trace/DrawTree.hpp"
#include "trace/DrawTrace.hpp"
......@@ -112,13 +113,9 @@
/* -- */
#include "statistics/Stats_window.hpp"
/* -- */
#include "../parser/PajeParser/PajeFileManager.hpp"
#include "interface/Node_select.hpp"
#include "interface/Interface_graphic.hpp"
#include "core/Core.hpp"
#include "../parser/PajeParser/ParserEventPaje.hpp"
#include "../parser/PajeParser/PajeFileManager.hpp"
/* -- */
#ifdef WITH_VBO
#include "render/Render_alternate.hpp"
......@@ -163,8 +160,9 @@ Core::Core(int &argc, char ** argv)
console_app = NULL;
/* Qt uses the default system encoding for QString (used when opening a file) */
#if QT_VERSION < 0x050000
QTextCodec::setCodecForCStrings(QTextCodec::codecForLocale());
#endif
/*
* Store application name and current directory
*/
......@@ -487,7 +485,7 @@ bool Core::draw_trace(const string & filename, const int format) {
parser = NULL;
DrawTrace drawing_ogl;
bool killed=false;
// bool use_exact_values= true;
#ifdef WITH_VBO
Render<Render_alternate>render(_render_opengl) ;
#else
......@@ -500,7 +498,7 @@ bool Core::draw_trace(const string & filename, const int format) {
int time_buf = 0;
// Select the Parser in function of the file's extension
if(! ParserFactory::create(&parser, filename,_use_exact_values)){
if(! ParserFactory::create(&parser, filename)){
*Message::get_instance() << QObject::tr("Error : parser not found for input file").toStdString() << Message::ende;
return false;
}
......@@ -515,6 +513,9 @@ bool Core::draw_trace(const string & filename, const int format) {
Session::add_recent_file(QFileInfo(filename.c_str()).absoluteFilePath());
_main_window->update_recent_files_menu();
}
if (NULL == _trace) { /* no trace is loaded, parse the file */
/* Init data */
Info::Entity::x_min = 0;
Info::Entity::x_max = 0;
......@@ -717,11 +718,7 @@ bool Core::draw_trace(const string & filename, const int format) {
thread.wait();
Error::print_numbers();
std::string file_path =((QFileInfo(filename.c_str()).absoluteFilePath()).toStdString());
std::string fname = filename.substr( filename.find_last_of("/") + 1 );
std::string result= file_path.erase ((filename.find_last_of("/") + 1 ), strlen(fname.c_str()));
Error::flush(result+"log.txt");
Error::flush("log.txt");
// Wait for the end of the thread
//while(!thread.wait()) {
......@@ -733,7 +730,10 @@ bool Core::draw_trace(const string & filename, const int format) {
delete parser;
parser=NULL;
}
else if ( _file_opened != filename) {/* just check if execution is normal */
*Message::get_instance() << "Try to use file: " << filename << " instead of a previous parsed file: " << _file_opened << Message::ende;
}
if(_trace!=NULL && !killed){
if (Info::Render::_x_min_visible == Info::Render::_x_max_visible){// first time
_trace->set_interval_constrained(new Interval(0,_trace->get_max_date()));
......@@ -830,12 +830,9 @@ int Core::run(){
return EXIT_SUCCESS;
}
}
// default:/* like _STATE_UNKNOWN */
// display_help();
// warning(string("Cannot determine the arguments past. Please check the correct syntax."));
// }
//}
void Core::launch_action(int state, void* arg) {
......@@ -1224,32 +1221,14 @@ void Core::launch_action(int state, void* arg) {
break;
}
case _ZOOM_IN_PATTERN:
{
if(_use_exact_values==false){
_use_exact_values =true;
launch_action(Core:: _STATE_CLEAN_RENDER_AREA);
draw_trace(get_filename(),Core::_DRAW_OPENGL);
}
}
break;
case _ZOOM_OUT_PATTERN:
{
if(_use_exact_values==true){
_use_exact_values =false;
launch_action(Core:: _STATE_CLEAN_RENDER_AREA);
draw_trace(get_filename(),Core::_DRAW_OPENGL);
}
}
break;
default:/* like _STATE_UNKNOWN */
display_help();
warning(string("Cannot determine the arguments past. Please check the correct syntax."));
}
}
void Core::display_help(){
cout << endl
<< "Usage: vite [OPTION...] [[-f] inputfile] [-e outputfile] " << endl
......
......@@ -49,6 +49,7 @@
//#define WITH_VBO
class Core;
class Interface_graphic;
......@@ -67,21 +68,14 @@ class QString;
class QMutex;
class Parser;
class QWaitCondition ;
class PajeFileManager;
class ParserPaje;
class ParserEventPaje;
#include <interface/Interface_graphic.hpp>
#include <QObject>
#ifdef USE_MPI
#include <boost/mpi/environment.hpp>
#include <boost/mpi/communicator.hpp>
#endif
#include "parser/Parser.hpp"
/* -- */
#include "parser/PajeParser/PajeDefinition.hpp"
#include "../parser/PajeParser/ParserPaje.hpp"
//#include "render/Render.hpp"
//#include "interface/Interface.hpp"
/*!
*\brief This class is an terminal interface, it inherited from the Interface interface.
......@@ -89,7 +83,6 @@ class ParserEventPaje;
class Core : public QObject, public Interface {
Q_OBJECT
public:
// ParserEventPaje _ParserEvent;
/***********************************
*
......@@ -240,10 +233,6 @@ class Core : public QObject, public Interface {
static const int _STATE_UPDATE_VARVALUES = 30;
static const int _ZOOM_IN_PATTERN = 31;
static const int _ZOOM_OUT_PATTERN = 32;
/*!
* \brief Launch an action according to the argument state value.
* \param state An integer corresponding to a kind of action which must be executed.
......@@ -334,11 +323,13 @@ protected:
/*!
* \brief Contains the trace instance.
*/
Trace* _trace;
Trace* _trace;
QMutex* _mutex;
Parser* parser;
QWaitCondition* _finished;
QWaitCondition* _closed;
/*!
*\brief This attributes contains the launching current directory (_run_env[0]) and the first argument of the running command (_run_env[1]).
*/
......@@ -430,7 +421,6 @@ public:
*/
bool draw_trace(const std::string & filename, const int format);
bool _use_exact_values=false;
/*!
* \brief This function launch Qt event loop.
*/
......
......@@ -57,11 +57,11 @@
#include <QtUiTools>/* for the run-time loading .ui file */
#include <QCloseEvent>
#include <QDir>
#include <QtGui/QFileDialog>
#include <QtGui/QRadioButton>
#include <QtGui/QTextEdit>
#include <QtGui/QCheckBox>
#include <QtGui/QMessageBox>
#include <QFileDialog>
#include <QRadioButton>
#include <QTextEdit>
#include <QCheckBox>
#include <QMessageBox>
#include <QProgressDialog>
/* -- */
#include "interface/resource.hpp"
......@@ -205,7 +205,7 @@ void Interface_graphic::load_windows(){
if ( file_counter_to_export.exists() ) {
file_counter_to_export.open(QFile::ReadOnly);
CKFP(_ui_counter_choice_to_export = loader.load(&file_counter_to_export, this), "Cannot open the .ui file : " << ":/window/list_of_counter_to_export.ui");
CKFP(_counter_list_names = qFindChild<QComboBox*>(_ui_counter_choice_to_export, "combobox"), "Cannot find the svg export button in the .ui file");
CKFP(_counter_list_names = _ui_counter_choice_to_export->findChild<QComboBox*>("combobox"), "Cannot find the svg export button in the .ui file");
file_counter_to_export.close();
} else {
cerr << __FILE__ << ":" << __LINE__ << ": The following .ui file doesn't exist: " << ":/window/list_of_counter_to_export.ui" << endl;
......@@ -225,9 +225,9 @@ void Interface_graphic::load_windows(){
/* Load the export combo box choice from a .ui file */
/* file_kind_of_export.open(QFile::ReadOnly);
CKFP(_ui_kind_of_export_choice = loader.load(&file_kind_of_export, this), "Cannot open the .ui file : " << ":/window/kind_of_export.ui");
CKFP(_ui_svg_export_button = qFindChild<QRadioButton*>(_ui_kind_of_export_choice, "svg_export"), "Cannot find the svg export button in the .ui file");
CKFP(_ui_png_export_button = qFindChild<QRadioButton*>(_ui_kind_of_export_choice, "png_export"), "Cannot find the png export button in the .ui file");
CKFP(_ui_counter_export_button = qFindChild<QRadioButton*>(_ui_kind_of_export_choice, "counter_export"), "Cannot find the svg export button in the .ui file");
CKFP(_ui_svg_export_button = this->findChild(QRadioButton*), _ui_kind_of_export_choice, "svg_export"), "Cannot find the svg export button in the .ui file");
CKFP(_ui_png_export_button = this->findChild(QRadioButton*), _ui_kind_of_export_choice, "png_export"), "Cannot find the png export button in the .ui file");
CKFP(_ui_counter_export_button = this->findChild(QRadioButton*), _ui_kind_of_export_choice, "counter_export"), "Cannot find the svg export button in the .ui file");
file_kind_of_export.close();*/
/* Set some windows properties */
......@@ -235,26 +235,26 @@ void Interface_graphic::load_windows(){
_ui_time_selection_export->setWindowFlags(_ui_time_selection_export->windowFlags() | Qt::WindowStaysOnTopHint);
/* Load widget from the .ui file */
CKFP(_ui_render_area_layout = qFindChild<QVBoxLayout*>(this, "render_area_layout"), "Cannot find the render_area layout in the .ui file");
CKFP(_ui_render_area_layout = this->findChild<QVBoxLayout*>("render_area_layout"), "Cannot find the render_area layout in the .ui file");
CKFP(_ui_fullscreen_menu = qFindChild<QAction*>(this, "fullscreen"), "Cannot find the fullscreen menu in the .ui file");
CKFP(_ui_info_trace_text = qFindChild<QTextEdit*>(_ui_info_window, "info_trace_text"), "Cannot find the info_trace_text QTextEdit widget in the .ui file");
CKFP(_ui_info_selection_text = qFindChild<QTextEdit*>(_ui_info_window, "info_selection_text"), "Cannot find the info_selection_text QTextEdit widget in the .ui file");
CKFP(_ui_toolbar = qFindChild<QToolBar*>(this, "toolBar"), "Cannot find the tool bar in the .ui file");
CKFP(_ui_fullscreen_menu = this->findChild<QAction*>("fullscreen"), "Cannot find the fullscreen menu in the .ui file");
CKFP(_ui_info_trace_text = _ui_info_window->findChild<QTextEdit*>("info_trace_text"), "Cannot find the info_trace_text QTextEdit widget in the .ui file");
CKFP(_ui_info_selection_text = _ui_info_window->findChild<QTextEdit*>("info_selection_text"), "Cannot find the info_selection_text QTextEdit widget in the .ui file");
CKFP(_ui_toolbar = this->findChild<QToolBar*>("toolBar"), "Cannot find the tool bar in the .ui file");
CKFP(_ui_x_scroll = qFindChild<QScrollBar*>(this, "x_scroll"), "Cannot find the horizontal scroll bar in the .ui file");
CKFP(_ui_y_scroll = qFindChild<QScrollBar*>(this, "y_scroll"), "Cannot find the vertical scroll bar in the .ui file");
CKFP(_ui_x_scroll = this->findChild<QScrollBar*>("x_scroll"), "Cannot find the horizontal scroll bar in the .ui file");
CKFP(_ui_y_scroll = this->findChild<QScrollBar*>("y_scroll"), "Cannot find the vertical scroll bar in the .ui file");
CKFP(_ui_zoom_box = qFindChild<QComboBox*>(this, "zoom_box"), "Cannot find the zoom box in the .ui file");
CKFP(_ui_zoom_box = this->findChild<QComboBox*>("zoom_box"), "Cannot find the zoom box in the .ui file");
CKFP(_ui_recent_files_menu = qFindChild<QMenu*>(this, "menuRecent_Files"), "Cannot find the button \"menuRecent_Files\" in the .ui file");
CKFP(_ui_recent_files_menu = this->findChild<QMenu*>("menuRecent_Files"), "Cannot find the button \"menuRecent_Files\" in the .ui file");
// CKFP(Info::Render::_ui_render_min_value = qFindChild<QLabel*>(this, "render_min_value"), "Cannot find the render_min_value label in the .ui file");
// CKFP(Info::Render::_ui_render_max_value = qFindChild<QLabel*>(this, "render_max_value"), "Cannot find the render_max_value label in the .ui file");
// CKFP(Info::Render::_ui_render_min_value = this->findChild<QLabel*>("render_min_value"), "Cannot find the render_min_value label in the .ui file");
// CKFP(Info::Render::_ui_render_max_value = this->findChild<QLabel*>("render_max_value"), "Cannot find the render_max_value label in the .ui file");
/* Help window */
CKFP(_ui_help_ok_button = qFindChild<QPushButton*>(_ui_help_window, "help_ok"), "Cannot find the ok push button in the help dialog .ui file");
CKFP(_ui_help_ok_button = _ui_help_window->findChild<QPushButton*>("help_ok"), "Cannot find the ok push button in the help dialog .ui file");
connect(_ui_counter_choice_to_export, SIGNAL(accepted()),
......@@ -366,6 +366,7 @@ void Interface_graphic::selection_information(const string &s) const{
**********************************/
void Interface_graphic::opening_file(const string &path){
information(string("File opened: ")+ path);
_trace_path = path;
......@@ -374,15 +375,15 @@ void Interface_graphic::opening_file(const string &path){
QApplication::setOverrideCursor(Qt::WaitCursor);
if (_core->draw_trace(path,Core::_DRAW_OPENGL)==false){
/* if (_core->draw_trace(path)==false){
error("Draw trace failed");
}
}*/
// _ui_render_area->build();
_is_rendering_trace = true;
_ui_render_area->updateGL();
// _ui_render_area->updateGL();
QApplication::restoreOverrideCursor();
......@@ -638,7 +639,6 @@ void Interface_graphic::on_export_file_triggered(){
}
void Interface_graphic::on_reload_triggered() {
_core->_use_exact_values=false;
if(_is_rendering_trace) {
Element_pos zoom[2]={Info::Splitter::_x_min,Info::Splitter::_x_max};
if(_reload_type)
......@@ -646,14 +646,19 @@ void Interface_graphic::on_reload_triggered() {
else
_core->launch_action(Core::_STATE_CLEAN_RENDER_AREA);
_core->draw_trace(_trace_path, Core::_DRAW_OPENGL);
if(Info::Splitter::_x_max!=0.0)_core->launch_action(Core:: _STATE_ZOOM_IN_AN_INTERVAL, &zoom);
if(Info::Splitter::_x_max!=0.0)_core->launch_action(Core:: _STATE_ZOOM_IN_AN_INTERVAL, &zoom);
_core->launch_action(Core:: _STATE_RENDER_UPDATE);
//reset the slider to its original value
scale_container_state->setValue(20);
//reset the slider to its original value
scale_container_state->setValue(20);
//update the interval selection display
if(_ui_interval_selection!=NULL)_ui_interval_selection->update_values();
//update the interval selection display
if(_ui_interval_selection!=NULL)_ui_interval_selection->update_values();
}
}
void Interface_graphic::open_recent_file() {
......@@ -673,12 +678,14 @@ void Interface_graphic::on_clear_recent_files_triggered() {
}
void Interface_graphic::counter_choosed_triggered() {
// Il faut faire choisir le nom du fichier! et enfin on peut lancer l'action !
// const QString path_by_default = QString(_trace_path.substr(0, _trace_path.find_last_of('.')).c_str()) + ".txt";
//QString filename = QFileDialog::getSaveFileName(this, QObject::tr("Export File"),
// path_by_default,
// QObject::tr("All files"));
Variable *temp = _all_variables[_counter_list_names->currentText().toStdString()];
// _core->export_variable(temp, filename.toStdString());
_core->export_variable(temp, _export_filename.toStdString());
}
......@@ -1021,7 +1028,11 @@ void Interface_graphic::on_show_all_trace_triggered(){
_core->launch_action(Core::_STATE_RENDER_AREA_REGISTERED_TRANSLATE, &id);
}
void Interface_graphic::on_zoom_box_textChanged(QString s){
#if QT_VERSION < 0x050000
void Interface_graphic::on_zoom_box_textChanged(const QString &s){
#else
void Interface_graphic::on_zoom_box_currentTextChanged(const QString &s){
#endif
QRegExp reg_exp_number("^(\\d+)");
QString result;
Element_pos d;
......@@ -1039,6 +1050,7 @@ void Interface_graphic::on_zoom_box_textChanged(QString s){
d = 0.01*result.toDouble();
if (0 == d)/* if zoom is null ignore it */
return;
_core->launch_action(Core::_STATE_RENDER_AREA_REPLACE_SCALE, &d);
}
......
......@@ -58,9 +58,9 @@ class QProgressDialog;
/* Includes needed by the moc */
#include <QGLWidget>
#include <QtGui/QTextEdit>
#include <QtGui/QRadioButton>
#include <QtGui/QPushButton>
#include <QTextEdit>
#include <QRadioButton>
#include <QPushButton>
/* -- */
#include "common/common.hpp"
#include "common/Session.hpp"
......@@ -685,7 +685,11 @@ protected slots:
*
* \param s The new string value of the zoom box.
*/
void on_zoom_box_textChanged(QString s);
#if QT_VERSION < 0x050000
void on_zoom_box_textChanged(const QString &s);
#else
void on_zoom_box_currentTextChanged(const QString &s);
#endif
/*!
* \brief Change the x position of camera view for state drawing area.
......@@ -708,6 +712,7 @@ protected slots:
* \brief Says to the concerned classes that settings has been changed.
*/
void update_settings();
};
#endif
......@@ -73,10 +73,6 @@ typedef enum paje_eventdef_e {
_PajeSubVariable,
_PajeStartLink,
_PajeEndLink,
_PajeStartPattern,
_PajeEndPattern,
_PajeDefinePattern,
_PajeEndDefPattern,
PAJE_EVENTDEF_SIZE
} paje_eventdef_t;
......
......@@ -256,22 +256,3 @@ void PajeFileManager::print_line() {
cout << "===========================================" << endl;
}
void PajeFileManager::duplicate_line(PajeLine *line,PajeLine *line_duplicate){
(*line_duplicate)._id=line->_id;
(*line_duplicate)._nbtks=line->_nbtks;
line_duplicate->_tokens = new char*[_PAJE_NBMAXTKS];
for(int j=0;j<line_duplicate->_nbtks;j++){
char *ptr;
if (ptr != NULL) {
ptr= new char[_PAJE_NBMAXTKS*2];
}
strcpy(ptr,line->_tokens[j]);
line_duplicate->_tokens[j] = ptr;
}
}
void PajeFileManager::create_pattern(Pattern *pattern,PajeLine *line_duplicate){
(pattern->_events_list).push_back(*line_duplicate);
pattern->_nb_events++;
}
......@@ -6,13 +6,13 @@
** use, modify and/or redistribute the software under the terms of the
** CeCILL-A license as circulated by CEA, CNRS and INRIA at the following
** URL: "http://www.cecill.info".
**
**
** As a counterpart to the access to the source code and rights to copy,
** modify and redistribute granted by the license, users are provided
** only with a limited warranty and the software's author, the holder of
** the economic rights, and the successive licensors have only limited
** liability.
**
**
** In this respect, the user's attention is drawn to the risks associated
** with loading, using, modifying and/or developing or reproducing the
** software by the user in light of its specific status of free software,
......@@ -23,7 +23,7 @@
** their requirements in conditions enabling the security of their
** systems and/or data to be ensured and, more generally, to use and
** operate it in the same conditions as regards security.
**
**
** The fact that you are presently reading this means that you have had
** knowledge of the CeCILL-A license and that you accept its terms.
**
......@@ -37,13 +37,13 @@
** - MARCOUEILLE Jule
** - NOISETTE Pascal
** - REDONDY Arthur
** - VUCHENER Clément
** - VUCHENER Clément
**
*/
/**
* \file PajeFileManager.hpp
* Visual Trace Explorer
* Visual Trace Explorer
*
* Release Date: January, 2nd 2010
* ViTE is a software to vivisualize execution trace provided by
......@@ -57,53 +57,45 @@
* @author Jule Marcoueille
* @author Pascal Noisette
* @author Arthur Redondy
* @author Clément Vuchener
* @author Clément Vuchener
* @date 2010-01-02
*
**/
#ifndef FILE_HPP
#define FILE_HPP
#include <string.h>
#include <list>
#define _PAJE_NBMAXTKS 1000
#define _PAJE_NBMAXTKS 16
/**
* \struct PajeLine
* \struct PajeLine
*
* Brief structure to store informations read
* Brief structure to store informations read
* on each line
*
* \param _id Line number
* \param _nbtks Number of tokens found on the line
* \param _tokens Pointers on the found tokens
*
*
*/
typedef struct PajeLine {
int _id;
int _nbtks;
char **_tokens;
PajeLine() {}
} PajeLine_t;
typedef struct Pattern {
std::string _name;
int _nb_events;
double _duration;
std::list<PajeLine> _events_list;
Pattern() {}
} Pattern_t;
/**
* \class PajeFileManager
*
*
* File manager to read files using Paje syntax.
* Each line is read one after one and stored in
* Each line is read one after one and stored in
* the PajeLine structure associated to the class.
*
*
* \sa Parser
* \sa ParserPaje
* \sa ParserVite
......@@ -120,25 +112,25 @@ private:
std::string _line;
PajeFileManager(const PajeFileManager &);
public:
/*!
* \brief Constructor for the file
*/
PajeFileManager();
/*!
* \brief Constructor for the file
* \param filename : a filename
*/
PajeFileManager(const char * filename, ios_base::openmode mode = ios_base::in );
/*!
* \brief Destructor
* Destroy the file
*/
~PajeFileManager();
/*!
* \fn open(const char * filename, ios_base::openmode mode)
* \brief Open the file
......@@ -164,7 +156,7 @@ public:
* \return The size already loaded
*/
long long get_size_loaded();
/*!
* \fn get_percent_loaded()
* \return The percent of the file loaded (between 0 and 1).
......@@ -184,11 +176,6 @@ public:
* \brief Print the current line for debug
*/
void print_line();
void duplicate_line(PajeLine *line,PajeLine *line_duplicate);
void create_pattern(Pattern *pattern,PajeLine *line_duplicate);
};
#endif // FILE_HPP
......@@ -84,6 +84,7 @@ using namespace std;
i++; \
}
std::map<std::string, int> ParserDefinitionPaje::_EvDefStr2Id;
std::map<std::string, int> ParserDefinitionPaje::_FTypeStr2Code;
bool ParserDefinitionPaje::_initialized = false;
......@@ -118,10 +119,6 @@ ParserDefinitionPaje::ParserDefinitionPaje() {
_EvDefStr2Id.insert(pair<string, int>("PajeSubVariable" , _PajeSubVariable ));
_EvDefStr2Id.insert(pair<string, int>("PajeStartLink" , _PajeStartLink ));
_EvDefStr2Id.insert(pair<string, int>("PajeEndLink" , _PajeEndLink ));
_EvDefStr2Id.insert(pair<string, int>("PajeStartPattern" , _PajeStartPattern ));
_EvDefStr2Id.insert(pair<string, int>("PajeEndPattern" , _PajeEndPattern ));
_EvDefStr2Id.insert(pair<string, int>("PajeDefinePattern" , _PajeDefinePattern ));
_EvDefStr2Id.insert(pair<string, int>("PajeEndDefPattern" , _PajeEndDefPattern ));
// Initialize the list of types available for field in EventDef declaration
_FTypeStr2Code.insert(pair<string, int>("int" ,_FieldType_Int ));
......@@ -186,11 +183,6 @@ ParserDefinitionPaje::ParserDefinitionPaje() {
INSERT_EVENT(PajeSubVariable , CODE2(Time) | CODE2(Type) | CODE2(Container) | CODE2(Value) );
INSERT_EVENT(PajeStartLink , CODE2(Time) | CODE2(Type) | CODE2(Container) | CODE2(Value) | CODE2(Key) | CODE2(StartContainer) );
INSERT_EVENT(PajeEndLink , CODE2(Time) | CODE2(Type) | CODE2(Container) | CODE2(Value) | CODE2(Key) | CODE2(EndContainer) );
INSERT_EVENT(PajeStartPattern , CODE2(Time) | CODE2(Alias) | CODE2(Key) );
INSERT_EVENT(PajeEndPattern , CODE2(Time) | CODE2(Alias) | CODE2(Key) );
INSERT_EVENT(PajeDefinePattern , CODE2(Time) | CODE2(Alias) | CODE2(Container) );
INSERT_EVENT(PajeEndDefPattern ,CODE2(Time) | CODE2(Alias) | CODE2(Container) );
}
ParserDefinitionPaje::~ParserDefinitionPaje() {
......
/*
*
*
** This file is part of the ViTE project.
**
** This software is governed by the CeCILL-A license under French law
......@@ -43,17 +40,11 @@
** - VUCHENER Clément
**
*/
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <list>
#include <iostream>
#include <QDir>
#include <QFileInfo>
#include "cmath"
/* -- */
#include "common/Errors.hpp"
/* -- */
......@@ -83,8 +74,8 @@ ParserEventPaje::~ParserEventPaje(){
_containers.clear();
}
void ParserEventPaje::store(PajeFileManager *_file, PajeLine *line,
Trace &trace,bool use_exact_values) {
void ParserEventPaje::store_event(const PajeLine *line,
Trace &trace) {
string fvalue;
string alias;
string name;
......@@ -97,7 +88,7 @@ void ParserEventPaje::store(PajeFileManager *_file, PajeLine *line,
Double value_double;
String start_container;
String end_container;
string key;
String key;
Name alias_name;
......@@ -109,6 +100,7 @@ void ParserEventPaje::store(PajeFileManager *_file, PajeLine *line,
int i, trid;
int defsize;
int idname, idtype;
// We check if we have an event identifier
if(sscanf(line->_tokens[0], "%u", &trid) != 1){
Error::set(Error::VITE_ERR_EXPECT_ID_DEF, line->_id, Error::VITE_ERRCODE_WARNING);
......@@ -252,8 +244,9 @@ void ParserEventPaje::store(PajeFileManager *_file, PajeLine *line,
extra_fields[(*FNames)[idname]._name] = value;
}
}
if ( (alias != "") && (name == "" ) ){
name = alias;
name = alias;
}
if ( (name != "") && (alias == "") ) {
alias = name;
......@@ -261,104 +254,7 @@ void ParserEventPaje::store(PajeFileManager *_file, PajeLine *line,
alias_name.set_alias(alias);
alias_name.set_name(name);
static char *d_62= new char[_PAJE_NBMAXTKS];
static double d_63=0;
static std::string nom_pattern;