Search in sources :

Example 16 with ManagementCatalogue

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

the class CreateReplayDialog method okPressed.

@Override
protected void okPressed() {
    getButton(IDialogConstants.OK_ID).setEnabled(false);
    ClientInfo ci = ManagementCatalogue.getInstance().getCurrentClientInfo();
    CreateProcessorRequest req = toCreateProcessorRequest(ci);
    ManagementCatalogue catalogue = ManagementCatalogue.getInstance();
    catalogue.createProcessorRequest(ci.getInstance(), req).whenComplete((data, exc) -> {
        if (exc == null) {
            Display.getDefault().asyncExec(() -> {
                CreateReplayDialog.super.okPressed();
            });
        } else {
            log.log(Level.SEVERE, "Could not start replay", exc);
            Display.getDefault().asyncExec(() -> {
                MessageDialog.openError(Display.getCurrent().getActiveShell(), "Could not start replay", exc.getMessage());
                getButton(IDialogConstants.OK_ID).setEnabled(true);
            });
        }
    });
}
Also used : ManagementCatalogue(org.yamcs.studio.core.model.ManagementCatalogue) CreateProcessorRequest(org.yamcs.protobuf.Rest.CreateProcessorRequest) ClientInfo(org.yamcs.protobuf.YamcsManagement.ClientInfo)

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