]> git.mxchange.org Git - flightgear.git/commitdiff
Fix to use renamed /controls properties.
authordavid <david>
Tue, 1 Apr 2003 15:51:15 +0000 (15:51 +0000)
committerdavid <david>
Tue, 1 Apr 2003 15:51:15 +0000 (15:51 +0000)
src/Controls/controls.cxx
src/FDM/YASim/FGFDM.cpp
src/Main/fgfs.hxx
src/Network/atc610x.cxx
src/Network/opengc.cxx

index 6b0967f7fdf08a55eee0f3100174d1d6ed5c372c..66358a1d01642e39dc7ae8034603d715bb6dc064 100644 (file)
@@ -408,7 +408,7 @@ FGControls::bind ()
   fgTie("/controls/gear/parking-brake", this,
        &FGControls::get_parking_brake, 
         &FGControls::set_parking_brake);
-  fgSetArchivable("/controls/parking-brake");
+  fgSetArchivable("/controls/gear/parking-brake");
 
   fgTie("/controls/gear/steering", this,
        &FGControls::get_steering, &FGControls::set_steering);
index e959df3c781f55e393fe0feb34fe193a18c13cbc..e43113f5064a665dc3b7d16f0193430dfe8c99f6 100644 (file)
@@ -38,10 +38,10 @@ FGFDM::FGFDM()
 {
     _nextEngine = 0;
 
-    // Map /controls/elevator to the approach elevator control.  This
+    // Map /controls/flight/elevator to the approach elevator control.  This
     // should probably be settable, but there are very few aircraft
     // who trim their approaches using things other than elevator.
-    _airplane.setElevatorControl(parseAxis("/controls/elevator-trim"));
+    _airplane.setElevatorControl(parseAxis("/controls/flight/elevator-trim"));
 }
 
 FGFDM::~FGFDM()
@@ -90,7 +90,7 @@ void FGFDM::init()
 
     // This has a nasty habit of being false at startup.  That's not
     // good.
-    fgSetBool("/controls/gear-down", true);
+    fgSetBool("/controls/gear/gear-down", true);
 }
 
 // Not the worlds safest parser.  But it's short & sweet.
index 4d97d23dfa43a8475b33b941702f235b8027c6a1..65472dce818034e2f891a28854d6282d5ace376d 100644 (file)
@@ -70,13 +70,13 @@ SG_USING_STD(map);
  * <pre>
  * void MySubsystem::bind ()
  * {
- *   fgTie("/controls/elevator", &_elevator);
- *   fgSetArchivable("/controls/elevator");
+ *   fgTie("/controls/flight/elevator", &_elevator);
+ *   fgSetArchivable("/controls/flight/elevator");
  * }
  *
  * void MySubsystem::unbind ()
  * {
- *   fgUntie("/controls/elevator");
+ *   fgUntie("/controls/flight/elevator");
  * }
  * </pre>
  *
