cob_runstops.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 #
3 # Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
4 #
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 # http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 
17 
18 from python_qt_binding.QtCore import QSize
19 
20 from rqt_robot_dashboard.widgets import IconToolButton
21 
22 
23 class COBRunstops(IconToolButton):
24  """
25  Dashboard widget to display Care-O-bot Runstop state.
26  """
27  def __init__(self, context):
28  """
29  :param context: the plugin context
30  :type context: qt_gui.plugin.Plugin
31  """
32 
33  ok_icon = ['bg-green.svg', 'ic-runstop-off.svg']
34  button_engaged_icon = ['bg-red.svg', 'ic-runstop-on.svg']
35  scanner_engaged_icon = ['bg-red.svg', 'ic-wireless-runstop-on.svg']
36  stale_icon = ['bg-grey.svg', 'ic-runstop-off.svg', 'ol-stale-badge.svg']
37 
38  icons = [ok_icon, button_engaged_icon, scanner_engaged_icon, stale_icon]
39  super(COBRunstops, self).__init__('Runstop', icons, icons)
40  self.setToolTip('Runstop')
41  self.set_stale()
42  self.setFixedSize(self._icons[0].actualSize(QSize(50, 30)))
43 
44  def set_ok(self):
45  self.update_state(0)
46 
47  def set_button_stop(self):
48  self.update_state(1)
49 
50  def set_scanner_stop(self):
51  self.update_state(2)
52 
53  def set_stale(self):
54  self.update_state(3)


cob_dashboard
Author(s): Alexander Bubeck
autogenerated on Wed Apr 7 2021 03:03:02