Search in sources :

Example 1 with ListEventsResponse

use of org.yamcs.protobuf.Rest.ListEventsResponse in project yamcs-studio by yamcs.

the class EventLog method fetchLatestEvents.

private void fetchLatestEvents() {
    String instance = ManagementCatalogue.getCurrentYamcsInstance();
    EventCatalogue.getInstance().fetchLatestEvents(instance).whenComplete((data, exc) -> {
        try {
            ListEventsResponse response = ListEventsResponse.parseFrom(data);
            Display.getDefault().asyncExec(() -> {
                addEvents(response.getEventList());
            });
        } catch (InvalidProtocolBufferException e) {
            log.log(Level.SEVERE, "Failed to decode server message", e);
        }
    });
}
Also used : ListEventsResponse(org.yamcs.protobuf.Rest.ListEventsResponse) InvalidProtocolBufferException(com.google.protobuf.InvalidProtocolBufferException)

Aggregations

InvalidProtocolBufferException (com.google.protobuf.InvalidProtocolBufferException)1 ListEventsResponse (org.yamcs.protobuf.Rest.ListEventsResponse)1