Commit f92bfcd0 authored by Julian Zobel's avatar Julian Zobel
Browse files

State switches in topology component now tracked with analyzer

parent 615845e5
......@@ -20,6 +20,11 @@
package de.tud.kom.p2psim.impl.topology.component;
public interface UAVStatisticAnalyzer {
import de.tudarmstadt.maki.simonstrator.api.component.core.MonitorComponent.Analyzer;
public interface UAVStatisticAnalyzer extends Analyzer {
public void uavSwitchedStates(UAVTopologyComponent uav, UAVTopologyComponent.UAVstate newState);
}
......@@ -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);
}
......
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