13#include <simgear/props/props.hxx>
14#include <simgear/structure/subsystem_mgr.hxx>
34 using comp_list = std::vector<FGElectricalComponent*>;
104 SGPropertyNode_ptr _rpm_node;
118 float percent_remaining;
158 SGPropertyNode_ptr switch_node;
160 bool circuit_breaker;
167 inline bool get_state()
const {
return switch_node->getBoolValue(); }
168 void set_state(
bool val) { switch_node->setBoolValue(val); }
178 typedef std::vector<FGElectricalSwitch> switch_list;
179 switch_list switches;
187 switches.push_back(s);
209 void bind()
override;
210 void init()
override;
213 void update(
double dt)
override;
218 bool build(SGPropertyNode* config_props);
220 float input_volts,
float input_amps,
241 SGPropertyNode_ptr _volts_out;
242 SGPropertyNode_ptr _amps_out;
243 SGPropertyNode_ptr _serviceable_node;
244 bool _serviceable =
true;
FGElectricalBus(SGPropertyNode *node)
void add_input(FGElectricalComponent *c)
float get_available_amps() const
void set_volts(float val)
const std::string & get_name()
simgear::PropertyList props
void add_prop(const std::string &s)
std::vector< FGElectricalComponent * > comp_list
int get_num_outputs() const
int get_num_inputs() const
void set_load_amps(float val)
FGElectricalComponent * get_input(const int i)
virtual ~FGElectricalComponent()=default
float get_load_amps() const
void set_available_amps(float val)
FGElectricalComponent * get_output(const int i)
FGElectricalComponentType
void publishVoltageToProps() const
void add_output(FGElectricalComponent *c)
FGElectricalConnector(SGPropertyNode *node, FGElectricalSystem *es)
void set_switches(bool state)
void add_switch(FGElectricalSwitch s)
FGElectricalOutput(SGPropertyNode *node)
FGElectricalSupplier(SGPropertyNode *node)
float get_charge_amps() const
float apply_load(float amps, float dt)
FGSupplierType get_model() const
FGElectricalSwitch(SGPropertyNode *node)
Model an electrical system.
bool build(SGPropertyNode *config_props)
float propagate(FGElectricalComponent *node, double dt, float input_volts, float input_amps, std::string s="")
void update(double dt) override
FGElectricalSystem(SGPropertyNode *node)
FGElectricalComponent * find(const std::string &name)
static const char * staticSubsystemClassId()
virtual ~FGElectricalSystem()
std::vector< FGElectricalComponent * > comp_list