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 from python_qt_binding.QtCore import QSize
00019
00020 from rqt_robot_dashboard.widgets import IconToolButton
00021
00022
00023 class COBRunstops(IconToolButton):
00024 """
00025 Dashboard widget to display Care-O-bot Runstop state.
00026 """
00027 def __init__(self, context):
00028 """
00029 :param context: the plugin context
00030 :type context: qt_gui.plugin.Plugin
00031 """
00032
00033 ok_icon = ['bg-green.svg', 'ic-runstop-off.svg']
00034 button_engaged_icon = ['bg-red.svg', 'ic-runstop-on.svg']
00035 scanner_engaged_icon = ['bg-red.svg', 'ic-wireless-runstop-on.svg']
00036 stale_icon = ['bg-grey.svg', 'ic-runstop-off.svg', 'ol-stale-badge.svg']
00037
00038 icons = [ok_icon, button_engaged_icon, scanner_engaged_icon, stale_icon]
00039 super(COBRunstops, self).__init__('Runstop', icons, icons)
00040 self.setToolTip('Runstop')
00041 self.set_stale()
00042 self.setFixedSize(self._icons[0].actualSize(QSize(50, 30)))
00043
00044 def set_ok(self):
00045 self.update_state(0)
00046
00047 def set_button_stop(self):
00048 self.update_state(1)
00049
00050 def set_scanner_stop(self):
00051 self.update_state(2)
00052
00053 def set_stale(self):
00054 self.update_state(3)