]> git.mxchange.org Git - flightgear.git/commitdiff
Add support for specifying an rpm source for the alternator. This enables
authorcurt <curt>
Mon, 3 Feb 2003 22:35:24 +0000 (22:35 +0000)
committercurt <curt>
Mon, 3 Feb 2003 22:35:24 +0000 (22:35 +0000)
us to tie the output of an arbitrary generator to the state of an arbitrary
engine.

src/Systems/electrical.cxx
src/Systems/electrical.hxx

index 240a798686e296479c8742f9ce643bb63bd1fde3..4c385b3a3f0e27631ee02382897978ebd641daea 100644 (file)
@@ -56,6 +56,7 @@ FGElectricalSupplier::FGElectricalSupplier ( SGPropertyNode *node ) {
     }
     volts = node->getDoubleValue("volts");
     amps = node->getDoubleValue("amps");
+    rpm_src = node->getStringValue("rpm-source");
 
     int 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);
 }  
 
 
index 3b20d298c5a34791eee37f560a60542368792d04..f36f92af9159d49f3e62cd1b9ec0f1a46ffc3dd2 100644 (file)
@@ -117,6 +117,7 @@ class FGElectricalSupplier : public FGElectricalComponent {
         FG_EXTERNAL = 2
     };
 
+    string rpm_src;
     int model;
     double volts;
     double amps;
@@ -178,15 +179,7 @@ public:
 
 
 /**
- * Model an electrical system.  This is a simple system with the
- * alternator hardwired to engine[0]/rpm
- *
- * Input properties:
- *
- * /engines/engine[0]/rpm
- *
- * Output properties:
- *
+ * Model an electrical system.  This is a fairly simplistic system
  * 
  */