4 import vigir_footstep_planning_msgs.msg
6 from python_qt_binding.QtCore
import Qt, QObject, Signal, Slot
7 from python_qt_binding.QtGui
import QWidget, QColor
9 from vigir_footstep_planning_msgs.msg
import ErrorStatus
15 out_log_signal = Signal(str, QColor)
17 def __init__(self, error_status_text_box=None):
19 self.
connect(error_status_text_box)
22 if type(error_status_text_box).__name__ ==
"QErrorStatusTextBox":
23 self.out_log_signal.connect(error_status_text_box.out_log)
24 elif type(error_status_text_box).__name__ ==
"QErrorStatusWidget":
25 self.out_log_signal.connect(error_status_text_box.get_text_box().out_log)
27 def log(self, error_status):
28 if error_status.error != 0:
30 if error_status.warning != 0:
31 self.
log_warn(error_status.warning_msg)
34 self.out_log_signal.emit(
"[ INFO] " + msg, Qt.black)
38 self.out_log_signal.emit(
"[DEBUG] " + msg, Qt.yellow)
42 self.out_log_signal.emit(
"[ WARN] " + msg, QColor(255, 165, 0))
46 self.out_log_signal.emit(
"[ERROR] " + msg, Qt.red)
55 def __init__(self, parent=None, logger=Logger()):
56 QWidget.__init__(self, parent)