status_indicator.py
Go to the documentation of this file.
1 #! /usr/bin/env python
2 
3 from python_qt_binding.QtWidgets import QLabel, QStyle
4 import rospy
5 
6 
7 class StatusIndicator(QLabel):
8 
9  def __init__(self, *args):
10  super(StatusIndicator, self).__init__(*args)
11  self.set_stopped()
12 
13  def set_running(self):
14  self.setPixmap(
15  self.style().standardIcon(QStyle.SP_DialogApplyButton).pixmap(16))
16 
17  def set_starting(self):
18  rospy.logdebug('StatusIndicator.set_starting')
19  self.setPixmap(self.style().standardIcon(QStyle.SP_DialogResetButton).pixmap(16))
20 
21  def set_stopping(self):
22  """
23  Show msg that the process is "stopping".
24 
25  cf. set_stopped()
26  """
27  self.setPixmap(self.style().standardIcon(QStyle.SP_DialogResetButton).pixmap(16))
28 
29  def set_stopped(self):
30  """
31  Show msg that the process is "stopped".
32 
33  cf. set_stopping()
34  """
35  self.setText(" ")
36 
37  def set_died(self):
38  self.setPixmap(self.style().standardIcon(QStyle.SP_MessageBoxCritical).pixmap(16))


rqt_launch
Author(s): Isaac Saito, Stuart Glaser
autogenerated on Wed Jun 5 2019 21:35:22