BatteryMonitorBehavior Class Reference#include <BatteryMonitorBehavior.h>
Inheritance diagram for BatteryMonitorBehavior:
[legend]List of all members.
Detailed Description
A background behavior which will monitor the power level and flip the ears when appropriate on a 210, or blink the headlight if a 220.
Think of this as a simple example class. For exercise, try using a MotionSequenceMC instead of switching the ears back manually using a PostureMC
Definition at line 21 of file BatteryMonitorBehavior.h.
Constructor & Destructor Documentation
BatteryMonitorBehavior::BatteryMonitorBehavior |
( |
|
) |
[inline] |
|
Member Function Documentation
unsigned int BatteryMonitorBehavior::calcFlipDelay |
( |
|
) |
[inline, protected] |
|
|
makes the ears flip more rapidly as power declines. Flips back and forth once every 15 seconds at 15%, down to flipping constantly at 5%.
Definition at line 126 of file BatteryMonitorBehavior.h.
Referenced by processEvent(). |
virtual void BatteryMonitorBehavior::DoStart |
( |
|
) |
[inline, virtual] |
|
virtual void BatteryMonitorBehavior::DoStop |
( |
|
) |
[inline, virtual] |
|
static std::string BatteryMonitorBehavior::getClassDescription |
( |
|
) |
[inline, static] |
|
virtual std::string BatteryMonitorBehavior::getDescription |
( |
|
) |
const [inline, virtual] |
|
|
Gives a short description of what this particular instantiation does (in case a more specific description is needed on an individual basis).
By default simply returns getName(), because any calls from a BehaviorBase function to getClassDescription() are going to call BehaviorBase::getClassDescription(), not ~YourSubClass~::getClassDescription(), because static functions can't be virtual in C++ (doh!)
This means that getDescription called on a pointer to a BehaviorBase of unknown subtype would always return an empty string, which is pretty useless. So instead we return the name in this situation. If you want getDescription to return getClassDescription, you'll have to override it in your subclass to do so.
Reimplemented from BehaviorBase.
Definition at line 98 of file BatteryMonitorBehavior.h. |
virtual void BatteryMonitorBehavior::processEvent |
( |
const EventBase & |
event |
) |
[inline, virtual] |
|
void BatteryMonitorBehavior::setFlipper |
( |
bool |
set |
) |
[inline, protected] |
|
static bool BatteryMonitorBehavior::shouldWarn |
( |
|
) |
[inline, static] |
|
|
returns true if the warning should be active (power remaining less than high_power_p, no external power, but also checks that a power update has been received)
Definition at line 101 of file BatteryMonitorBehavior.h.
Referenced by DoStart(), and processEvent(). |
void BatteryMonitorBehavior::startWarning |
( |
|
) |
[inline, protected] |
|
void BatteryMonitorBehavior::stopWarning |
( |
|
) |
[inline, protected] |
|
Member Data Documentation
The documentation for this class was generated from the following file:
|