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;
}
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;
}
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;
}
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);
});
}
Aggregations