| Homepage | Demos | Overview | Downloads | Tutorials | Reference | Credits |
#include <BatteryCheckControl.h>
Inheritance diagram for BatteryCheckControl:

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 25 of file BatteryCheckControl.h.
Public Member Functions | |
| BatteryCheckControl () | |
| Constructor. | |
| virtual | ~BatteryCheckControl () |
| Destructor. | |
| virtual ControlBase * | activate (MotionManager::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 ControlBase * | doSelect () |
| 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.
Definition at line 29 of file BatteryCheckControl.h. |
|
|
Destructor.
Definition at line 32 of file BatteryCheckControl.h. |
|
||||||||||||
|
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. Definition at line 36 of file BatteryCheckControl.h. References ControlBase::activate(), EventRouter::addListener(), erouter, MotionManager::MC_ID, EventBase::powerEGID, Socket::printf(), and sout. |
Here is the call graph for this function:

|
|
stops listening for power events and sets display to invalid
Reimplemented from ControlBase. Definition at line 64 of file BatteryCheckControl.h. References ControlBase::display_id, erouter, EventRouter::forgetListener(), and MotionManager::invalid_MC_ID. |
Here is the call graph for this function:

|
|
when the user has trigger an "open selection" - default is to return the hilighted control
Reimplemented from ControlBase. Definition at line 73 of file BatteryCheckControl.h. |
|
|
stops listening for power events and sets display to invalid
Reimplemented from ControlBase. Definition at line 42 of file BatteryCheckControl.h. References ControlBase::display_id, erouter, EventRouter::forgetListener(), and MotionManager::invalid_MC_ID. |
Here is the call graph for this function:

|
|
calls refresh() to redisplay with new information if it's not a vibration event
Implements EventListener. Definition at line 69 of file BatteryCheckControl.h. References EventBase::getSourceID(), and refresh(). |
Here is the call graph for this function:

|
|
calls report()
Reimplemented from ControlBase. Definition at line 47 of file BatteryCheckControl.h. References ControlBase::getName(), ControlBase::gui_comm, Wireless::isConnected(), ERS210Info::PowerRemainOffset, report(), WorldState::sensors, Socket::sock, state, wireless, and Socket::write(). |
Here is the call graph for this function:

|
|
redisplay text to sout and refresh LED values
Definition at line 77 of file BatteryCheckControl.h. References ControlBase::display_id, MotionManager::invalid_MC_ID, LedEngine::major, ERS210Info::PowerCapacityOffset, ERS210Info::PowerCurrentOffset, WorldState::powerFlags, ERS210Info::PowerRemainOffset, ERS210Info::PowerThermoOffset, ERS210Info::PowerVoltageOffset, Socket::printf(), WorldState::sensors, sout, and state. |
Here is the call graph for this function:

|
Tekkotsu v1.5 |
Generated Fri Oct 10 15:55:06 2003 by Doxygen 1.3.4 |