]> git.mxchange.org Git - flightgear.git/blobdiff - src/Systems/electrical.cxx
Boris Koenig:
[flightgear.git] / src / Systems / electrical.cxx
index b3109d5183e94ae760756e1855d469390bba2538..72dcf3917aeba31d489307cabc3c69fdf6d69812 100644 (file)
@@ -350,12 +350,17 @@ void FGElectricalSystem::update (double dt) {
     if ( fgGetBool("/controls/engines/engine[0]/master-bat") ) {
         volts = 24.0;
     }
-    if ( fgGetBool("/controls/engines/engine[0]/master-alt") &&
-         fgGetDouble("/engines/engine[0]/rpm") > 800 )
-    {
-        double alt_contrib = 28.0;
-        if ( alt_contrib > volts ) {
-            volts = alt_contrib;
+    if ( fgGetBool("/controls/engines/engine[0]/master-alt") ) {
+        if ( fgGetDouble("/engines/engine[0]/rpm") > 800 ) {
+            double alt_contrib = 28.0;
+            if ( alt_contrib > volts ) {
+                volts = alt_contrib;
+            }
+        } else if ( fgGetDouble("/engines/engine[0]/rpm") > 200 ) {
+            double alt_contrib = 20.0;
+            if ( alt_contrib > volts ) {
+                volts = alt_contrib;
+            }
         }
     }
     _volts_out->setDoubleValue( volts );
@@ -364,8 +369,8 @@ void FGElectricalSystem::update (double dt) {
     // naming conventions in the electrical system config) ... FIXME:
     // make this more generic
     double amps = 0.0;
-    if ( fgGetBool("/controls/switches/master-bat") ) {
-        if ( fgGetBool("/controls/switches/master-alt") &&
+    if ( fgGetBool("/controls/engines/engine[0]/master-bat") ) {
+        if ( fgGetBool("/controls/engines/engine[0]/master-alt") &&
              fgGetDouble("/engines/engine[0]/rpm") > 800 )
         {
             amps += 40.0 * alt_norm;