use of org.yamcs.studio.core.client.YamcsClient in project yamcs-studio by yamcs.
the class CommandingCatalogue method initialiseState.
private void initialiseState() {
log.fine("Fetching available commands");
YamcsClient restClient = YamcsPlugin.getYamcsClient();
String instance = ManagementCatalogue.getCurrentYamcsInstance();
restClient.get("/mdb/" + instance + "/commands", null).whenComplete((data, exc) -> {
try {
ListCommandInfoResponse response = ListCommandInfoResponse.parseFrom(data);
processMetaCommands(response.getCommandList());
} catch (InvalidProtocolBufferException e) {
log.log(Level.SEVERE, "Failed to decode server response", e);
}
});
}
use of org.yamcs.studio.core.client.YamcsClient in project yamcs-studio by yamcs.
the class EventCatalogue method downloadEvents.
/**
* Downloads a batch of events in the specified time range. These events are not distributed to registered
* listeners, but only to the provided listener.
*/
public CompletableFuture<Void> downloadEvents(long start, long stop, BulkEventListener listener) {
String instance = ManagementCatalogue.getCurrentYamcsInstance();
String resource = "/archive/" + instance + "/downloads/events";
if (start != TimeEncoding.INVALID_INSTANT) {
resource += "?start=" + start;
if (stop != TimeEncoding.INVALID_INSTANT) {
resource += "&stop=" + stop;
}
} else if (stop != TimeEncoding.INVALID_INSTANT) {
resource += "?stop=" + stop;
}
YamcsClient yamcsClient = YamcsPlugin.getYamcsClient();
EventBatchGenerator batchGenerator = new EventBatchGenerator(listener);
return yamcsClient.streamGet(resource, null, batchGenerator).whenComplete((data, exc) -> {
if (!batchGenerator.events.isEmpty()) {
listener.processEvents(new ArrayList<>(batchGenerator.events));
}
});
}
use of org.yamcs.studio.core.client.YamcsClient in project yamcs-studio by yamcs.
the class LinkCatalogue method enableLink.
public CompletableFuture<byte[]> enableLink(String instance, String name) {
YamcsClient yamcsClient = YamcsPlugin.getYamcsClient();
EditLinkRequest req = EditLinkRequest.newBuilder().setState("enabled").build();
return yamcsClient.patch("/links/" + instance + "/" + name, req);
}
use of org.yamcs.studio.core.client.YamcsClient in project yamcs-studio by yamcs.
the class ManagementCatalogue method onYamcsConnected.
@Override
public void onYamcsConnected() {
YamcsClient yamcsClient = YamcsPlugin.getYamcsClient();
yamcsClient.subscribe(new WebSocketRequest("management", "subscribe"), this);
}
use of org.yamcs.studio.core.client.YamcsClient in project yamcs-studio by yamcs.
the class ParameterCatalogue method requestParameterDetail.
public CompletableFuture<byte[]> requestParameterDetail(String qualifiedName) {
YamcsClient yamcsClient = YamcsPlugin.getYamcsClient();
String instance = ManagementCatalogue.getCurrentYamcsInstance();
return yamcsClient.get("/mdb/" + instance + "/parameters" + qualifiedName, null);
}
Aggregations