Avionics
Dropship Simulator
Systems::Component Class Reference

#include <Component.h>

Inheritance diagram for Systems::Component:
[legend]
Collaboration diagram for Systems::Component:
[legend]

Public Member Functions

 Component (Logger *prmLogger)
 
virtual void FrameMove (double fTime)
 this is a generic unimplemented component framemove, eventually make a pure virtual function? More...
 
virtual ~Component ()
 
float EvaluateDependency (System system)
 
void PropogateLoad (System system)
 

Public Attributes

GUID attachedTo
 
ComponentattachedToComponent = nullptr
 
std::string name
 
std::vector< Dependencydependencies
 
float averageServiceLife = 0.0f
 Average service life in hours. More...
 
float serviceLifeCycleHit = 0.0f
 Power-on service life cycle hit. More...
 
float weight = 0.0f
 
float cost = 0.0f
 
float pickupPressure = 0.0f
 Minimum pressure/voltage to activate. More...
 
float dropoutPressure = 0.0f
 Minimum pressure/voltage to keep active. More...
 
float maxPressure = 0.0f
 
float loadDraw = 0.0f
 
float minTemp = 0.0f
 
float maxTemp = 0.0f
 
float maxCapacity = 0.0f
 
std::string make
 
std::string model
 
std::string description
 
float temperature = 0.0f
 componentInfo More...
 
float serviceLifeRemaining = 0.0f
 
float setState = -999.0f
 
float currentState = -999.0f
 
double lastTimeProcessed = 0
 these don't get stored anywhere More...
 
float currentLoad = 0
 
- Public Attributes inherited from Systems::BaseComponent
GUID guid
 
std::string guidStr
 
System system
 
D3DXVECTOR3 location
 
float capacityPressureEtc
 propogated supply More...
 
float propogatedLoad
 propogated demand More...
 
int hpPhysical
 
int hpEnergy
 
float hpPhysicalRemaining
 
float hpEnergyRemaining
 
Fault fault = Fault::NoSignal
 

Protected Attributes

Loggerlogger = nullptr
 

Private Member Functions

 Component ()=default
 

Detailed Description

Definition at line 9 of file Component.h.

Constructor & Destructor Documentation

◆ Component() [1/2]

Systems::Component::Component ( )
privatedefault

◆ Component() [2/2]

Component::Component ( Logger prmLogger)
explicit

Definition at line 5 of file Component.cpp.

◆ ~Component()

virtual Systems::Component::~Component ( )
inlinevirtual

Polymorphism gotcha - if this isn't here then std::vector embedded in derived classes don't clean up!

See also
http://www.cplusplus.com/forum/general/17754/ My theory is that they won't inherit a public destructor if one isn't declared in the base class

Definition at line 66 of file Component.h.

Member Function Documentation

◆ EvaluateDependency()

float Component::EvaluateDependency ( System  system)

Definition at line 35 of file Component.cpp.

Here is the caller graph for this function:

◆ FrameMove()

void Component::FrameMove ( double  fTime)
virtual

this is a generic unimplemented component framemove, eventually make a pure virtual function?

this is to expose it on the bus methods... for a bus bar this makes sense because currentState is unused...

Reimplemented in Systems::Real, Systems::Combustion, Systems::Igniter, Systems::N1, Systems::N2, Systems::Starter, Systems::Battery, Systems::TempSensor, Systems::Switch, and Systems::Relay.

Definition at line 11 of file Component.cpp.

Here is the call graph for this function:

◆ PropogateLoad()

void Component::PropogateLoad ( System  system)

Definition at line 52 of file Component.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ attachedTo

GUID Systems::Component::attachedTo

Definition at line 18 of file Component.h.

◆ attachedToComponent

Component* Systems::Component::attachedToComponent = nullptr

Definition at line 19 of file Component.h.

◆ averageServiceLife

float Systems::Component::averageServiceLife = 0.0f

Average service life in hours.

Definition at line 26 of file Component.h.

◆ cost

float Systems::Component::cost = 0.0f

Definition at line 31 of file Component.h.

◆ currentLoad

float Systems::Component::currentLoad = 0

Definition at line 56 of file Component.h.

◆ currentState

float Systems::Component::currentState = -999.0f

Definition at line 52 of file Component.h.

◆ dependencies

std::vector<Dependency> Systems::Component::dependencies

Definition at line 22 of file Component.h.

◆ description

std::string Systems::Component::description

Definition at line 43 of file Component.h.

◆ dropoutPressure

float Systems::Component::dropoutPressure = 0.0f

Minimum pressure/voltage to keep active.

Definition at line 36 of file Component.h.

◆ lastTimeProcessed

double Systems::Component::lastTimeProcessed = 0

these don't get stored anywhere

Definition at line 55 of file Component.h.

◆ loadDraw

float Systems::Component::loadDraw = 0.0f

Definition at line 39 of file Component.h.

◆ logger

Logger* Systems::Component::logger = nullptr
protected

Definition at line 15 of file Component.h.

◆ make

std::string Systems::Component::make

Definition at line 43 of file Component.h.

◆ maxCapacity

float Systems::Component::maxCapacity = 0.0f

Definition at line 42 of file Component.h.

◆ maxPressure

float Systems::Component::maxPressure = 0.0f

Definition at line 38 of file Component.h.

◆ maxTemp

float Systems::Component::maxTemp = 0.0f

Definition at line 41 of file Component.h.

◆ minTemp

float Systems::Component::minTemp = 0.0f

Definition at line 40 of file Component.h.

◆ model

std::string Systems::Component::model

Definition at line 43 of file Component.h.

◆ name

std::string Systems::Component::name

Definition at line 21 of file Component.h.

◆ pickupPressure

float Systems::Component::pickupPressure = 0.0f

Minimum pressure/voltage to activate.

Definition at line 34 of file Component.h.

◆ serviceLifeCycleHit

float Systems::Component::serviceLifeCycleHit = 0.0f

Power-on service life cycle hit.

Definition at line 28 of file Component.h.

◆ serviceLifeRemaining

float Systems::Component::serviceLifeRemaining = 0.0f

Definition at line 48 of file Component.h.

◆ setState

float Systems::Component::setState = -999.0f

For an output (sensor) currentState gets set internally to setState based on data dependency being available (real sensors write to setState) For an input (switch, throttle) currentState gets set internally to setState based on data dependency being available, 0.0 is off, 1.0 is on, component bases decisions off of currentState

Definition at line 51 of file Component.h.

◆ temperature

float Systems::Component::temperature = 0.0f

componentInfo

Definition at line 47 of file Component.h.

◆ weight

float Systems::Component::weight = 0.0f

Definition at line 30 of file Component.h.


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