use of org.yamcs.protobuf.Rest.CreateProcessorRequest in project yamcs-studio by yamcs.
the class CreateReplayDialog method toCreateProcessorRequest.
public CreateProcessorRequest toCreateProcessorRequest(ClientInfo ci) {
JsonObject spec = new JsonObject();
spec.addProperty("start", TimeEncoding.fromCalendar(RCPUtils.toCalendar(startDate, startTime)));
String specJson = new Gson().toJson(spec);
CreateProcessorRequest.Builder resultb = CreateProcessorRequest.newBuilder().setName(name.getText()).setType("Archive").setConfig(specJson).addClientId(ci.getId());
return resultb.build();
}
use of org.yamcs.protobuf.Rest.CreateProcessorRequest 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);
});
}
});
}
Aggregations