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
d847a6b7
Commit
d847a6b7
authored
Jun 24, 2014
by
Thibault Soucarre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change position calculation in browse_entities
parent
55bc0034
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
17 deletions
+18
-17
src/render/GanttDiagram.hpp
src/render/GanttDiagram.hpp
+1
-1
src/trace/DrawTrace.hpp
src/trace/DrawTrace.hpp
+11
-10
src/trace/DrawTree.hpp
src/trace/DrawTree.hpp
+6
-6
No files found.
src/render/GanttDiagram.hpp
View file @
d847a6b7
...
...
@@ -228,7 +228,7 @@ public:
trace_to_render_y
(
_containers
[
i
].
y
),
// * _y_state_scale*(_render_height-_ruler_height)/Info::Container::y_max) - _y_state_translate + _ruler_y + _ruler_height,
_z_container
,
_containers
[
i
].
w
*
(
Info
::
Render
::
width
/
Info
::
Container
::
x_max
)
*
_x_scale_container_state
,
_containers
[
i
].
h
*
_y_state_scale
*
(
Info
::
Render
::
height
-
_ruler_height
)
/
Info
::
Container
::
y_max
);
_containers
[
i
].
h
*
_y_state_scale
*
(
Info
::
Render
::
height
-
_ruler_height
)
/
Info
::
Container
::
y_max
);
}
// std::cout << __FILE__ << " ~ " << __LINE__ << " " << Info::Container::y_max << " " << Info::Container::y_min << std::endl;
...
...
src/trace/DrawTrace.hpp
View file @
d847a6b7
...
...
@@ -332,15 +332,17 @@ public:
_entity_containers
.
push_back
(
container
);
}
// Store the position to draw links
_container_positions
[
container
]
=
y
/
(
_container_height
+
_container_v_space
)
/*+ 7 * _container_v_space*/
;
//position; // First line after children
_container_sizes
[
container
]
=
h
/
(
_container_height
+
_container_v_space
);
//size; // First line after children
// Use one line for each variable
if
(
container
->
get_variable_number
()
>
0
)
{
_variable_containers
.
push_back
(
container
);
h
+=
(
_container_height
+
_container_v_space
)
*
container
->
get_variable_number
();
}
// Store the position to draw links
_container_positions
[
container
]
=
y
;
_container_sizes
[
container
]
=
h
;
h
-=
_container_v_space
;
if
(
h
<
_container_height
)
// Minimum size
...
...
@@ -379,7 +381,6 @@ public:
template
<
class
T
>
inline
void
browse_entities
(
T
*
draw_object
,
double
zoom
,
Interval
*
interval
,
std
::
vector
<
const
Container
*>
*
set_container
)
{
//////////////////////////////////////////////////////////
std
::
cout
<<
"browse entities"
<<
std
::
endl
;
const
Container
*
container
;
StateChange
::
Tree
*
state_tree
;
Event
::
Tree
*
event_tree
;
...
...
@@ -388,7 +389,7 @@ public:
const
std
::
map
<
VariableType
*
,
Variable
*>
*
variable_map
;
Variable
*
var
;
const
std
::
list
<
std
::
pair
<
Date
,
Double
>
>
*
variable_values
;
int
position
;
Element_pos
position
;
const
Color
*
color
;
std
::
map
<
std
::
string
,
Value
*>::
const_iterator
field
;
Element_pos
lvl_zoom
;
...
...
@@ -408,7 +409,7 @@ public:
if
(
is_in_set
(
*
c
,
set_container
)){
container
=
*
c
;
position
=
(
int
)
_container_positions
[
container
]
+
_container_sizes
[
container
]
-
1
;
position
=
_container_positions
[
container
]
+
_container_sizes
[
container
]
-
(
_container_height
+
_container_v_space
)
;
state_tree
=
container
->
get_states
();
event_tree
=
container
->
get_events
();
...
...
@@ -511,7 +512,7 @@ public:
if
(
is_in_set
(
*
c
,
set_container
)){
container
=
*
c
;
position
=
(
int
)
_container_positions
[
container
]
+
_container_sizes
[
container
];
position
=
_container_positions
[
container
]
+
_container_sizes
[
container
];
// Browse variables
variable_map
=
container
->
get_variables
();
...
...
@@ -563,7 +564,7 @@ public:
*/
template
<
class
T
>
inline
void
draw_variable_value
(
T
*
draw_object
,
double
time
,
double
value
,
int
position
)
{
Element_pos
y
=
(
position
+
1
)
*
(
_container_height
+
_container_v_space
)
-
_container_v_space
/
2
-
Element_pos
y
=
position
+
(
_container_height
+
_container_v_space
)
-
_container_v_space
/
2
-
value
*
_container_height
;
draw_object
->
draw_counter
(
time
,
y
);
}
...
...
@@ -587,8 +588,8 @@ public:
double
srcsize
=
_container_sizes
[
link
->
get_source
()];
double
dstsize
=
_container_sizes
[
link
->
get_destination
()];
Element_pos
y1
=
(
srcpos
+
0.5
*
srcsize
)
*
(
_container_height
+
_container_v_space
);
Element_pos
y2
=
(
dstpos
+
0.5
*
dstsize
)
*
(
_container_height
+
_container_v_space
);
Element_pos
y1
=
(
srcpos
+
0.5
*
srcsize
)
;
//
*(_container_height+_container_v_space);
Element_pos
y2
=
(
dstpos
+
0.5
*
dstsize
)
;
//
*(_container_height+_container_v_space);
if
(
color
!=
NULL
)
draw_object
->
draw_arrow
(
starttime
,
endtime
,
y1
,
y2
,
color
->
get_red
(),
color
->
get_green
(),
color
->
get_blue
());
...
...
src/trace/DrawTree.hpp
View file @
d847a6b7
...
...
@@ -67,9 +67,9 @@ template <typename E> class BinaryTree;
template
<
class
D
,
class
E
>
class
DrawTree
{
private:
D
*
_draw_object
;
int
_position
;
double
_min_size
;
D
*
_draw_object
;
Element_pos
_position
;
double
_min_size
;
Element_pos
_container_height
;
Element_pos
_container_v_space
;
...
...
@@ -81,7 +81,7 @@ public:
/*!
*\brief Default constructor
*/
DrawTree
(
D
*
draw_object
,
int
position
,
double
min_size
,
DrawTree
(
D
*
draw_object
,
Element_pos
position
,
double
min_size
,
Element_pos
container_height
,
Element_pos
container_v_space
,
Element_pos
state_height
,
Element_pos
state_v_space
)
:
_draw_object
(
draw_object
),
_position
(
position
),
_min_size
(
min_size
),
...
...
@@ -120,7 +120,7 @@ public:
* \param b Blue value of the state color
*/
inline
void
draw_state
(
double
starttime
,
double
endtime
,
double
r
,
double
g
,
double
b
)
{
Element_pos
y
=
_position
*
(
_container_height
+
_container_v_space
)
+
_container_v_space
/
2
;
Element_pos
y
=
_position
+
_container_v_space
/
2
;
_draw_object
->
draw_state
(
starttime
,
endtime
,
y
,
_state_height
,
r
,
g
,
b
);
}
...
...
@@ -133,7 +133,7 @@ public:
* \param b The blue component of the color
*/
inline
void
draw_event
(
double
time
,
double
r
,
double
g
,
double
b
)
{
Element_pos
y
=
_position
*
(
_container_height
+
_container_v_space
)
+
_container_v_space
/
2
;
Element_pos
y
=
_position
+
_container_v_space
/
2
;
_draw_object
->
draw_event
(
time
,
y
,
_state_height
,
r
,
g
,
b
);
}
...
...
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