Search in sources :

Example 1 with EditProcessorRequest

use of org.yamcs.protobuf.Rest.EditProcessorRequest 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)

Example 2 with EditProcessorRequest

use of org.yamcs.protobuf.Rest.EditProcessorRequest in project yamcs-studio by yamcs.

the class PauseHandler method execute.

@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
    ManagementCatalogue catalogue = ManagementCatalogue.getInstance();
    ProcessorInfo processorInfo = catalogue.getCurrentProcessorInfo();
    EditProcessorRequest req = EditProcessorRequest.newBuilder().setState("PAUSED").build();
    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)

Example 3 with EditProcessorRequest

use of org.yamcs.protobuf.Rest.EditProcessorRequest in project yamcs-studio by yamcs.

the class PlayHandler method execute.

@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
    ManagementCatalogue catalogue = ManagementCatalogue.getInstance();
    ProcessorInfo processorInfo = catalogue.getCurrentProcessorInfo();
    EditProcessorRequest req = EditProcessorRequest.newBuilder().setState("RUNNING").build();
    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)

Example 4 with EditProcessorRequest

use of org.yamcs.protobuf.Rest.EditProcessorRequest in project yamcs-studio by yamcs.

the class ArchivePanel method seekReplay.

public void seekReplay(long newPosition) {
    if (newPosition == TimeEncoding.INVALID_INSTANT)
        return;
    Display.getDefault().asyncExec(() -> {
        ProcessorInfo processor = ManagementCatalogue.getInstance().getCurrentProcessorInfo();
        if (processor == null || processor.getName().equals("realtime"))
            return;
        String seekTime = TimeEncoding.toString(newPosition);
        EditProcessorRequest req = EditProcessorRequest.newBuilder().setSeek(seekTime).build();
        ManagementCatalogue catalogue = ManagementCatalogue.getInstance();
        catalogue.editProcessorRequest(processor.getInstance(), processor.getName(), req);
    });
}
Also used : ManagementCatalogue(org.yamcs.studio.core.model.ManagementCatalogue) EditProcessorRequest(org.yamcs.protobuf.Rest.EditProcessorRequest) ProcessorInfo(org.yamcs.protobuf.YamcsManagement.ProcessorInfo)

Aggregations

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