def _wrap_callback_parse_event(on_data, message): """ Wraps a user callback to parse Events from a WebSocket data message """ pb = yamcs_pb2.Event() message.Unpack(pb) event = Event(pb) on_data(event)
def current_event(self): """ Latest event for this alarm :type: :class:`.Event` """ if self._proto.eventDetail.HasField("currentEvent"): return Event(self._proto.eventDetail.currentEvent) return None
def trigger_event(self): """ Event that originally triggered the alarm :type: :class:`.Event` """ if self._proto.eventDetail.HasField("triggerEvent"): return Event(self._proto.eventDetail.triggerEvent) return None
def most_severe_event(self): """ First event that invoked the highest severity level of this alarm :type: :class:`.Event` """ if self._proto.eventDetail.HasField("mostSevereEvent"): return Event(self._proto.eventDetail.mostSevereEvent) return None
def _wrap_callback_parse_event(on_data, message): """ Wraps a user callback to parse Events from a WebSocket data message """ if message.type == message.DATA: if message.data.type == yamcs_pb2.EVENT: event = Event(getattr(message.data, 'event')) #pylint: disable=protected-access on_data(event)