]> git.mxchange.org Git - flightgear.git/commitdiff
Change condition lever position from an "int" to a "double".
authorcurt <curt>
Tue, 27 Jul 2004 20:39:01 +0000 (20:39 +0000)
committercurt <curt>
Tue, 27 Jul 2004 20:39:01 +0000 (20:39 +0000)
src/Controls/controls.cxx
src/Controls/controls.hxx

index c66088873896e58f001f8bf543fecbecf5a7f8b7..22a69581483d527543823fc30537bbacafb352e5 100644 (file)
@@ -148,7 +148,7 @@ void FGControls::reset_all()
     set_augmentation( ALL_ENGINES, false );
     set_reverser( ALL_ENGINES, false );
     set_water_injection( ALL_ENGINES, false );
-    set_condition( ALL_ENGINES, 0 );
+    set_condition( ALL_ENGINES, 1.0 );
     throttle_idle = true;
     set_fuel_selector( ALL_TANKS, true );
     dump_valve = false;
@@ -201,7 +201,7 @@ FGControls::init ()
         water_injection[engine] = false;
         nitrous_injection[engine] = false;
         cowl_flaps_norm[engine] = 0.0;
-        condition[engine] = 0;
+        condition[engine] = 1.0;
     }
 
     brake_left = brake_right = brake_parking = 0.0;
@@ -348,7 +348,8 @@ FGControls::bind ()
          &FGControls::set_cowl_flaps_norm);
     fgSetArchivable(name);
 
-    snprintf(name, MAX_NAME_LEN, "/controls/engines/engine[%d]/feather", index);
+    snprintf(name, MAX_NAME_LEN,
+             "/controls/engines/engine[%d]/propeller-feather", index);
     fgTie(name, this, index,
         &FGControls::get_feather, &FGControls::set_feather);
     fgSetArchivable(name);
@@ -841,7 +842,8 @@ void FGControls::unbind ()
     snprintf(name, MAX_NAME_LEN,
              "/controls/engines/engine[%d]/cowl-flaps-norm", index);
     fgUntie(name);
-    snprintf(name, MAX_NAME_LEN, "/controls/engines/engine[%d]/feather", index);
+    snprintf(name, MAX_NAME_LEN,
+             "/controls/engines/engine[%d]/propeller-feather", index);
     fgUntie(name);
     snprintf(name, MAX_NAME_LEN,
              "/controls/engines/engine[%d]/ignition", index);
@@ -1521,17 +1523,15 @@ FGControls::set_water_injection( int engine, bool val )
 }
 
 void
-FGControls::set_condition( int engine, int val )
+FGControls::set_condition( int engine, double val )
 {
     if ( engine == ALL_ENGINES ) {
        for ( int i = 0; i < MAX_ENGINES; i++ ) {
            condition[i] = val;
-           CLAMP( &condition[i], 0, 3 );
        }
     } else {
        if ( (engine >= 0) && (engine < MAX_ENGINES) ) {
            condition[engine] = val;
-           CLAMP( &condition[engine], 0, 3 );
        }
     }
 }
index e55c4c38bffb431c82988e2bb7586a6a7b839e56..209e26d79f6e28d16b0d0630bb049eaf4b3bd82d 100644 (file)
@@ -140,7 +140,7 @@ private:
     bool augmentation[MAX_ENGINES];
     bool reverser[MAX_ENGINES];
     bool water_injection[MAX_ENGINES];
-    int condition[MAX_ENGINES];           // turboprop speed select
+    double condition[MAX_ENGINES];           // turboprop speed select
 
     // controls/fuel/
     bool dump_valve;
@@ -316,7 +316,7 @@ public:
     inline bool get_water_injection(int engine) const { 
         return water_injection[engine]; 
     }
-    inline int get_condition(int engine) const { return condition[engine]; }
+    inline double get_condition(int engine) const { return condition[engine]; }
 
     // controls/fuel/
     inline bool get_dump_valve() const { return dump_valve; }
@@ -501,7 +501,7 @@ public:
     void set_augmentation( int engine, bool val );
     void set_reverser( int engine, bool val );
     void set_water_injection( int engine, bool val );
-    void set_condition( int engine, int val );    
+    void set_condition( int engine, double val );    
 
     // controls/fuel
     void set_dump_valve( bool val );