use of org.yamcs.protobuf.Rest.EditClientRequest in project yamcs-studio by yamcs.
the class ChooseProcessorDialogHandler method execute.
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
Shell shell = HandlerUtil.getActiveShellChecked(event);
SwitchProcessorDialog dialog = new SwitchProcessorDialog(shell);
if (dialog.open() == Window.OK) {
ProcessorInfo info = dialog.getProcessorInfo();
if (info != null) {
ManagementCatalogue catalogue = ManagementCatalogue.getInstance();
int currentClientId = catalogue.getCurrentClientInfo().getId();
EditClientRequest req = EditClientRequest.newBuilder().setInstance(info.getInstance()).setProcessor(info.getName()).build();
// Internal state will be changed automatically within
// the ManagementCatalogue.
catalogue.editClientRequest(currentClientId, req);
}
}
return null;
}
use of org.yamcs.protobuf.Rest.EditClientRequest 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.Rest.EditClientRequest 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;
}
Aggregations