35 from python_qt_binding.QtCore
import QCoreApplication, QEvent
36 from python_qt_binding.QtCore
import qWarning
42 super(ListenerEvent, self).
__init__(QEvent.User)
49 Waits for new messages loaded on the given topic, then calls the message listener. 50 One thread per listener, topic pair. 54 threading.Thread.__init__(self)
66 Thread body. loops and notifies the listener of new messages 70 cv = self.timeline._messages_cvs[self.
topic]
72 while (self.
topic not in self.timeline._messages)
or (self.
bag_msg_data == self.timeline._messages[self.
topic]):
76 bag_msg_data = self.timeline._messages[self.
topic]
81 QCoreApplication.postEvent(self.
listener, event)
82 except Exception
as ex:
83 qWarning(
'Error notifying listener %s: %s' % (type(self.
listener), str(ex)))
87 cv = self.timeline._messages_cvs[self.
topic]
def __init__(self, timeline, topic, listener)