use of org.yamcs.studio.core.model.ManagementCatalogue in project yamcs-studio by yamcs.
the class LeaveReplayHandler method execute.
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
ManagementCatalogue catalogue = ManagementCatalogue.getInstance();
ClientInfo clientInfo = catalogue.getCurrentClientInfo();
EditClientRequest req = EditClientRequest.newBuilder().setProcessor("realtime").build();
catalogue.editClientRequest(clientInfo.getId(), req);
return null;
}
use of org.yamcs.studio.core.model.ManagementCatalogue in project yamcs-studio by yamcs.
the class SwitchProcessorDialog method createDialogArea.
@Override
protected Control createDialogArea(Composite parent) {
Composite area = (Composite) super.createDialogArea(parent);
Composite composite = new Composite(area, SWT.NONE);
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
composite.setLayout(new GridLayout());
Composite tableWrapper = new Composite(composite, SWT.NONE);
TableColumnLayout tcl = new TableColumnLayout();
tableWrapper.setLayoutData(new GridData(GridData.FILL_BOTH));
tableWrapper.setLayout(tcl);
processorsTable = new TableViewer(tableWrapper, SWT.V_SCROLL | SWT.H_SCROLL | SWT.SINGLE | SWT.FULL_SELECTION);
processorsTable.getTable().setHeaderVisible(true);
processorsTable.getTable().setLinesVisible(true);
TableViewerColumn instanceColumn = new TableViewerColumn(processorsTable, SWT.NONE);
instanceColumn.getColumn().setText("Instance");
instanceColumn.setLabelProvider(new ColumnLabelProvider() {
@Override
public String getText(Object element) {
ProcessorInfo info = (ProcessorInfo) element;
return info.getInstance();
}
});
tcl.setColumnData(instanceColumn.getColumn(), new ColumnPixelData(100));
TableViewerColumn nameColumn = new TableViewerColumn(processorsTable, SWT.NONE);
nameColumn.getColumn().setText("Processor");
nameColumn.setLabelProvider(new ColumnLabelProvider() {
@Override
public String getText(Object element) {
ProcessorInfo info = (ProcessorInfo) element;
return info.getName();
}
});
tcl.setColumnData(nameColumn.getColumn(), new ColumnWeightData(100));
TableViewerColumn typeColumn = new TableViewerColumn(processorsTable, SWT.NONE);
typeColumn.getColumn().setText("Type");
typeColumn.setLabelProvider(new ColumnLabelProvider() {
@Override
public String getText(Object element) {
ProcessorInfo info = (ProcessorInfo) element;
return info.getType();
}
});
tcl.setColumnData(typeColumn.getColumn(), new ColumnPixelData(100));
processorsTable.setContentProvider(ArrayContentProvider.getInstance());
processorsTable.getTable().setLayoutData(new GridData(GridData.FILL_BOTH));
processorsTable.setComparator(new ViewerComparator() {
@Override
public int compare(Viewer viewer, Object e1, Object e2) {
if (e1 == null || e2 == null)
return 0;
ProcessorInfo p1 = (ProcessorInfo) e1;
ProcessorInfo p2 = (ProcessorInfo) e2;
int c = p1.getInstance().compareTo(p2.getInstance());
return (c != 0) ? c : p1.getName().compareTo(p2.getName());
}
});
ManagementCatalogue catalogue = ManagementCatalogue.getInstance();
processorsTable.setInput(catalogue.getProcessors());
return composite;
}
use of org.yamcs.studio.core.model.ManagementCatalogue in project yamcs-studio by yamcs.
the class SwitchProcessorHandler method execute.
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
if (HandlerUtil.matchesRadioState(event))
return null;
String radioParameter = event.getParameter(RadioState.PARAMETER_ID);
HandlerUtil.updateRadioState(event.getCommand(), radioParameter);
ManagementCatalogue catalogue = ManagementCatalogue.getInstance();
ProcessorInfo processorInfo = catalogue.getProcessorInfo(radioParameter);
if (processorInfo != null) {
ClientInfo clientInfo = catalogue.getCurrentClientInfo();
EditClientRequest req = EditClientRequest.newBuilder().setProcessor(processorInfo.getName()).build();
catalogue.editClientRequest(clientInfo.getId(), req);
} else {
log.warning("Processor '" + radioParameter + "' not found in catalogue");
}
return null;
}
use of org.yamcs.studio.core.model.ManagementCatalogue in project yamcs-studio by yamcs.
the class YamcsPlugin method start.
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
TimeEncoding.setUp();
yamcsClient = new YamcsClient(getProductString(), true);
yamcsClient.addConnectionListener(new UIConnectionListener());
ManagementCatalogue managementCatalogue = new ManagementCatalogue();
catalogues.put(ManagementCatalogue.class, managementCatalogue);
addYamcsConnectionListener(managementCatalogue);
registerCatalogue(new TimeCatalogue());
registerCatalogue(new ParameterCatalogue());
registerCatalogue(new CommandingCatalogue());
registerCatalogue(new AlarmCatalogue());
registerCatalogue(new EventCatalogue());
registerCatalogue(new LinkCatalogue());
registerCatalogue(new ArchiveCatalogue());
}
use of org.yamcs.studio.core.model.ManagementCatalogue 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