]> git.mxchange.org Git - flightgear.git/blobdiff - src/Controls/controls.hxx
Comment out the unalias code also.
[flightgear.git] / src / Controls / controls.hxx
index 2e467a5ae5fdb02f1c670289c129d59cd546bb38..82f9b92336cbfbed7c80fa3097e8012c2e27348e 100644 (file)
@@ -25,8 +25,8 @@
 #define _CONTROLS_HXX
 
 #include <simgear/props/props.hxx>
+#include <simgear/structure/subsystem_mgr.hxx>
 
-#include <Main/fgfs.hxx>
 #include <Main/globals.hxx>
 
 #ifndef __cplusplus                                                          
@@ -36,7 +36,7 @@
 
 // Define a structure containing the control parameters
 
-class FGControls : public FGSubsystem
+class FGControls : public SGSubsystem
 {
 
 public:
@@ -86,6 +86,23 @@ public:
        MAX_AUTOPILOTS = 3
     };
 
+    enum {
+       ALL_EJECTION_SEATS = -1,
+       MAX_EJECTION_SEATS = 10
+    };
+   
+    enum {
+       SEAT_SAFED = -1,
+       SEAT_ARMED = 0,
+       SEAT_FAIL = 1
+    };
+   
+    enum { 
+       CMD_SEL_NORM = -1,
+       CMD_SEL_AFT = 0,
+       CMD_SEL_SOLO = 1
+    };
+    
 private:
     // controls/flight/
     double aileron;
@@ -123,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;
@@ -137,7 +154,11 @@ private:
     bool boost_pump[MAX_TANKS * MAX_BOOSTPUMPS];
 
     // controls/gear/
-    double parking_brake;
+    double brake_left;
+    double brake_right;
+    double copilot_brake_left;
+    double copilot_brake_right;
+    double brake_parking;
     double steering;
     bool gear_down;
     bool antiskid;
@@ -145,7 +166,6 @@ private:
     bool tailwheel_lock;
 
     // controls/gear/wheel[n]/
-    double brake[MAX_WHEELS];
     bool alternate_extension[MAX_WHEELS];
 
     // controls/anti-ice/
@@ -211,7 +231,9 @@ private:
     // controls/seat/
     double vertical_adjust;
     double fore_aft_adjust;
-    bool eject;
+    bool eject[MAX_EJECTION_SEATS];
+    int eseat_status[MAX_EJECTION_SEATS];
+    int cmd_selector_valve;
 
     // controls/APU/
     int off_start_run;
@@ -240,7 +262,7 @@ public:
     FGControls();
     ~FGControls();
 
-    // Implementation of FGSubsystem.
+    // Implementation of SGSubsystem.
     void init ();
     void bind ();
     void unbind ();
@@ -296,7 +318,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; }
@@ -314,7 +336,11 @@ public:
     }
 
     // controls/gear/
-    inline double get_parking_brake() const { return parking_brake; }
+    inline double get_brake_left() const { return brake_left; }
+    inline double get_brake_right() const { return brake_right; }
+    inline double get_copilot_brake_left() const { return copilot_brake_left; }
+    inline double get_copilot_brake_right() const { return copilot_brake_right; }
+    inline double get_brake_parking() const { return brake_parking; }
     inline double get_steering() const { return steering; }
     inline bool get_gear_down() const { return gear_down; }
     inline bool get_antiskid() const { return antiskid; }
@@ -322,7 +348,6 @@ public:
     inline bool get_tailwheel_lock() const { return tailwheel_lock; }
 
     // controls/gear/wheel[n]/
-    inline double get_brake(int wheel) const { return brake[wheel]; }
     inline bool get_alternate_extension(int wheel) const {
         return alternate_extension[wheel];
     }
@@ -394,7 +419,14 @@ public:
     // controls/seat/
     inline double get_vertical_adjust() const { return vertical_adjust; }
     inline double get_fore_aft_adjust() const { return fore_aft_adjust; }
-    inline bool get_eject() const { return eject; }
+    inline bool get_ejection_seat( int which_seat ) const {
+        return eject[which_seat];
+    }
+    inline int get_eseat_status( int which_seat ) const {
+        return eseat_status[which_seat];
+    }
+    inline int get_cmd_selector_valve() const { return cmd_selector_valve; }
+    
 
     // controls/APU/
     inline int get_off_start_run() const { return off_start_run; }
@@ -473,7 +505,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 );
@@ -487,7 +519,13 @@ public:
     void set_boost_pump( int index, bool val );
 
     // controls/gear/
-    void set_parking_brake( double pos );
+    void set_brake_left( double pos );
+    void move_brake_left( double amt );
+    void set_brake_right( double pos );
+    void move_brake_right( double amt );
+    void set_copilot_brake_left( double pos );
+    void set_copilot_brake_right( double pos );
+    void set_brake_parking( double pos );
     void set_steering( double pos );
     void move_steering( double amt );
     void set_gear_down( bool gear );
@@ -496,8 +534,6 @@ public:
     void set_tailwheel_lock( bool val );
 
     // controls/gear/wheel[n]/
-    void set_brake( int wheel, double pos );
-    void move_brake( int wheel, double amt );
     void set_alternate_extension( int wheel, bool val );
 
     // controls/anti-ice/
@@ -571,7 +607,9 @@ public:
     void move_vertical_adjust( double amt );
     void set_fore_aft_adjust( double pos );
     void move_fore_aft_adjust( double amt );
-    void set_eject( bool val );
+    void set_ejection_seat( int which_seat, bool val );
+    void set_eseat_status( int which_seat, int val );
+    void set_cmd_selector_valve( int val );
 
     // controls/APU/
     void set_off_start_run( int pos );