Search in sources :

Example 1 with ReplaySpeed

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;
}
Also used : ManagementCatalogue(org.yamcs.studio.core.model.ManagementCatalogue) EditProcessorRequest(org.yamcs.protobuf.Rest.EditProcessorRequest) ProcessorInfo(org.yamcs.protobuf.YamcsManagement.ProcessorInfo) ReplaySpeed(org.yamcs.protobuf.Yamcs.ReplaySpeed)

Aggregations

EditProcessorRequest (org.yamcs.protobuf.Rest.EditProcessorRequest)1 ReplaySpeed (org.yamcs.protobuf.Yamcs.ReplaySpeed)1 ProcessorInfo (org.yamcs.protobuf.YamcsManagement.ProcessorInfo)1 ManagementCatalogue (org.yamcs.studio.core.model.ManagementCatalogue)1