index 96471bcb69e2c8a4b0e1fc376ef57b3d20570984..c325670790022fdb5934fcb7dd863c7381bcfec4 100644 (file)
@@ -706,45 +706,45 @@ bool FGATC610x::do_analog_in() {
     // aileron
     tmp = scale( ailerons_center->getIntValue(), ailerons_min->getIntValue(),
                  ailerons_max->getIntValue(), analog_in_data[0] );
-    fgSetFloat( "/controls/aileron", tmp );
+    fgSetFloat( "/controls/flight/aileron", tmp );
     // cout << "aileron = " << analog_in_data[0] << " = " << tmp;
     // elevator
     tmp = -scale( elevator_center->getIntValue(), elevator_min->getIntValue(),
                   elevator_max->getIntValue(), analog_in_data[5] );
-    fgSetFloat( "/controls/elevator", tmp );
+    fgSetFloat( "/controls/flight/elevator", tmp );
     // cout << "trim = " << analog_in_data[4] << " = " << tmp;
 
     // elevator trim
     tmp = scale( trim_center->getIntValue(), trim_min->getIntValue(),
                  trim_max->getIntValue(), analog_in_data[4] );
-    fgSetFloat( "/controls/elevator-trim", tmp );
+    fgSetFloat( "/controls/flight/elevator-trim", tmp );
     // cout << " elev = " << analog_in_data[5] << " = " << tmp << endl;
 
     // mixture
     tmp = scale( mixture_min->getIntValue(), mixture_max->getIntValue(),
                  analog_in_data[6] );
-    fgSetFloat( "/controls/mixture[0]", tmp );
-    fgSetFloat( "/controls/mixture[1]", tmp );
+    fgSetFloat( "/controls/engines/engine[0]/mixture", tmp );
+    fgSetFloat( "/controls/engines/engine[1]/mixture", tmp );
 
     // throttle
     tmp = scale( throttle_min->getIntValue(), throttle_max->getIntValue(),
                  analog_in_data[8] );
-    fgSetFloat( "/controls/throttle[0]", tmp );
-    fgSetFloat( "/controls/throttle[1]", tmp );
+    fgSetFloat( "/controls/engines/engine[0]/throttle", tmp );
+    fgSetFloat( "/controls/engines/engine[1]/throttle", tmp );
     // cout << "throttle = " << tmp << endl;
 
     // rudder
     tmp = scale( rudder_center->getIntValue(), rudder_min->getIntValue(),
                  rudder_max->getIntValue(), analog_in_data[10] );
-    fgSetFloat( "/controls/rudder", -tmp );
+    fgSetFloat( "/controls/flight/rudder", -tmp );
 
     // toe brakes
     tmp = scale( brake_left_min->getIntValue(), brake_left_max->getIntValue(),
                  analog_in_data[20] );
-    fgSetFloat( "/controls/brakes[0]", tmp );
+    fgSetFloat( "/controls/gear/wheel[0]/brake", tmp );
     tmp = scale( brake_right_min->getIntValue(), brake_right_max->getIntValue(),
                  analog_in_data[21] );
-    fgSetFloat( "/controls/brakes[1]", tmp );
+    fgSetFloat( "/controls/gear/wheel[1]/brake", tmp );
 
     // nav1 volume
     tmp = (float)analog_in_data[25] / 1024.0f;
@@ -1767,18 +1767,19 @@ bool FGATC610x::do_switches() {
     mag2 = mag1;
     mag1 = magnetos;
     if ( mag1 == mag2 && mag2 == mag3 ) {
-        fgSetInt( "/controls/magnetos[0]", magnetos );
+        fgSetInt( "/controls/engines/engine[0]/magneto", magnetos );
     }
     static bool start1, start2, start3;
     start3 = start2;
     start2 = start1;
     start1 = starter;
     if ( start1 == start2 && start2 == start3 ) {
-        fgSetBool( "/controls/starter[0]", starter );
+        fgSetBool( "/controls/engines/engine[0]/starter", starter );
     }
 
     // other toggle switches
-    fgSetBool( "/controls/fuel-pump[0]", switch_matrix[board][0][2] );
+    fgSetBool( "/controls/engines/engine[0]/fuel-pump",
+               switch_matrix[board][0][2] );
     fgSetBool( "/controls/switches/flashing-beacon",
                switch_matrix[board][1][2] );
     fgSetBool( "/controls/switches/landing-light", switch_matrix[board][2][2] );
@@ -1807,7 +1808,7 @@ bool FGATC610x::do_switches() {
     flap2 = flap1;
     flap1 = flaps;
     if ( flap1 == flap2 && flap2 == flap3 ) {
-        fgSetFloat( "/controls/flaps", flaps );
+        fgSetFloat( "/controls/flight/flaps", flaps );
     }
 
     // fuel selector (also filtered)
@@ -1864,7 +1865,7 @@ bool FGATC610x::do_switches() {
     fgSetBool( "/controls/circuit-breakers/annunciators", true );
 #endif
 
-    fgSetDouble( "/controls/parking-brake",
+    fgSetDouble( "/controls/gear/parking-brake",
                  switch_matrix[board][7][3] );
     fgSetDouble( "/radios/marker-beacon/power-btn",
                  switch_matrix[board][6][1] );
index ec5cf49d17fa8672d9dc8cceb53f8ca75c5eec12..05ce3bbcb6b8745a7014c4bbb098110001a8f85c 100644 (file)
@@ -51,7 +51,7 @@ FGOpenGC::FGOpenGC() :
        p_elevator_trim(fgGetNode("surface-positions/elevator_trim-pos-norm", true)),
        p_rudder(fgGetNode("surface-positions/rudder-pos-norm", true)),
        p_flaps(fgGetNode("surface-positions/flap-pos-norm", true)),
-       p_flaps_cmd(fgGetNode("/controls/flaps", true)),
+       p_flaps_cmd(fgGetNode("/controls/flight/flaps", true)),
        p_alphadot(fgGetNode("/fdm/jsbsim/aero/alphadot-radsec", true)),
        p_betadot(fgGetNode("/fdm/jsbsim/aero/betadot-radsec", true))
 {