Пример #1
0
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)
Пример #2
0
    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
Пример #3
0
    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
Пример #4
0
    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
Пример #5
0
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)