Stg::PowerPack Class Reference

#include <stage.hh>

Classes

class  DissipationVis
 

Public Member Functions

void Add (joules_t j)
 
void ChargeStart ()
 
void ChargeStop ()
 
void Dissipate (joules_t j)
 
void Dissipate (joules_t j, const Pose &p)
 
joules_t GetCapacity () const
 
bool GetCharging () const
 
joules_t GetDissipated () const
 
joules_t GetStored () const
 
 PowerPack (Model *mod)
 
void Print (const char *prefix) const
 
double ProportionRemaining () const
 
joules_t RemainingCapacity () const
 
void SetCapacity (joules_t j)
 
void SetStored (joules_t j)
 
void Subtract (joules_t j)
 
void TransferTo (PowerPack *dest, joules_t amount)
 
void Visualize (Camera *cam)
 
 ~PowerPack ()
 

Static Public Attributes

static joules_t global_capacity = 0.0
 
static joules_t global_dissipated = 0.0
 
static joules_t global_input = 0.0
 
static joules_t global_stored = 0.0
 

Protected Attributes

joules_t capacity
 
bool charging
 
joules_t dissipated
 
Stg::PowerPack::DissipationVis event_vis
 
joules_t last_joules
 
usec_t last_time
 
watts_t last_watts
 
Modelmod
 
StripPlotVis output_vis
 
joules_t stored
 
StripPlotVis stored_vis
 

Constructor & Destructor Documentation

◆ PowerPack()

PowerPack::PowerPack ( Model mod)
explicit

◆ ~PowerPack()

PowerPack::~PowerPack ( )

Member Function Documentation

◆ Add()

void PowerPack::Add ( joules_t  j)

Add to the energy store

◆ ChargeStart()

void Stg::PowerPack::ChargeStart ( )
inline

◆ ChargeStop()

void Stg::PowerPack::ChargeStop ( )
inline

◆ Dissipate() [1/2]

void PowerPack::Dissipate ( joules_t  j)

Lose energy as work or heat

◆ Dissipate() [2/2]

void PowerPack::Dissipate ( joules_t  j,
const Pose p 
)

Lose energy as work or heat, and record the event

◆ GetCapacity()

joules_t PowerPack::GetCapacity ( ) const

◆ GetCharging()

bool Stg::PowerPack::GetCharging ( ) const
inline

Returns true iff the device received energy at the last timestep

◆ GetDissipated()

joules_t PowerPack::GetDissipated ( ) const

◆ GetStored()

joules_t PowerPack::GetStored ( ) const

◆ Print()

void Stg::PowerPack::Print ( const char *  prefix) const
inline

Print human-readable status on stdout, prefixed with the argument string, or NULL

◆ ProportionRemaining()

double Stg::PowerPack::ProportionRemaining ( ) const
inline

◆ RemainingCapacity()

joules_t PowerPack::RemainingCapacity ( ) const

Returns the energy capacity minus the current amount stored

◆ SetCapacity()

void PowerPack::SetCapacity ( joules_t  j)

◆ SetStored()

void PowerPack::SetStored ( joules_t  j)

◆ Subtract()

void PowerPack::Subtract ( joules_t  j)

Subtract from the energy store

◆ TransferTo()

void PowerPack::TransferTo ( PowerPack dest,
joules_t  amount 
)

Transfer some stored energy to another power pack

◆ Visualize()

void PowerPack::Visualize ( Camera cam)

OpenGL visualization of the powerpack state

Member Data Documentation

◆ capacity

joules_t Stg::PowerPack::capacity
protected

Energy capacity

◆ charging

bool Stg::PowerPack::charging
protected

TRUE iff the device is receiving energy

◆ dissipated

joules_t Stg::PowerPack::dissipated
protected

Energy dissipated

◆ event_vis

Stg::PowerPack::DissipationVis Stg::PowerPack::event_vis
protected

◆ global_capacity

joules_t PowerPack::global_capacity = 0.0
static

◆ global_dissipated

joules_t PowerPack::global_dissipated = 0.0
static

◆ global_input

joules_t PowerPack::global_input = 0.0
static

◆ global_stored

joules_t PowerPack::global_stored = 0.0
static

◆ last_joules

joules_t Stg::PowerPack::last_joules
protected

◆ last_time

usec_t Stg::PowerPack::last_time
protected

◆ last_watts

watts_t Stg::PowerPack::last_watts
protected

◆ mod

Model* Stg::PowerPack::mod
protected

The model that owns this object

◆ output_vis

StripPlotVis Stg::PowerPack::output_vis
protected

◆ stored

joules_t Stg::PowerPack::stored
protected

Energy stored

◆ stored_vis

StripPlotVis Stg::PowerPack::stored_vis
protected

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