//
// Written by Curtis Olson, started September 2002.
//
-// Copyright (C) 2002 Curtis L. Olson - curt@flightgear.org
+// Copyright (C) 2002 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
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 );
// 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;