Search in sources :

Example 1 with ManagementCatalogue

use of org.yamcs.studio.core.model.ManagementCatalogue in project yamcs-studio by yamcs.

the class YamcsPlugin method registerCatalogue.

private <T extends Catalogue> void registerCatalogue(T catalogue) {
    catalogues.put(catalogue.getClass(), catalogue);
    ManagementCatalogue managementCatalogue = getCatalogue(ManagementCatalogue.class);
    managementCatalogue.addInstanceListener(catalogue);
    addYamcsConnectionListener(catalogue);
}
Also used : ManagementCatalogue(org.yamcs.studio.core.model.ManagementCatalogue)

Example 2 with ManagementCatalogue

use of org.yamcs.studio.core.model.ManagementCatalogue in project yamcs-studio by yamcs.

the class YamcsUIPlugin method updateGlobalProcessingState.

private void updateGlobalProcessingState(ClientInfo clientInfo) {
    // TODO Not sure which one of this method or the previous would trigger first, and whether that's deterministic
    // therefore, just have similar logic here.
    IWorkbench workbench = PlatformUI.getWorkbench();
    workbench.getDisplay().asyncExec(() -> {
        if (clientInfo.getCurrentClient()) {
            ManagementCatalogue catalogue = ManagementCatalogue.getInstance();
            ProcessorInfo processorInfo = catalogue.getProcessorInfo(clientInfo.getProcessorName());
            doUpdateGlobalProcessingState(workbench, processorInfo);
        }
    });
}
Also used : IWorkbench(org.eclipse.ui.IWorkbench) ManagementCatalogue(org.yamcs.studio.core.model.ManagementCatalogue) ProcessorInfo(org.yamcs.protobuf.YamcsManagement.ProcessorInfo)

Example 3 with ManagementCatalogue

use of org.yamcs.studio.core.model.ManagementCatalogue 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 4 with ManagementCatalogue

use of org.yamcs.studio.core.model.ManagementCatalogue 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 5 with ManagementCatalogue

use of org.yamcs.studio.core.model.ManagementCatalogue 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)

Aggregations

ManagementCatalogue (org.yamcs.studio.core.model.ManagementCatalogue)16 ProcessorInfo (org.yamcs.protobuf.YamcsManagement.ProcessorInfo)10 EditProcessorRequest (org.yamcs.protobuf.Rest.EditProcessorRequest)4 ClientInfo (org.yamcs.protobuf.YamcsManagement.ClientInfo)4 Shell (org.eclipse.swt.widgets.Shell)3 EditClientRequest (org.yamcs.protobuf.Rest.EditClientRequest)3 InvalidProtocolBufferException (com.google.protobuf.InvalidProtocolBufferException)1 TableColumnLayout (org.eclipse.jface.layout.TableColumnLayout)1 ColumnLabelProvider (org.eclipse.jface.viewers.ColumnLabelProvider)1 ColumnPixelData (org.eclipse.jface.viewers.ColumnPixelData)1 ColumnWeightData (org.eclipse.jface.viewers.ColumnWeightData)1 TableViewer (org.eclipse.jface.viewers.TableViewer)1 TableViewerColumn (org.eclipse.jface.viewers.TableViewerColumn)1 Viewer (org.eclipse.jface.viewers.Viewer)1 ViewerComparator (org.eclipse.jface.viewers.ViewerComparator)1 GridData (org.eclipse.swt.layout.GridData)1 GridLayout (org.eclipse.swt.layout.GridLayout)1 Composite (org.eclipse.swt.widgets.Composite)1 Display (org.eclipse.swt.widgets.Display)1 IWorkbench (org.eclipse.ui.IWorkbench)1