Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
vite
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
5
Issues
5
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
solverstack
vite
Commits
26de62f2
Commit
26de62f2
authored
Mar 04, 2009
by
Olivier Lagrasse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
liage pour l'exportation (pas encore fonctionnel)
parent
a0b69c33
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
86 additions
and
9 deletions
+86
-9
src/interface/interface_console.cpp
src/interface/interface_console.cpp
+21
-2
src/interface/interface_console.hpp
src/interface/interface_console.hpp
+3
-0
src/interface/interface_graphic.cpp
src/interface/interface_graphic.cpp
+0
-1
src/interface/render_svg.cpp
src/interface/render_svg.cpp
+1
-1
src/interface/render_svg.hpp
src/interface/render_svg.hpp
+60
-5
src/trace/DrawTrace.hpp
src/trace/DrawTrace.hpp
+1
-0
No files found.
src/interface/interface_console.cpp
View file @
26de62f2
...
...
@@ -94,6 +94,21 @@ bool Interface_console::draw_trace(const string & filename, Render_area* render_
bool
Interface_console
::
draw_trace
(
const
string
&
filename
,
Svg
*
svg
){
Trace
trace
;
ParserPaje
parser
;
DrawTrace
<
Svg
>
drawing
;
parser
.
parse
(
filename
,
trace
);
drawing
.
build
(
svg
,
&
trace
);
return
true
;
}
int
Interface_console
::
run
(){
return
app
->
exec
();
...
...
@@ -232,9 +247,13 @@ void Interface_console::launch_action(int state){
case
_STATE_EXPORT_FILE
:
cout
<<
"export of "
<<
_file_opened
<<
" to "
<<
_path_to_export
<<
endl
;
message
<<
"export of "
<<
_file_opened
<<
" to "
<<
_path_to_export
<<
endi
;
///// Do the export /////
{
Svg
svg
;
svg
.
init
(
_path_to_export
);
draw_trace
(
_file_opened
,
&
svg
);
}
/////////////////////////
exit
(
EXIT_SUCCESS
);
break
;
...
...
src/interface/interface_console.hpp
View file @
26de62f2
...
...
@@ -12,6 +12,7 @@ class Interface_console;
#include "interface.hpp"
#include "interface_graphic.hpp"
#include "render_area.hpp"
#include "render_svg.hpp"
#include "../trace/Trace.hpp"
#include "../trace/DrawTrace.hpp"
...
...
@@ -187,6 +188,8 @@ protected:
*/
bool
draw_trace
(
const
std
::
string
&
filename
,
Render_area
*
render_area
);
bool
draw_trace
(
const
std
::
string
&
filename
,
Svg
*
svg
);
/*!
* \brief This function launch Qt event loop.
...
...
src/interface/interface_graphic.cpp
View file @
26de62f2
...
...
@@ -81,7 +81,6 @@ void Interface_graphic::load_windows(){
/* Set some windows properties */
_ui_info_window
->
setWindowOpacity
(
0.7
);
/* Change alpha value of the informative window */
_ui_info_window
->
setWindowFlags
(
_ui_info_window
->
windowFlags
()
|
Qt
::
WindowStaysOnTopHint
);
/* Always display info_window on top */
/* Load widget from the .ui file */
...
...
src/interface/render_svg.cpp
View file @
26de62f2
...
...
@@ -83,6 +83,6 @@ void Svg::draw_arrow(const Element_pos start_time, const Element_pos end_time, c
triangle
(
end_time
,
end_height
+
ARROWSIZE
,
end_time
,
end_height
-
ARROWSIZE
,
end_time
+
ARROWSIZE
,
end_height
);
//spike
}
void
Svg
::
draw_state
(
const
Element_pos
start
,
const
Element_pos
end
,
const
Element_
count
level
,
const
Element_col
r
,
const
Element_col
g
,
const
Element_col
b
){
void
Svg
::
draw_state
(
const
Element_pos
start
,
const
Element_pos
end
,
const
Element_
pos
level
,
const
Element_pos
height
,
const
Element_col
r
,
const
Element_col
g
,
const
Element_col
b
){
rectangle
(
end
-
start
,
LEVEL
-
MARGIN
,
start
,
level
*
LEVEL
,
r
,
g
,
b
);
}
src/interface/render_svg.hpp
View file @
26de62f2
...
...
@@ -11,12 +11,17 @@
#define MARGIN 10 //distance between two object
#define ARROWSIZE 4 //spike size
typedef
unsigned
long
Element_count
;
typedef
unsigned
long
Element_pos
;
typedef
unsigned
char
Element_col
;
#include "render.hpp"
#include "resource.hpp"
/*typedef unsigned long Element_count ;
typedef double Element_pos;
typedef unsigned char Element_col;
*/
class
Svg
{
class
Svg
:
public
Render
{
private:
...
...
@@ -37,6 +42,8 @@ public:
*/
void
end
();
void
start_draw
();
void
start_draw_containers
();
/*!
* \brief Draw a container according to the parameters
...
...
@@ -47,6 +54,11 @@ public:
*/
void
draw_container
(
const
Element_pos
x
,
const
Element_pos
y
,
const
Element_pos
w
,
const
Element_pos
h
)
;
void
draw_container_text
(
const
Element_pos
x
,
const
Element_pos
y
,
const
std
::
string
value
);
void
end_draw_containers
();
void
start_draw_states
();
/*!
* \brief Draw a state of the trace.
* \param r the red color rate of the state.
...
...
@@ -56,7 +68,7 @@ public:
* \param end the ending time of the state.
* \param level refer to the container which state belongs to.
*/
void
draw_state
(
const
Element_pos
start
,
const
Element_pos
end
,
const
Element_
count
level
,
const
Element_col
r
,
const
Element_col
g
,
const
Element_col
b
)
;
void
draw_state
(
const
Element_pos
start
,
const
Element_pos
end
,
const
Element_
pos
level
,
const
Element_pos
height
,
const
Element_col
r
,
const
Element_col
g
,
const
Element_col
b
)
;
/*!
* \brief Draw an arrow
...
...
@@ -64,6 +76,49 @@ public:
*/
void
draw_arrow
(
const
Element_pos
start_time
,
const
Element_pos
end_time
,
const
Element_pos
start_height
,
const
Element_pos
end_height
);
void
end_draw_states
();
void
draw_event
(
const
Element_pos
time
,
const
Element_pos
height
,
const
Element_pos
container_height
);
void
end_draw
();
};
/***********************************
*
*
*
* Drawing function for the trace.
*
*
*
**********************************/
inline
void
Svg
::
start_draw
(){
}
inline
void
Svg
::
draw_container_text
(
const
Element_pos
x
,
const
Element_pos
y
,
const
std
::
string
value
){
}
inline
void
Svg
::
start_draw_containers
(){
}
inline
void
Svg
::
end_draw_containers
(){
}
inline
void
Svg
::
start_draw_states
(){
}
inline
void
Svg
::
end_draw_states
(){
}
inline
void
Svg
::
draw_event
(
const
Element_pos
time
,
const
Element_pos
height
,
const
Element_pos
container_height
){
}
inline
void
Svg
::
end_draw
(){
}
#endif // RENDER_SVG
src/trace/DrawTrace.hpp
View file @
26de62f2
...
...
@@ -8,6 +8,7 @@
#include "resource.hpp"
#include "../interface/render_area.hpp"
#include "../interface/render_svg.hpp"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment