Public Types | Public Member Functions | Protected Attributes

DrawAmount Class Reference
[baseModules - base module classes of MiXiMPower consumption - Classes using/defining power consumption]

Defines the amount of power drawn by a device from a power source. More...

#include <BaseBattery.h>

List of all members.

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.

Detailed Description

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.


Member Enumeration Documentation

The type of the amount to draw.

Enumerator:
ENERGY 

Current in mA over time.

Single fixed energy draw in mWs

Definition at line 25 of file BaseBattery.h.

                 {
    CURRENT,  
    ENERGY    
  };


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