diff --git a/src/Instrumentation/Makefile.am b/src/Instrumentation/Makefile.am index a99087364..cf16083d8 100644 --- a/src/Instrumentation/Makefile.am +++ b/src/Instrumentation/Makefile.am @@ -7,7 +7,6 @@ libInstrumentation_a_SOURCES = \ adf.cxx adf.hxx \ airspeed_indicator.cxx airspeed_indicator.hxx \ altimeter.cxx altimeter.hxx \ - annunciator.cxx annunciator.hxx \ attitude_indicator.cxx attitude_indicator.hxx \ clock.cxx clock.hxx \ dme.cxx dme.hxx \ diff --git a/src/Instrumentation/annunciator.cxx b/src/Instrumentation/annunciator.cxx deleted file mode 100644 index 97a2cc9ae..000000000 --- a/src/Instrumentation/annunciator.cxx +++ /dev/null @@ -1,195 +0,0 @@ -// annunciator.hxx - manage the annunciator states -// Written by Curtis Olson, started May, 2003. - -#include - -#include - -#include
-#include
- -#include "annunciator.hxx" - - -Annunciator::Annunciator (): - timer0( 0.0 ), - timer1( 0.0 ), - timer2( 0.0 ), - timer3( 0.0 ), - timer4( 0.0 ) -{ -} - -Annunciator::~Annunciator () -{ -} - -void -Annunciator::init () -{ - _volts = fgGetNode( "/systems/electrical/volts", true ); - _vac_l = fgGetNode( "/systems/vacuum[0]/suction-inhg", true ); - _vac_r = fgGetNode( "/systems/vacuum[1]/suction-inhg", true ); - _fuel_l = fgGetNode( "/consumables/fuel/tank[0]/level-gal_us", true ); - _fuel_r = fgGetNode( "/consumables/fuel/tank[1]/level-gal_us", true ); - _oil_px = fgGetNode( "/engines/engine[0]/oil-pressure-psi", true ); - _elec_serv = fgGetNode( "/systems/electrical/serviceable", true ); - - _ann_volts = fgGetNode( "/instrumentation/annunciator/volts", true ); - _ann_vac_l = fgGetNode( "/instrumentation/annunciator/vacuum-left", true ); - _ann_vac_r = fgGetNode( "/instrumentation/annunciator/vacuum-right", true ); - _ann_fuel_l = fgGetNode( "/instrumentation/annunciator/fuel-left", true ); - _ann_fuel_r = fgGetNode( "/instrumentation/annunciator/fuel-right", true ); - _ann_oil_px = fgGetNode( "/instrumentation/annunciator/oil-pressure", true ); -} - -void -Annunciator::update (double dt) -{ - // timers - timer0 += dt; - timer1 += dt; - timer2 += dt; - timer3 += dt; - timer4 += dt; - - if ( _volts->getDoubleValue() < 5.0 || !_elec_serv->getBoolValue() ) { - // Not enough juice to illuminate the display - _ann_volts->setBoolValue( false ); - _ann_vac_l->setBoolValue( false ); - _ann_vac_r->setBoolValue( false ); - _ann_fuel_l->setBoolValue( false ); - _ann_fuel_r->setBoolValue( false ); - _ann_oil_px->setBoolValue( false ); - } else { - // Volts - if ( _volts->getDoubleValue() < 24.5 ) { - if ( timer1 < 10 ) { - double rem = timer0 - (int)timer0; - if ( rem <= 0.5 ) { - _ann_volts->setBoolValue( true ); - } else { - _ann_volts->setBoolValue( false ); - } - } else { - _ann_volts->setBoolValue( true ); - } - } else { - _ann_volts->setBoolValue( false ); - timer1 = 0.0; - } - - if ( _fuel_l->getDoubleValue() < 5.0 - && _fuel_r->getDoubleValue() < 5.0 ) - { - if ( timer2 < 10 ) { - double rem = timer0 - (int)timer0; - if ( rem <= 0.5 ) { - _ann_fuel_l->setBoolValue( true ); - _ann_fuel_r->setBoolValue( true ); - } else { - _ann_fuel_l->setBoolValue( false ); - _ann_fuel_r->setBoolValue( false ); - } - } else { - _ann_fuel_l->setBoolValue( true ); - _ann_fuel_r->setBoolValue( true ); - } - } else if ( _fuel_l->getDoubleValue() < 5.0 ) { - if ( timer2 < 10 ) { - double rem = timer0 - (int)timer0; - if ( rem <= 0.5 ) { - _ann_fuel_l->setBoolValue( true ); - } else { - _ann_fuel_l->setBoolValue( false ); - } - } else { - _ann_fuel_l->setBoolValue( true ); - } - _ann_fuel_r->setBoolValue( false ); - } else if ( _fuel_r->getDoubleValue() < 5.0 ) { - if ( timer2 < 10 ) { - double rem = timer0 - (int)timer0; - if ( rem <= 0.5 ) { - _ann_fuel_r->setBoolValue( true ); - } else { - _ann_fuel_r->setBoolValue( false ); - } - } else { - _ann_fuel_r->setBoolValue( true ); - } - _ann_fuel_l->setBoolValue( false ); - } else { - _ann_fuel_l->setBoolValue( false ); - _ann_fuel_r->setBoolValue( false ); - timer2 = 0.0; - } - - // vacuum pumps - if ( _vac_l->getDoubleValue() < 3.0 - && _vac_r->getDoubleValue() < 3.0 ) - { - if ( timer3 < 10 ) { - double rem = timer0 - (int)timer0; - if ( rem <= 0.5 ) { - _ann_vac_l->setBoolValue( true ); - _ann_vac_r->setBoolValue( true ); - } else { - _ann_vac_l->setBoolValue( false ); - _ann_vac_r->setBoolValue( false ); - } - } else { - _ann_vac_l->setBoolValue( true ); - _ann_vac_r->setBoolValue( true ); - } - } else if ( _vac_l->getDoubleValue() < 3.0 ) { - if ( timer3 < 10 ) { - double rem = timer0 - (int)timer0; - if ( rem <= 0.5 ) { - _ann_vac_l->setBoolValue( true ); - } else { - _ann_vac_l->setBoolValue( false ); - } - } else { - _ann_vac_l->setBoolValue( true ); - } - _ann_vac_r->setBoolValue( false ); - } else if ( _vac_r->getDoubleValue() < 3.0 ) { - if ( timer3 < 10 ) { - double rem = timer0 - (int)timer0; - if ( rem <= 0.5 ) { - _ann_vac_r->setBoolValue( true ); - } else { - _ann_vac_r->setBoolValue( false ); - } - } else { - _ann_vac_r->setBoolValue( true ); - } - _ann_vac_l->setBoolValue( false ); - } else { - _ann_vac_l->setBoolValue( false ); - _ann_vac_r->setBoolValue( false ); - timer3 = 0.0; - } - - // Oil pressure - if ( _oil_px->getDoubleValue() < 20.0 ) { - if ( timer4 < 10 ) { - double rem = timer0 - (int)timer0; - if ( rem <= 0.5 ) { - _ann_oil_px->setBoolValue( true ); - } else { - _ann_oil_px->setBoolValue( false ); - } - } else { - _ann_oil_px->setBoolValue( true ); - } - } else { - _ann_oil_px->setBoolValue( false ); - timer4 = 0.0; - } - } -} - - -// end of annunciator.cxx diff --git a/src/Instrumentation/annunciator.hxx b/src/Instrumentation/annunciator.hxx deleted file mode 100644 index 6da4fcc53..000000000 --- a/src/Instrumentation/annunciator.hxx +++ /dev/null @@ -1,69 +0,0 @@ -// annunciator.hxx - manage the annunciator states -// Written by Curtis Olson, started May, 2003. - - -#ifndef __INSTRUMENTS_ANNUNCIATOR_HXX -#define __INSTRUMENTS_ANNUNCIATOR_HXX 1 - -#ifndef __cplusplus -# error This library requires C++ -#endif - -#include -#include - - -/** - * Model the annunciators. This is innitially hard coded for a C172S - * - * Input properties: - * - * Amps - * L/R Fuel qty - * L/R Vacuum pumps - * Oil pressure - * - * Output properties: - * - * /instrumentation/airspeed-indicator/indicated-speed-kt - */ -class Annunciator : public SGSubsystem -{ - - // timers - double timer0; // used to sync flashing - double timer1; - double timer2; - double timer3; - double timer4; - - // inputs - SGPropertyNode_ptr _volts; - SGPropertyNode_ptr _vac_l; - SGPropertyNode_ptr _vac_r; - SGPropertyNode_ptr _fuel_l; - SGPropertyNode_ptr _fuel_r; - SGPropertyNode_ptr _oil_px; - SGPropertyNode_ptr _elec_serv; - - // outputs - SGPropertyNode_ptr _ann_volts; // VOLTS (red) - SGPropertyNode_ptr _ann_vac_l; // L VAC (amber) - SGPropertyNode_ptr _ann_vac_r; // VAC R (amber - SGPropertyNode_ptr _ann_fuel_l; // L LOW FUEL (amber) - SGPropertyNode_ptr _ann_fuel_r; // LOW FUEL R (amber) - SGPropertyNode_ptr _ann_oil_px; // OIL PRESS (red) - -public: - - Annunciator (); - virtual ~Annunciator (); - - virtual void init (); - virtual void update (double dt); - -private: - -}; - -#endif // __INSTRUMENTS_ANNUNCIATOR_HXX diff --git a/src/Instrumentation/instrument_mgr.cxx b/src/Instrumentation/instrument_mgr.cxx index 9bc9172c5..777110bce 100644 --- a/src/Instrumentation/instrument_mgr.cxx +++ b/src/Instrumentation/instrument_mgr.cxx @@ -24,7 +24,6 @@ #include "adf.hxx" #include "airspeed_indicator.hxx" #include "altimeter.hxx" -#include "annunciator.hxx" #include "attitude_indicator.hxx" #include "clock.hxx" #include "dme.hxx" @@ -53,7 +52,6 @@ FGInstrumentMgr::FGInstrumentMgr () { - set_subsystem("annunciator", new Annunciator); set_subsystem("od_gauge", new FGODGauge, 1.0); set_subsystem("hud", new HUD);