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));
}
}
Aggregations