Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

BatteryCheckControl Class Reference

When activated, this will print a battery report to stdout and light up LEDs to specify power level. More...

#include <BatteryCheckControl.h>

Inheritance diagram for BatteryCheckControl:

Detailed Description

When activated, this will print a battery report to stdout and light up LEDs to specify power level.

The LEDs use the LedEngine::displayPercent() function, with minor/major style. This means the left column (viewing the dog head on) will show the overall power level, and the right column will show the level within the tick lit up in the left column. The more geeky among you may prefer to think of this as a two digit base 5 display.

This gives you pretty precise visual feedback as to remaining power (perhaps more than you really need, but it's as much a demo as a useful tool)

This is implemented as a Control instead of a Behavior on the assumption you wouldn't want to leave this running while you were doing other things (ie not in e-stop). But it definitely blurs the line between the two.

Definition at line 20 of file BatteryCheckControl.h.

List of all members.

Public Member Functions

 BatteryCheckControl ()
 Constructor.
virtual ~BatteryCheckControl ()
 Destructor.
virtual ControlBaseactivate (MC_ID display, Socket *gui)
 Prints a report to stdio and lights up the face to show battery level.
virtual void pause ()
 stops listening for power events and sets display to invalid
virtual void refresh ()
 calls report()
virtual void deactivate ()
 stops listening for power events and sets display to invalid
virtual void processEvent (const EventBase &event)
 calls refresh() to redisplay with new information if it's not a vibration event
virtual ControlBasedoSelect ()
 when the user has trigger an "open selection" - default is to return the hilighted control*/
void report ()
 redisplay text to sout and refresh LED values

Constructor & Destructor Documentation

BatteryCheckControl::BatteryCheckControl (  ) 

Constructor.

Definition at line 24 of file BatteryCheckControl.h.

virtual BatteryCheckControl::~BatteryCheckControl (  )  [virtual]

Destructor.

Definition at line 27 of file BatteryCheckControl.h.


Member Function Documentation

virtual ControlBase* BatteryCheckControl::activate ( MC_ID  display,
Socket gui 
) [virtual]

Prints a report to stdio and lights up the face to show battery level.

keeps running until deactivated - will listen for power events and continue to update display

Reimplemented from ControlBase.

virtual void BatteryCheckControl::deactivate (  )  [virtual]

stops listening for power events and sets display to invalid

Reimplemented from ControlBase.

virtual ControlBase* BatteryCheckControl::doSelect (  )  [virtual]

when the user has trigger an "open selection" - default is to return the hilighted control*/

The value which is returned is then activate()ed and pushed on the Controller's stack

Reimplemented from ControlBase.

Definition at line 45 of file BatteryCheckControl.h.

virtual void BatteryCheckControl::pause (  )  [virtual]

stops listening for power events and sets display to invalid

Reimplemented from ControlBase.

virtual void BatteryCheckControl::processEvent ( const EventBase event  )  [virtual]

calls refresh() to redisplay with new information if it's not a vibration event

Implements EventListener.

virtual void BatteryCheckControl::refresh (  )  [virtual]

calls report()

Reimplemented from ControlBase.

void BatteryCheckControl::report (  ) 

redisplay text to sout and refresh LED values


The documentation for this class was generated from the following file:

Tekkotsu v5.1CVS
Generated Mon May 9 04:59:05 2016 by Doxygen 1.6.3