Defines the amount of power drawn by a device from a power source. More...
#include <BaseBattery.h>
Public Types | |
enum | PowerType { CURRENT, ENERGY } |
The type of the amount to draw. More... | |
Public Member Functions | |
DrawAmount (int type=CURRENT, double value=0) | |
Initializes with passed type and value. | |
virtual int | getType () |
Returns the type of power drawn as PowerType. | |
virtual double | getValue () |
Returns the actual amount of power drawn. | |
virtual void | setType (int t) |
Sets the type of power drawn. | |
virtual void | setValue (double v) |
Sets the actual amount of power drawn. | |
Protected Attributes | |
int | type |
Stores the type of the amount. | |
double | value |
Stores the actual amount. |
Defines the amount of power drawn by a device from a power source.
Used as generic amount parameter for BaseBatteries "draw"-method.
Can be either an instantaneous draw of a certain energy amount in mWs (type=ENERGY) or a draw of a certain current in mA over time (type=CURRENT).
Can be sub-classed for more complex power draws.
Definition at line 22 of file BaseBattery.h.