Commit e47b0122 authored by hengwen's avatar hengwen
Browse files

Bugfix

parent 6533d614
package server.errorflags;
import de.rwth.monticore.EmbeddedMontiArc.simulators.commons.simulation.PhysicalObject;
import java.util.ArrayList;
import java.util.List;
......@@ -31,7 +33,9 @@ public class ErrorDeterminatorProcessor {
public boolean[] checkAll(SimFrameInfo info) {
boolean[] result = new boolean[ErrorFlag.values().length];
for (ErrorDeterminator e : determinators) {
result[e.getHandledErrorFlag().ordinal()] = e.check(info);
if (info.getSimulationLoopExecutable() instanceof PhysicalObject){
result[e.getHandledErrorFlag().ordinal()] = e.check(info);
}
}
return result;
}
......
......@@ -151,6 +151,7 @@ public class SimulationControllerImpl extends SimControllerGrpc.SimControllerImp
for (ChargingStation cs: WorldModel.getInstance().getParser().getChargingStations()) {
simulator.registerSimulationObject(cs);
logger.info("Registered charging station" + cs.getName());
}
logger.info("Map set to {}", mapPath);
......
......@@ -87,6 +87,9 @@ public class SimulationObserver extends SimulationLoopNotifiable {
@Override
public void didExecuteLoopForObject(SimulationLoopExecutable simulationLoopExecutable, long l, long l1) {
if (!(simulationLoopExecutable instanceof PhysicalVehicle)){
return;
}
double[] position = ((PhysicalVehicle) simulationLoopExecutable).getPosition().toArray();
String id = String.valueOf((int) ((PhysicalVehicle) simulationLoopExecutable).getId());
......
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