Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 import os
00036
00037 from python_qt_binding import loadUi
00038 from python_qt_binding.QtCore import Signal, Slot
00039 from python_qt_binding.QtGui import QWidget
00040 import rospy
00041 import rospkg
00042
00043 from .timeline import Timeline
00044
00045 class TimelinePane(QWidget):
00046 """
00047 This class defines the pane where timeline and its related components
00048 are displayed.
00049 """
00050
00051 sig_update = Signal()
00052
00053 def __init__(self, parent):
00054 """
00055 Because this class is intended to be instantiated via Qt's .ui file,
00056 taking argument other than parent widget is not possible, which is
00057 ported to set_timeline_data method. That said, set_timeline_data must
00058 be called (soon) after an object of this is instantiated.
00059 """
00060 super(TimelinePane, self).__init__()
00061 self._parent = parent
00062 self._timeline = None
00063
00064 rp = rospkg.RosPack()
00065 ui_file = os.path.join(rp.get_path('rqt_robot_monitor'),
00066 'resource',
00067 'timelinepane.ui')
00068 loadUi(ui_file, self)
00069
00070 self._timeline_view.show()
00071
00072 self.sig_update.connect(self._timeline_view.redraw)
00073
00074 def set_timeline(self, timeline, name=None):
00075 assert(self._timeline is None)
00076 self._timeline = timeline
00077
00078 self._timeline_view.set_timeline(timeline, name)
00079
00080
00081 self._pause_button.clicked[bool].connect(self._timeline.set_paused)
00082 self._timeline.pause_changed[bool].connect(
00083 self._pause_button.setChecked)
00084
00085
00086 self._pause_button.setChecked(self._timeline.paused)
00087 self.sig_update.emit()
00088
00089 def redraw(self):
00090 self.sig_update.emit()
rqt_robot_monitor
Author(s): Austin Hendrix, Isaac Saito, Ze'ev Klapow, Kevin Watts, Josh Faust
autogenerated on Fri Aug 28 2015 12:50:48