Commit 1d026379 authored by hengwen's avatar hengwen

Bugfix

parent 9d75f220
......@@ -70,23 +70,25 @@ public class SimulationControllerImpl extends SimControllerGrpc.SimControllerImp
*/
public void startSimulation(StartSimulationRequest req, StreamObserver<StartSimulationReply> resp) {
simulationID = req.getSimulationID();
if (simulationID.isEmpty()) {
if (simulationID.isEmpty()){
simulationID = UUID.randomUUID().toString();
}
if (simulator.isRunning()) {
simulator.setSimulationPauseTime(0);
}
if (!this.simulator.isPaused()) {
this.simulator.setSimulationPauseTime(req.getDuration());
this.simulator.startSimulation();
if (!simulator.isRunning()){
simulator.startSimulation();
} else {
this.simulator.continueSimulation(req.getDuration());
if (simulator.isPaused()){
simulator.continueSimulation(req.getDuration());
} else {
simulator.setSimulationPauseTime(0);
}
}
resp.onNext(StartSimulationReply.newBuilder().setSimulationID(simulationID).build());
resp.onCompleted();
}
/**
......
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