cob_runstops.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 #
00003 # Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
00004 #
00005 # Licensed under the Apache License, Version 2.0 (the "License");
00006 # you may not use this file except in compliance with the License.
00007 # You may obtain a copy of the License at
00008 #
00009 #   http://www.apache.org/licenses/LICENSE-2.0
00010 #
00011 # Unless required by applicable law or agreed to in writing, software
00012 # distributed under the License is distributed on an "AS IS" BASIS,
00013 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014 # See the License for the specific language governing permissions and
00015 # limitations under the License.
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)


cob_dashboard
Author(s): Alexander Bubeck
autogenerated on Sun Jun 9 2019 20:20:03