use of org.yamcs.protobuf.Yamcs.ReplaySpeed in project yamcs-studio by yamcs.
the class ForwardHandler method execute.
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
ProcessorInfo processorInfo = ManagementCatalogue.getInstance().getCurrentProcessorInfo();
String newSpeed;
if (processorInfo.getReplayRequest().hasSpeed()) {
ReplaySpeed currentSpeed = processorInfo.getReplayRequest().getSpeed();
float speedValue = currentSpeed.getParam() * 2f;
if (speedValue > 17)
speedValue = 1.0f;
newSpeed = (speedValue == 0f ? 1f : speedValue) + "x";
} else {
newSpeed = "2x";
}
EditProcessorRequest req = EditProcessorRequest.newBuilder().setSpeed(newSpeed).build();
ManagementCatalogue catalogue = ManagementCatalogue.getInstance();
catalogue.editProcessorRequest(processorInfo.getInstance(), processorInfo.getName(), req);
return null;
}
Aggregations