Go to the documentation of this file.00001
00002
00003 from python_qt_binding.QtWidgets import QLabel, QStyle
00004 import rospy
00005
00006
00007 class StatusIndicator(QLabel):
00008
00009 def __init__(self, *args):
00010 super(StatusIndicator, self).__init__(*args)
00011 self.set_stopped()
00012
00013 def set_running(self):
00014 self.setPixmap(
00015 self.style().standardIcon(QStyle.SP_DialogApplyButton).pixmap(16))
00016
00017 def set_starting(self):
00018 rospy.logdebug('StatusIndicator.set_starting')
00019 self.setPixmap(self.style().standardIcon(QStyle.SP_DialogResetButton).pixmap(16))
00020
00021 def set_stopping(self):
00022 """
00023 Show msg that the process is "stopping".
00024
00025 cf. set_stopped()
00026 """
00027 self.setPixmap(self.style().standardIcon(QStyle.SP_DialogResetButton).pixmap(16))
00028
00029 def set_stopped(self):
00030 """
00031 Show msg that the process is "stopped".
00032
00033 cf. set_stopping()
00034 """
00035 self.setText(" ")
00036
00037 def set_died(self):
00038 self.setPixmap(self.style().standardIcon(QStyle.SP_MessageBoxCritical).pixmap(16))