Commit 4283e26f authored by Johnny Jazeix's avatar Johnny Jazeix

Ajout de la barre d'icone avec les prototypes des fonctions affichées

(pas encore le vrai code) ainsi que l'onglet about (qui sera a modifier 
je parie  ^^)
parent 5d8bafe7
......@@ -151,7 +151,7 @@ void Interface_graphic::information(const string s) const{
*
**********************************/
void Interface_graphic::opening_file(string const &path){
void Interface_graphic::opening_file(const string &path){
information(string("File opened: ")+ path);
......@@ -198,11 +198,24 @@ void Interface_graphic::on_open_triggered(){
if(_is_rendering_trace == true){/* Realease the previous trace */
QStringList arguments = (QStringList() << filename);
QString program = QString(get_current_dir_name())+QString(_core->get_progpath()+sizeof(char));
QProcess * new_process = new QProcess();
char *current_dir = (char *)malloc(_CURRENT_DIR_SIZE*sizeof(char));
QString program = QString();
#ifdef _GNU_SOURCE
current_dir = get_current_dir_name();
#else
#if ((_BSD_SOURCE) || (_XOPEN_SOURCE >= 500))
// for MACOS
char *return_value_of_getcwd = NULL;
return_value_of_getcwd = getcwd(current_dir, _CURRENT_DIR_SIZE);
#endif
#endif
program = QString(QString(current_dir)+QString(_core->get_progpath()+sizeof(char)));
QProcess * new_process = new QProcess();
new_process->startDetached(program, arguments);
free (current_dir);
}
else{
opening_file(filename.toStdString());
......@@ -316,12 +329,33 @@ void Interface_graphic::on_about_triggered(){
"It is licensed under <i>CECILL-A</i>."));*/
QMessageBox::about(this, tr("About ViTE"),
tr("<b>ViTE</b> version 0.3"));
tr("<b>ViTE</b> version 0.3"
"ViTE is under the CeCILL A licence. The content can be found <a href=\"http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt\">here</a>."
"<p><b>Developers :</b><ul><li>Kevin COULOMB</li><li>Johnny JAZEIX</li><li>Olivier LAGRASSE</li><li>Jule MARCOUEILLE</li><li>Pascal NOISETTE</li><li>Arthur REDONDY</li><li>Cl&eacute;ment VUCHENER</li></ul></p>"
"This software was made for a school engineering project for INRIA searchers."
"The page project is : <a href=\"https://gforge.inria.fr/projects/vite/\">https://gforge.inria.fr/projects/vite/</a>."
"<h6>ViTE is for : ViTE isn't True English (not yet approved by the developpers and INRIA ^^)</h6>"));
}
void Interface_graphic::on_zoom_in_triggered(){
cout << "zoom in" << endl;
}
void Interface_graphic::on_zoom_out_triggered(){
cout << "zoom out" << endl;
}
void Interface_graphic::on_goto_start_triggered(){
cout << "goto start" << endl;
}
void Interface_graphic::on_goto_end_triggered(){
cout << "goto end" << endl;
}
void Interface_graphic::on_show_all_trace_triggered(){
cout << "show all trace" << endl;
}
void Interface_graphic::on_scale_state_valueChanged(int new_value){
......
......@@ -197,7 +197,7 @@ public:
* \brief Create a Parser and a DataStructure to display a trace file.
* \arg path The path of the file.
*/
void opening_file(std::string const &path);
void opening_file(const std::string &path);
protected slots:
......@@ -255,6 +255,32 @@ protected slots:
*/
void on_about_triggered();
/*!
*\brief A slot which called when 'zoom_in' in the menu is clicked.
*/
void on_zoom_in_triggered();
/*!
*\brief A slot which called when 'zoom_out' in the menu is clicked.
*/
void on_zoom_out_triggered();
/*!
*\brief A slot which called when 'goto_start' in the menu is clicked.
*/
void on_goto_start_triggered();
/*!
*\brief A slot which called when 'goto_end' in the menu is clicked.
*/
void on_goto_end_triggered();
/*!
*\brief A slot which called when 'show_all_trace' in the menu is clicked.
*/
void on_show_all_trace_triggered();
/*!
* \brief Change the scale of state drawing.
* \param new_value The new scale value.
......@@ -281,6 +307,15 @@ protected slots:
*/
void closeEvent(QCloseEvent *event);
public:
/*!
* \brief The size max (hoped) for the current directory name.
* Used for opening a new window with a new trace.
*/
static const int _CURRENT_DIR_SIZE = 128;
};
#endif
......@@ -155,17 +155,6 @@
<height>26</height>
</rect>
</property>
<widget class="QMenu" name="menuFile" >
<property name="title" >
<string>&amp;File</string>
</property>
<addaction name="open" />
<addaction name="export_file" />
<addaction name="separator" />
<addaction name="close" />
<addaction name="separator" />
<addaction name="quit" />
</widget>
<widget class="QMenu" name="menuHelp" >
<property name="title" >
<string>&amp;Help</string>
......@@ -181,11 +170,25 @@
<addaction name="show_info" />
<addaction name="toolbar_menu" />
<addaction name="separator" />
<addaction name="actionZoomin" />
<addaction name="actionZoomout" />
<addaction name="zoom_in" />
<addaction name="zoom_out" />
<addaction name="show_all_trace" />
<addaction name="goto_start" />
<addaction name="goto_end" />
<addaction name="separator" />
<addaction name="fullscreen" />
</widget>
<widget class="QMenu" name="menuFile" >
<property name="title" >
<string>&amp;File</string>
</property>
<addaction name="open" />
<addaction name="export_file" />
<addaction name="separator" />
<addaction name="close" />
<addaction name="separator" />
<addaction name="quit" />
</widget>
<addaction name="menuFile" />
<addaction name="menuView" />
<addaction name="menuHelp" />
......@@ -215,10 +218,17 @@
<bool>false</bool>
</attribute>
<addaction name="open" />
<addaction name="close" />
<addaction name="export_file" />
<addaction name="separator" />
<addaction name="actionZoomin" />
<addaction name="actionZoomout" />
<addaction name="zoom_in" />
<addaction name="zoom_out" />
<addaction name="goto_start" />
<addaction name="goto_end" />
<addaction name="show_all_trace" />
<addaction name="fullscreen" />
<addaction name="separator" />
<addaction name="help" />
</widget>
<action name="open" >
<property name="icon" >
......@@ -321,7 +331,7 @@
<string>Ctrl+E</string>
</property>
</action>
<action name="actionZoomin" >
<action name="zoom_in" >
<property name="icon" >
<iconset resource="vite.qrc" >
<normaloff>:/icon/icon/zoom_in.png</normaloff>:/icon/icon/zoom_in.png</iconset>
......@@ -333,7 +343,7 @@
<string>+</string>
</property>
</action>
<action name="actionZoomout" >
<action name="zoom_out" >
<property name="icon" >
<iconset resource="vite.qrc" >
<normaloff>:/icon/icon/zoom_out.png</normaloff>:/icon/icon/zoom_out.png</iconset>
......@@ -353,7 +363,43 @@
<bool>true</bool>
</property>
<property name="text" >
<string>Show toolbar</string>
<string>Hide toolbar</string>
</property>
</action>
<action name="goto_end" >
<property name="icon" >
<iconset resource="vite.qrc" >
<normaloff>:/icon/icon/goto_end.png</normaloff>:/icon/icon/goto_end.png</iconset>
</property>
<property name="text" >
<string>Move to end</string>
</property>
<property name="shortcut" >
<string>End</string>
</property>
</action>
<action name="goto_start" >
<property name="icon" >
<iconset resource="vite.qrc" >
<normaloff>:/icon/icon/goto_start.png</normaloff>:/icon/icon/goto_start.png</iconset>
</property>
<property name="text" >
<string>Move to start</string>
</property>
<property name="shortcut" >
<string>Home</string>
</property>
</action>
<action name="show_all_trace" >
<property name="icon" >
<iconset resource="vite.qrc" >
<normaloff>:/icon/icon/print_all.png</normaloff>:/icon/icon/print_all.png</iconset>
</property>
<property name="text" >
<string>Show all</string>
</property>
<property name="shortcut" >
<string>Ctrl+Shift+A</string>
</property>
</action>
</widget>
......
......@@ -2,14 +2,17 @@
<qresource prefix="icon" >
<file>icon/zoom_out.png</file>
<file>icon/zoom_in.png</file>
<file>icon/export_svg.png</file>
<file>icon/about.png</file>
<file>icon/fileclose.png</file>
<file>icon/vite.png</file>
<file>icon/export_svg.png</file>
<file>icon/fullscreen_mode.png</file>
<file>icon/folder_yellow_open.png</file>
<file>icon/help_index.png</file>
<file>icon/quit.png</file>
<file>icon/goto_end.png</file>
<file>icon/goto_start.png</file>
<file>icon/print_all.png</file>
</qresource>
<qresource prefix="img" >
<file>img/logo.png</file>
......
......@@ -58,7 +58,7 @@ public :
/*!
*
*\fn define_container_type(Name alias, ContainerType *container_type_parent, const vector<Value *> &opt)
*\fn define_container_type(Name &alias, ContainerType *container_type_parent, const map<std::string, Value *> &opt)
*\brief This function is to define a container type
*
*\param alias the type of his parent container
......@@ -69,7 +69,7 @@ public :
/*!
*
*\fn create_container(Date time, Name alias, ContainerType *type, Container *parent, const vector<Value *> &opt)
*\fn create_container(Date &time, Name &alias, ContainerType *type, Container *parent, const map<std::string, Value *> &opt)
*\brief This function is to create a container
*
*
......@@ -83,7 +83,7 @@ public :
/*!
*
*\fn destroy_container(Date time, Container *cont, ContainerType *type, const vector<Value *> &opt)
*\fn destroy_container(Date &time, Container *cont, ContainerType *type, const map<std::string, Value *> &opt)
*\brief This function is to destroy a container
*
*\param time When the container is destroyed
......@@ -96,7 +96,7 @@ public :
/*!
*
*\fn define_event_type(Name alias, ContainerType *container_type, const vector<Value *> &opt)
*\fn define_event_type(Name &alias, ContainerType *container_type, const map<std::string, Value *> &opt)
*\brief This function is to define a type of event
*
*\param alias an object that can contain a name, an alias or both
......@@ -108,7 +108,7 @@ public :
/*!
*
*\fn define_state_type(Name alias, ContainerType *container_type, const vector<Value *> &opt)
*\fn define_state_type(Name &alias, ContainerType *container_type, const map<std::string, Value *> &opt)
*\brief This function is to define a type of state
*
*\param alias an object that can contain a name, an alias or both
......@@ -121,7 +121,7 @@ public :
/*!
*
*\fn define_variable_type(Name alias, ContainerType *container_type, const vector<Value *> &opt)
*\fn define_variable_type(Name &alias, ContainerType *container_type, const map<std::string, Value *> &opt)
*\brief This function is to define a type of variable
*
*\param alias an object that can contain a name, an alias or both
......@@ -133,7 +133,7 @@ public :
/*!
*
*\fn define_link_type(Name alias, ContainerType *ancestor, ContainerType *source, ContainerType *destination, const vector<Value *> &opt)
*\fn define_link_type(Name &alias, ContainerType *ancestor, ContainerType *source, ContainerType *destination, const map<std::string, Value *> &opt)
*\brief This function is to define a type of link
*
*\param alias an object that can contain a name, an alias or both
......@@ -147,7 +147,7 @@ public :
/*!
*
*\fn define_entity_value(Name alias, EntityType *entity_type, const vector<Value *> &opt)
*\fn define_entity_value(Name &alias, EntityType *entity_type, const map<std::string, Value *> &opt)
*\brief This function is to define_entity_value
*
*\param alias an object that can contain a name, an alias or both
......@@ -159,7 +159,7 @@ public :
/*!
*
*\fn set_state(Date time, StateType *type, Container *container, EntityValue *value, const vector<Value *> &opt)
*\fn set_state(Date &time, StateType *type, Container *container, EntityValue *value, const map<std::string, Value *> &opt)
*\brief This function is to set a state
*
*\param time Moment when it changes of state
......@@ -173,7 +173,7 @@ public :
/*!
*
*\fn push_state(Date time, StateType *type, Container *container, EntityValue *value, const vector<Value *> &opt)
*\fn push_state(Date &time, StateType *type, Container *container, EntityValue *value, const map<std::string, Value *> &opt)
*\brief This function is to push a state on the stack
*
*\param Date : Moment when the state is pushed
......@@ -187,7 +187,7 @@ public :
/*!
*
*\fn pop_state(Date time, StateType *type, Container *container, const vector<Value *> &opt)
*\fn pop_state(Date &time, StateType *type, Container *container, const map<std::string, Value *> &opt)
*\brief This function is to pop a state from the stack
*
*\param time Moment when the state is popped
......@@ -200,7 +200,7 @@ public :
/*!
*
*\fn new_event(Date time, EventType *type, Container *container, EntityValue *value, const vector<Value *> &opt)
*\fn new_event(Date &time, EventType *type, Container *container, EntityValue *value, const map<std::string, Value *> &opt)
*\brief This function is to create a new event
*
*\param time When the new event arrives
......@@ -214,7 +214,7 @@ public :
/*!
*
*\fn set_variable(Date time, VariableType *type, Container *container, Double value, const vector<Value *> &opt)
*\fn set_variable(Date &time, VariableType *type, Container *container, Double value, const map<std::string, Value *> &opt)
*\brief This function is to set a value to the variable
*
*\param time When the variable is set
......@@ -228,7 +228,7 @@ public :
/*!
*
*\fn add_variable(Date time, VariableType *type, Container *container, Double value, const vector<Value *> &opt)
*\fn add_variable(Date &time, VariableType *type, Container *container, Double value, const map<std::string, Value *> &opt)
*\brief This function is to add a new variable
*
*\param time When th variable is incremented
......@@ -242,7 +242,7 @@ public :
/*!
*
*\fn sub_variable(Date time, VariableType *type, Container *container, Double value, const vector<Value *> &opt)
*\fn sub_variable(Date &time, VariableType *type, Container *container, Double value, const map<std::string, Value *> &opt)
*\brief This function is to substract a value to the variable
*
*\param time When the variable is decremented
......@@ -256,7 +256,7 @@ public :
/*!
*
*\fn start_link(Date time, LinkType *type, Container *ancestor, Container *source, EntityValue *value, Integer key, const vector<Value *> &opt)
*\fn start_link(Date &time, LinkType *type, Container *ancestor, Container *source, EntityValue *value, String key, const map<std::string, Value *> &opt)
*\brief This function is to start a link
*
*\param time When the link starts
......@@ -271,7 +271,7 @@ public :
/*!
*
*\fn end_link(Date time, LinkType *type, Container *ancestor, Container *destination, EntityValue *value, Integer key, const vector<Value *> &opt)
*\fn end_link(Date &time, LinkType *type, Container *ancestor, Container *destination, EntityValue *value, String key, const map<std::string, Value *> &opt)
*\brief This function is to end a link
*
*\param time When the link ends
......
......@@ -57,23 +57,23 @@ double Double::get_value() const{
return _value;
}
Double Double::operator+(const Double &d) {
Double Double::operator+(const Double &d) const {
return Double(_value + d._value);
}
Double Double::operator-() {
Double Double::operator-() const {
return Double(-_value);
}
Double Double::operator-(const Double &d) {
Double Double::operator-(const Double &d) const {
return Double(_value - d._value);
}
bool Double::operator<(const Double &d) {
bool Double::operator<(const Double &d) const {
return _value < d._value;
}
bool Double::operator>(const Double &d) {
bool Double::operator>(const Double &d) const {
return _value > d._value;
}
......@@ -61,11 +61,49 @@ public:
*/
double get_value() const;
Double operator+(const Double &);
Double operator-();
Double operator-(const Double &);
bool operator<(const Double &);
bool operator>(const Double &);
/*!
*
* \fn operator+ (const Double &) const
* \brief Computes the sum between two Doubles
* \return a double which is equal to the sum of the two Doubles.
*
*/
Double operator+(const Double &) const;
/*!
*
* \fn operator- () const
* \return a Double which is equal to the opposite of this Double.
*
*/
Double operator-() const;
/*!
*
* \fn operator- (const Double &) const
* \brief Make the difference between two Doubles
* \return a Double which is equal to the difference of the two values.
*
*/
Double operator-(const Double &) const;
/*!
*
* \fn operator< (const Double &) const
* \brief Compare the date
* \return true if the Double is lower than this.
*
*/
bool operator<(const Double &) const;
/*!
*
* \fn operator> (const Double &) const
* \brief Compare the date
* \return true if the Double is greater than this.
*
*/
bool operator>(const Double &) const;
};
#endif // DOUBLE_HPP
......@@ -31,6 +31,7 @@ class Value {
public:
virtual ~Value(){};
/*!
*
* \fn to_string() const = 0
......@@ -38,9 +39,11 @@ public:
* \return the value in a string format.
*
*/
virtual std::string to_string() const = 0;
/*!
* \brief The precision for printing double with std::cout or printf.
*/
static const int _PRECISION = 15;
};
......
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