1
0
Fork 0

Add support for specifying an rpm source for the alternator. This enables

us to tie the output of an arbitrary generator to the state of an arbitrary
engine.
This commit is contained in:
curt 2003-02-03 22:35:24 +00:00
parent 1b40b5e4c9
commit 6bfdb5a762
2 changed files with 4 additions and 10 deletions

View file

@ -56,6 +56,7 @@ FGElectricalSupplier::FGElectricalSupplier ( SGPropertyNode *node ) {
} }
volts = node->getDoubleValue("volts"); volts = node->getDoubleValue("volts");
amps = node->getDoubleValue("amps"); amps = node->getDoubleValue("amps");
rpm_src = node->getStringValue("rpm-source");
int i; int i;
for ( i = 0; i < node->nChildren(); ++i ) { for ( i = 0; i < node->nChildren(); ++i ) {
@ -69,7 +70,7 @@ FGElectricalSupplier::FGElectricalSupplier ( SGPropertyNode *node ) {
} }
} }
_rpm_node = fgGetNode("/engines/engine[0]/rpm", true); _rpm_node = fgGetNode( rpm_src.c_str(), true);
} }

View file

@ -117,6 +117,7 @@ class FGElectricalSupplier : public FGElectricalComponent {
FG_EXTERNAL = 2 FG_EXTERNAL = 2
}; };
string rpm_src;
int model; int model;
double volts; double volts;
double amps; double amps;
@ -178,15 +179,7 @@ public:
/** /**
* Model an electrical system. This is a simple system with the * Model an electrical system. This is a fairly simplistic system
* alternator hardwired to engine[0]/rpm
*
* Input properties:
*
* /engines/engine[0]/rpm
*
* Output properties:
*
* *
*/ */