Attention une mise à jour du serveur va être effectuée le lundi 17 mai entre 13h et 13h30. Cette mise à jour va générer une interruption du service de quelques minutes.

Commit 2eeddf02 authored by Johnny Jazeix's avatar Johnny Jazeix

Some documentations and a correction for the stats windows when there

are a lot of states
parent 8889cc51
......@@ -31,7 +31,7 @@ PROJECT_NAME = ViTE
# This could be handy for archiving the generated documentation or
# if some version control system is used.
PROJECT_NUMBER = 0.3
PROJECT_NUMBER = 1.0
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.
......
/*!
* \mainpage ViTE
*
ViTE is a trace explorer. It is a tool to visualize execution traces in Pajé format for debugging and profiling parallel or distributed applications.
* \image html logo.png
* \image latex logo.png
*
* \authors COULOMB Kevin
* \authors FAVERGE Mathieu
* \authors JAZEIX Johnny
* \authors LAGRASSE Olivier
* \authors MARCOUEILLE Jule
......
/*!
*\file TokenSource.hpp
*/
#ifndef TOKENSOURCE_HPP
#define TOKENSOURCE_HPP
#include <string>
#include <iostream>
#ifndef VITE_DEBUG
#include "../message/Errors.hpp"
#else
// For debugging
#include "../../tests/stubs/Errors.hpp"
#endif
#if defined (WIN32) || !defined(_POSIX_MAPPED_FILES) // They do not have mmap
#define BUFFER_SIZE 2048
#define WORD_SIZE 64
#include <fstream>
#else
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#endif
/*!
* \class TokenSource
* \brief supply tokens from a file trace. Tokens are word unit used in PajeFile trace formats.
*/
class TokenSource{
private:
#if defined (WIN32) || !defined(_POSIX_MAPPED_FILES)
char _buffer[BUFFER_SIZE];
#else
char* _buffer;
#endif
std::string _token;
static int _cursor;
bool _is_eof;
#if defined (WIN32) || !defined(_POSIX_MAPPED_FILES)
int _buffer_size;
static std::ifstream _file;
static int _filesize;
#else
int _fd;
static off_t _filesize;
#endif
#if defined (WIN32) || !defined(_POSIX_MAPPED_FILES)
bool fill_buffer();
#endif
bool go_to_next_token();
bool ensure_capacity();
void build_definition_starter();
void build_line_breaks();
void build_composite_token();
void build_simple_token();
public:
/*!
* \fn TokenSource()
* \brief This constructor needs a file to be opened
*/
TokenSource();
/*!
* \fn TokenSource(const char* filename);
* \brief Constructor opening a file
* \param filename the name of the file we want to open.
*/
TokenSource(const char* filename);
/*!
* \fn ~TokenSource
* \brief Destuctor which release the file
*/
~TokenSource();
/*!
* \fn open(const char *filename)
* \brief open a file
* \param filename the name of the file we want to open.
*/
void open(const char *filename);
/*!
* \fn read_token
* \brief supplies a token
* \return a \\0-ended character string (char*), NULL if the file ended, NULL if no file is opened
*/
std::string* read_token();
/*!
* \fn get_size_loaded()
* \brief get the size already parsed.
* \return the scale of the size already parsed. (between 0 and 1)
*/
static float get_size_loaded();
/*!
* \fn reinit_cursor()
* \brief Reinitialise the cursor of the file
*/
static void reinit_cursor();
};
#endif // TOKENSOURCE_HPP
/*!
*\file TokenSource.hpp
*/
#ifndef TOKENSOURCE_HPP
#define TOKENSOURCE_HPP
#include <string>
#include <iostream>
#ifndef VITE_DEBUG
#include "../message/Errors.hpp"
#else
// For debugging
#include "../../tests/stubs/Errors.hpp"
#endif
#if defined (WIN32) || !defined(_POSIX_MAPPED_FILES) // They do not have mmap
/*!
* \def BUFFER_SIZE
* \brief For windows only, default buffer size
*/
#define BUFFER_SIZE 2048
#include <fstream>
#else
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#endif
/*!
* \class TokenSource
* \brief supply tokens from a file trace. Tokens are word unit used in PajeFile trace formats.
*/
class TokenSource{
private:
#if defined (WIN32) || !defined(_POSIX_MAPPED_FILES)
char _buffer[BUFFER_SIZE];
#else
char* _buffer;
#endif
std::string _token;
static int _cursor;
bool _is_eof;
#if defined (WIN32) || !defined(_POSIX_MAPPED_FILES)
int _buffer_size;
static std::ifstream _file;
static int _filesize;
#else
int _fd;
static off_t _filesize;
#endif
#if defined (WIN32) || !defined(_POSIX_MAPPED_FILES)
bool fill_buffer();
#endif
bool go_to_next_token();
bool ensure_capacity();
void build_definition_starter();
void build_line_breaks();
void build_composite_token();
void build_simple_token();
public:
/*!
* \fn TokenSource()
* \brief This constructor needs a file to be opened
*/
TokenSource();
/*!
* \fn TokenSource(const char* filename);
* \brief Constructor opening a file
* \param filename the name of the file we want to open.
*/
TokenSource(const char* filename);
/*!
* \fn ~TokenSource
* \brief Destuctor which release the file
*/
~TokenSource();
/*!
* \fn open(const char *filename)
* \brief open a file
* \param filename the name of the file we want to open.
*/
void open(const char *filename);
/*!
* \fn read_token
* \brief supplies a token
* \return a \\0-ended character string (char*), NULL if the file ended, NULL if no file is opened
*/
std::string* read_token();
/*!
* \fn get_size_loaded()
* \brief get the size already parsed.
* \return the scale of the size already parsed. (between 0 and 1)
*/
static float get_size_loaded();
/*!
* \fn reinit_cursor()
* \brief Reinitialise the cursor of the file
*/
static void reinit_cursor();
};
#endif // TOKENSOURCE_HPP
......@@ -207,10 +207,9 @@ public:
end = this->_setstates.end();
for (it = this->_setstates.begin();
it != end;
it ++, decalage ++)
{
it ++, decalage ++) {
std::string name = (*it)->get_name().to_string();
draw_object->draw_text(pos_x+w+_POS_X_LEGEND_DEFAULT, pos_y, name);
if((*it)->get_extra_fields()->find(std::string("Color")) != (*it)->get_extra_fields()->end())
......@@ -222,7 +221,7 @@ public:
{
draw_object->draw_rect(pos_x, pos_y, w, h, 0.7, 0.7, 0.75);
}
switch(decalage%3) {
case 2:
pos_x += 100;
......@@ -232,7 +231,11 @@ public:
pos_y -= 20;
break;
}
}
}
this->_max_width = pos_x + w + _POS_X_LEGEND_DEFAULT;
set_width(draw_object);
}
};
......
......@@ -74,14 +74,27 @@ class DrawStats {
protected:
/*!
* \brief The containers which we want the statistics
*/
std::vector<Container *> _containers_to_print;
/*!
* \brief The states and their statistics
*/
std::vector<std::map<const EntityValue*, stats*> > _states;
// Interval to compute statistics
double _start_time;
double _end_time;
/*!
* \brief unused for the moment.
* Can be useful to keep the previous stats and so do not compute them one more time, if the interval [_prev_start, _prev_end] belongs to [_new_start, _new_end]
*/
double _previous_start_time;
/*!
* \brief unused for the moment.
*/
double _previous_end_time;
// Geometrical informations about the stats shape.
......@@ -125,7 +138,6 @@ public:
* \fn end_draw(T* draw_object)
* \brief Set the end of the draw.
* \param draw_object the kind of object which will be drawn (OpenGL, SVG...).
* \todo An improvment can be done by keeping the previous stats and if the user wants to have stats with an interval including the previous one.
*/
inline void end_draw(T* draw_object) {
_previous_start_time = _start_time;
......@@ -189,6 +201,15 @@ public:
_height_for_rect_legend = 15.;
_max_width = 0;
}
/*!
* \fn set_width(T* draw_object)
* \brief Set the total width for the draw object
* \param draw_object The kind of object which will be drawn (OpenGL, SVG...).
*/
virtual void set_width(T* draw_object) {
draw_object->set_total_width(this->_max_width);
}
};
#endif
......@@ -212,14 +212,6 @@ public:
return value;
}
/*!
* \fn set_width(T* draw_object)
* \brief Set the total width for the draw object
* \param draw_object The kind of object which will be drawn (OpenGL, SVG...).
*/
virtual void set_width(T* draw_object) {
draw_object->set_total_width(this->_max_width);
}
/*!
* \fn set_geometrical_informations()
......
......@@ -9,7 +9,10 @@ Stats_window::Stats_window(QWidget *parent) : QMainWindow(parent) {
_ui_stats_area = new Render_stats_opengl(this);
_ui_stats_area_layout->addWidget(_ui_stats_area);
_x_translated = 0;
_y_translated = 0;
QMetaObject::connectSlotsByName(NULL);
}
......@@ -262,11 +265,13 @@ void Stats_window::close_window(){
// new_value is between 0 and 99
void Stats_window::on_y_scroll_valueChanged(int new_value) {
_ui_stats_area->translate_y(new_value);
_y_translated = new_value;
}
// new_value is between 0 and 99
void Stats_window::on_x_scroll_valueChanged(int new_value) {
_ui_stats_area->translate_x(new_value);
_x_translated = new_value;
}
......@@ -276,3 +281,53 @@ void Stats_window::Reinit_scroll_bars() {
x_scroll->setSliderPosition(0);
y_scroll->setSliderPosition(0);
}
void Stats_window::keyPressEvent(QKeyEvent *event) {
switch (event->key()) {
case Qt::Key_Left:
// Key 'left' pressed.
if(_x_translated > 0) {
_ui_stats_area->translate_x(--_x_translated);
x_scroll->setSliderPosition(_x_translated);
}
break;
case Qt::Key_Right:
// Key 'right' pressed.
if(_x_translated < 99) {
_ui_stats_area->translate_x(++_x_translated);
x_scroll->setSliderPosition(_x_translated);
}
break;
case Qt::Key_Up:
// Key 'up' pressed.
if(_y_translated > 0) {
_ui_stats_area->translate_y(--_y_translated);
y_scroll->setSliderPosition(_y_translated);
}
break;
case Qt::Key_Down:
// Key 'down' pressed.
if(_y_translated < 99) {
_ui_stats_area->translate_y(++_y_translated);
y_scroll->setSliderPosition(_y_translated);
}
break;
case Qt::Key_PageUp:
// Key 'Page Up' pressed.
_ui_stats_area->translate_y(0);
y_scroll->setSliderPosition(0);
break;
case Qt::Key_PageDown:
// Key 'Page Down' pressed.
_ui_stats_area->translate_y(100);
y_scroll->setSliderPosition(100);
break;
default:
/*
* Unknow key pressed.
*/
break;
}
event->accept();
}
......@@ -64,6 +64,9 @@ class Stats_window : public QMainWindow, protected Ui::stats_viewer {
int _number_of_selected_container;
int _screen_width, _screen_height;
// For the scroll bars
int _x_translated, _y_translated;
public:
/*!
* Default constructor
......@@ -100,6 +103,10 @@ public:
*/
void init_window();
/*!
* \fn Reinit_scroll_bars()
* \brief Reinitialize the scroll bar to their default values (0)
*/
void Reinit_scroll_bars();
/*!
......@@ -117,6 +124,14 @@ private:
*/
void set_selected_nodes(std::string);
/*!
* \brief This functions receives all keyboard events.
* \param event The event triggered by the keyboard event.
*/
void keyPressEvent(QKeyEvent *event);
private slots:
void on_reload_button_clicked();
void on_export_button_clicked();
......
......@@ -17,12 +17,30 @@
class Interval{
public:
Date _left;
Date _right;
Interval();
Interval(Date left, Date right);
/*!
* \var _left
* \brief left value of the interval
*/
Date _left;
/*!
* \var _right
* \brief right value of the interval
*/
Date _right;
/*!
* \fn Interval()
* \brief Default constructor
*/
Interval();
/*!
* \fn Interval(Date left, Date right)
* \brief constructor
* \param left left value of the interval
* \param right right value of the interval
*/
Interval(Date left, Date right);
};
......
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