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
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 from python_qt_binding.QtWidgets import QTextEdit
00039 from python_qt_binding.QtCore import Signal
00040
00041 from diagnostic_msgs.msg import DiagnosticStatus
00042 from rqt_robot_monitor.util_robot_monitor import level_to_text
00043
00044 class StatusSnapshot(QTextEdit):
00045 """Display a single static status message. Helps facilitate copy/paste"""
00046 write_status = Signal(DiagnosticStatus)
00047
00048 def __init__(self, status=None, parent=None):
00049 super(StatusSnapshot, self).__init__()
00050
00051 self.write_status.connect(self._write_status)
00052 if status is not None:
00053 self.write_status.emit(status)
00054
00055 self.resize(300, 400)
00056 self.show()
00057
00058 def _write_status(self, status):
00059 self.clear()
00060 self._write("Full Name", status.name)
00061 self._write("Component", status.name.split('/')[-1])
00062 self._write("Hardware ID", status.hardware_id)
00063 self._write("Level", level_to_text(status.level))
00064 self._write("Message", status.message)
00065 self.insertPlainText('\n')
00066
00067 for value in status.values:
00068 self._write(value.key, value.value)
00069
00070 def _write(self, k, v):
00071
00072 self.setFontWeight(75)
00073 self.insertPlainText(str(k))
00074
00075 self.insertPlainText(': ')
00076
00077 self.setFontWeight(50)
00078 self.insertPlainText(str(v))
00079 self.insertPlainText('\n')
rqt_robot_monitor
Author(s): Austin Hendrix, Isaac Saito, Ze'ev Klapow, Kevin Watts, Josh Faust
autogenerated on Tue Sep 26 2017 02:44:21