20 from python_qt_binding.QtCore
import QSize
26 Dashboard widget to display COB battery state. 31 :param context: the plugin context 32 :type context: qt_gui.plugin.Plugin 34 super(COBBattery, self).
__init__(
'COB Battery')
38 self.setFixedSize(self._icons[1].actualSize(QSize(50, 30)))
44 Sets button state based on msg 46 :param msg: message containing the power state of the COB 47 :type msg: cob_msgs.PowerState 55 drain_str =
"remaining" 57 drain_str =
"to full charge" 59 self.setToolTip(
"Battery: %.2f%% \nTime %s: %.2f Minutes" % (msg.relative_remaining_capacity, drain_str, self.
_time_remaining * 60.0))
60 self.update_perc(msg.relative_remaining_capacity)
65 self.setToolTip(
"Battery: Stale")
def __init__(self, context)
def set_power_state(self, msg)