7 from python_qt_binding
import loadUi
8 from python_qt_binding.QtCore
import QEvent, QModelIndex, QObject, Qt, QTimer, Signal, Slot
9 from python_qt_binding.QtGui
import QShortcut, QTableWidgetItem, QWidget, QLCDNumber, QItemDelegate, QAbstractItemView, QColor, QFont
10 from rospy
import Time
11 from std_msgs.msg
import Bool
12 from std_msgs.msg
import Float32
16 _update_co2_color = Signal()
17 _update_no_co2_color = Signal()
20 QObject.__init__(self, context)
21 self.setObjectName(
'CO2Detection')
24 ui_file = os.path.join(rospkg.RosPack().get_path(
'hector_co2_detection_plugin'),
'lib',
'CO2Detection.ui')
26 self._widget.setObjectName(
'CO2Detection')
33 if context.serial_number() > 1:
34 self._widget.setWindowTitle(self._widget.windowTitle() + (
' (%d)' % context.serial_number()))
36 context.add_widget(self.
_widget)
47 self._co2_font.setBold(
True)
56 self._widget.co2detectbutton.setText(
"Clear Air")
57 self._update_no_co2_color.emit()
77 self._widget.co2detectbutton.setText(
"Warning: CO2 detected !!!" if msg.data
else "Clear Air")
80 self._update_co2_color.emit()
82 self._update_no_co2_color.emit()
86 self._widget.co2detectbutton.setStyleSheet(style_sheet_string)
90 self._widget.co2detectbutton.setStyleSheet(style_sheet_string)
def __init__(self, context)
def shutdown_plugin(self)
def _set_no_co2_style(self)
def restore_settings(self, plugin_settings, instance_settings)
def _on_co2_detected(self, msg)
def save_settings(self, plugin_settings, instance_settings)