Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Simonstrator
PeerfactSim.KOM
Commits
670194fd
Commit
670194fd
authored
Jun 19, 2017
by
Tobias Meuser
Browse files
Added paint offset to display all node properties
parent
b52aae20
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/de/tud/kom/p2psim/impl/topology/movement/VehicleMovementModel.java
View file @
670194fd
...
...
@@ -58,6 +58,8 @@ public class VehicleMovementModel implements MovementModel, EventHandler, Future
public
static
final
double
SCALING_FACTOR
=
1.0
;
private
static
final
double
PAINT_OFFSET
=
25
;
private
long
timeBetweenMoveOperations
;
private
final
List
<
SimLocationActuator
>
components
;
...
...
@@ -289,10 +291,10 @@ public class VehicleMovementModel implements MovementModel, EventHandler, Future
SimLocationActuator
component
=
requestSimActuator
(
vehicle
);
if
(
scenarioHeight
!=
-
1
)
{
component
.
updateCurrentLocation
(
new
PositionVector
(
position
.
getX
()
/
SCALING_FACTOR
,
Math
.
min
(
scenarioHeight
,
height
)
-
position
.
getY
()
/
SCALING_FACTOR
));
component
.
updateCurrentLocation
(
new
PositionVector
(
position
.
getX
()
/
SCALING_FACTOR
+
PAINT_OFFSET
,
Math
.
min
(
scenarioHeight
,
height
)
-
position
.
getY
()
/
SCALING_FACTOR
+
PAINT_OFFSET
));
}
else
{
// This would be vertically mirrored
component
.
updateCurrentLocation
(
new
PositionVector
(
position
.
getX
()
/
SCALING_FACTOR
,
position
.
getY
()
/
SCALING_FACTOR
));
component
.
updateCurrentLocation
(
new
PositionVector
(
position
.
getX
()
/
SCALING_FACTOR
+
PAINT_OFFSET
,
position
.
getY
()
/
SCALING_FACTOR
+
PAINT_OFFSET
));
}
component
.
setMovementSpeed
(
position
.
getSpeed
()
/
SCALING_FACTOR
);
...
...
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