Search in sources :

Example 1 with ListCommandInfoResponse

use of org.yamcs.protobuf.Rest.ListCommandInfoResponse 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);
        }
    });
}
Also used : YamcsClient(org.yamcs.studio.core.client.YamcsClient) InvalidProtocolBufferException(com.google.protobuf.InvalidProtocolBufferException) ListCommandInfoResponse(org.yamcs.protobuf.Rest.ListCommandInfoResponse)

Aggregations

InvalidProtocolBufferException (com.google.protobuf.InvalidProtocolBufferException)1 ListCommandInfoResponse (org.yamcs.protobuf.Rest.ListCommandInfoResponse)1 YamcsClient (org.yamcs.studio.core.client.YamcsClient)1