use of org.yamcs.protobuf.YamcsManagement.ClientInfo 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.protobuf.YamcsManagement.ClientInfo 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.protobuf.YamcsManagement.ClientInfo 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);
});
}
});
}
use of org.yamcs.protobuf.YamcsManagement.ClientInfo in project yamcs-studio by yamcs.
the class ManagementCatalogue method getCurrentYamcsInstance.
// Careful we must support the case where Yamcs itself changes the instance of our client
// TODO maybe remove this and instead just store an instance field in YamcsClient ?
public static String getCurrentYamcsInstance() {
ManagementCatalogue catalogue = getInstance();
if (catalogue == null) {
return null;
}
ClientInfo ci = catalogue.getCurrentClientInfo();
if (ci != null) {
return ci.getInstance();
} else {
// Fallback (initial connection properties
YamcsClient yamcsClient = YamcsPlugin.getYamcsClient();
YamcsConnectionProperties props = yamcsClient.getYamcsConnectionProperties();
return (props != null) ? props.getInstance() : null;
}
}
Aggregations