Package joy :: Module safety :: Class BatteryVoltage
[hide private]
[frames] | no frames]

Class BatteryVoltage

source code


Concrete class managing battery safety via a collection of objects that support the get_voltage method.

Instance Methods [hide private]
 
__init__(self, vmin, sensors, pollRate=1.0)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
poll(self, now)
Polls voltage sensors listed in self.sensors for voltage measurements at the rate specified by self.rate
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, vmin, sensors, pollRate=1.0)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

poll(self, now)

source code 

Polls voltage sensors listed in self.sensors for voltage measurements at the rate specified by self.rate

If a measurement is ready, it is stored in self.last as a (time,voltage) pair, and this pair is returned.

Otherwise, returns (None,None)

If the voltage is below vmin -- raises a SafetyError