Search in sources :

Example 1 with CommandQueueEvent

use of org.yamcs.protobuf.Commanding.CommandQueueEvent in project yamcs-studio by yamcs.

the class CommandingCatalogue method onMessage.

@Override
public void onMessage(WebSocketSubscriptionData msg) {
    if (msg.hasCommand()) {
        CommandHistoryEntry cmdhistEntry = msg.getCommand();
        cmdhistListeners.forEach(l -> l.processCommandHistoryEntry(cmdhistEntry));
    }
    if (msg.hasCommandQueueEvent()) {
        CommandQueueEvent queueEvent = msg.getCommandQueueEvent();
        switch(queueEvent.getType()) {
            case COMMAND_ADDED:
                queueListeners.forEach(l -> l.commandAdded(queueEvent.getData()));
                break;
            case COMMAND_REJECTED:
                queueListeners.forEach(l -> l.commandRejected(queueEvent.getData()));
                break;
            case COMMAND_SENT:
                queueListeners.forEach(l -> l.commandSent(queueEvent.getData()));
                break;
            default:
                log.log(Level.SEVERE, "Unsupported queue event type " + queueEvent.getType());
        }
    }
    if (msg.hasCommandQueueInfo()) {
        CommandQueueInfo queueInfo = msg.getCommandQueueInfo();
        queuesByName.put(queueInfo.getName(), queueInfo);
        queueListeners.forEach(l -> l.updateQueue(queueInfo));
    }
}
Also used : CommandHistoryEntry(org.yamcs.protobuf.Commanding.CommandHistoryEntry) CommandQueueEvent(org.yamcs.protobuf.Commanding.CommandQueueEvent) CommandQueueInfo(org.yamcs.protobuf.Commanding.CommandQueueInfo)

Aggregations

CommandHistoryEntry (org.yamcs.protobuf.Commanding.CommandHistoryEntry)1 CommandQueueEvent (org.yamcs.protobuf.Commanding.CommandQueueEvent)1 CommandQueueInfo (org.yamcs.protobuf.Commanding.CommandQueueInfo)1