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
f92bfcd0
Commit
f92bfcd0
authored
Apr 26, 2019
by
Julian Zobel
Browse files
State switches in topology component now tracked with analyzer
parent
615845e5
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/de/tud/kom/p2psim/impl/topology/component/UAVStatisticAnalyzer.java
View file @
f92bfcd0
...
...
@@ -20,6 +20,11 @@
package
de.tud.kom.p2psim.impl.topology.component
;
public
interface
UAVStatistic
Analyzer
{
import
de.tudarmstadt.maki.simonstrator.api.component.core.MonitorComponent.
Analyzer
;
public
interface
UAVStatisticAnalyzer
extends
Analyzer
{
public
void
uavSwitchedStates
(
UAVTopologyComponent
uav
,
UAVTopologyComponent
.
UAVstate
newState
);
}
src/de/tud/kom/p2psim/impl/topology/component/UAVTopologyComponent.java
View file @
f92bfcd0
...
...
@@ -36,11 +36,11 @@ import de.tud.kom.p2psim.impl.energy.components.StatelessMotorComponent;
import
de.tud.kom.p2psim.impl.energy.models.AbstractEnergyModel
;
import
de.tud.kom.p2psim.impl.topology.placement.UAVBasePlacement
;
import
de.tud.kom.p2psim.impl.topology.util.PositionVector
;
import
de.tudarmstadt.maki.simonstrator.api.Monitor
;
import
de.tudarmstadt.maki.simonstrator.api.component.ComponentNotAvailableException
;
import
de.tudarmstadt.maki.simonstrator.api.component.overlay.OverlayComponent
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.location.AttractionPoint
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.location.Location
;
import
de.tudarmstadt.maki.simonstrator.api.uavsupport.callbacks.BaseConnectedCallback
;
import
de.tudarmstadt.maki.simonstrator.api.uavsupport.callbacks.BaseDisconnectedCallback
;
import
de.tudarmstadt.maki.simonstrator.api.uavsupport.callbacks.BatteryReplacementCallback
;
...
...
@@ -110,8 +110,10 @@ public class UAVTopologyComponent extends AbstractTopologyComponent implements S
public
void
setState
(
UAVstate
newState
)
{
this
.
state
=
newState
;
// TODO analyzer
if
(
Monitor
.
hasAnalyzer
(
UAVStatisticAnalyzer
.
class
))
{
Monitor
.
getOrNull
(
UAVStatisticAnalyzer
.
class
).
uavSwitchedStates
(
this
,
newState
);
}
}
public
void
setUAVComponent
(
OverlayComponent
uavOverlayComponent
)
{
...
...
@@ -275,6 +277,7 @@ public class UAVTopologyComponent extends AbstractTopologyComponent implements S
}
};
movement
.
setPreferredSpeed
(
movement
.
horizontalMaxVelocity
());
movement
.
setTargetLocation
(
baseLocation
,
returnCallback
);
}
...
...
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