Exemplo n.º 1
0
 def _handle_session_event(self, event):
     event_time = event.time
     if event_time is not None:
         event_time = float(event_time)
     return core_pb2.SessionEvent(node_id=event.node,
                                  event=event.event_type,
                                  name=event.name,
                                  data=event.data,
                                  time=event_time,
                                  session_id=event.session)
Exemplo n.º 2
0
def handle_session_event(event: EventData) -> core_pb2.SessionEvent:
    """
    Handle session event when there is a session event

    :param event: event data
    :return: session event
    """
    event_time = event.time
    if event_time is not None:
        event_time = float(event_time)
    return core_pb2.SessionEvent(
        node_id=event.node,
        event=event.event_type.value,
        name=event.name,
        data=event.data,
        time=event_time,
    )
Exemplo n.º 3
0
def handle_session_event(event):
    """
    Handle session event when there is a session event

    :param core.emulator.data.EventData event: event data
    :return: session event
    :rtype: core.api.grpc.core_pb2.SessionEvent
    """
    event_time = event.time
    if event_time is not None:
        event_time = float(event_time)
    return core_pb2.SessionEvent(
        node_id=event.node,
        event=event.event_type,
        name=event.name,
        data=event.data,
        time=event_time,
    )