Refactor controls.cxx: use simgear functions
- use TiedPropertyList - use SG_CLAMP_RANGE
This commit is contained in:
parent
03aac3de8b
commit
fff48bdd6a
2 changed files with 762 additions and 1189 deletions
File diff suppressed because it is too large
Load diff
|
@ -25,6 +25,7 @@
|
||||||
#define _CONTROLS_HXX
|
#define _CONTROLS_HXX
|
||||||
|
|
||||||
#include <simgear/structure/subsystem_mgr.hxx>
|
#include <simgear/structure/subsystem_mgr.hxx>
|
||||||
|
#include <simgear/props/tiedpropertylist.hxx>
|
||||||
|
|
||||||
// Define a structure containing the control parameters
|
// Define a structure containing the control parameters
|
||||||
|
|
||||||
|
@ -34,65 +35,65 @@ class FGControls : public SGSubsystem
|
||||||
public:
|
public:
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
ALL_ENGINES = -1,
|
ALL_ENGINES = -1,
|
||||||
MAX_ENGINES = 12
|
MAX_ENGINES = 12
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
ALL_WHEELS = -1,
|
ALL_WHEELS = -1,
|
||||||
MAX_WHEELS = 3
|
MAX_WHEELS = 3
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
ALL_TANKS = -1,
|
ALL_TANKS = -1,
|
||||||
MAX_TANKS = 8
|
MAX_TANKS = 8
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
ALL_BOOSTPUMPS = -1,
|
ALL_BOOSTPUMPS = -1,
|
||||||
MAX_BOOSTPUMPS = 2
|
MAX_BOOSTPUMPS = 2
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
ALL_HYD_SYSTEMS = -1,
|
ALL_HYD_SYSTEMS = -1,
|
||||||
MAX_HYD_SYSTEMS = 4
|
MAX_HYD_SYSTEMS = 4
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
ALL_PACKS = -1,
|
ALL_PACKS = -1,
|
||||||
MAX_PACKS = 4
|
MAX_PACKS = 4
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
ALL_LIGHTS = -1,
|
ALL_LIGHTS = -1,
|
||||||
MAX_LIGHTS = 4
|
MAX_LIGHTS = 4
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
ALL_STATIONS = -1,
|
ALL_STATIONS = -1,
|
||||||
MAX_STATIONS = 12
|
MAX_STATIONS = 12
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
ALL_AUTOPILOTS = -1,
|
ALL_AUTOPILOTS = -1,
|
||||||
MAX_AUTOPILOTS = 3
|
MAX_AUTOPILOTS = 3
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
ALL_EJECTION_SEATS = -1,
|
ALL_EJECTION_SEATS = -1,
|
||||||
MAX_EJECTION_SEATS = 10
|
MAX_EJECTION_SEATS = 10
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
SEAT_SAFED = -1,
|
SEAT_SAFED = -1,
|
||||||
SEAT_ARMED = 0,
|
SEAT_ARMED = 0,
|
||||||
SEAT_FAIL = 1
|
SEAT_FAIL = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
CMD_SEL_NORM = -1,
|
CMD_SEL_NORM = -1,
|
||||||
CMD_SEL_AFT = 0,
|
CMD_SEL_AFT = 0,
|
||||||
CMD_SEL_SOLO = 1
|
CMD_SEL_SOLO = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -252,7 +253,7 @@ private:
|
||||||
|
|
||||||
|
|
||||||
SGPropertyNode_ptr auto_coordination;
|
SGPropertyNode_ptr auto_coordination;
|
||||||
|
simgear::TiedPropertyList _tiedProperties;
|
||||||
public:
|
public:
|
||||||
|
|
||||||
FGControls();
|
FGControls();
|
||||||
|
@ -266,7 +267,7 @@ public:
|
||||||
|
|
||||||
// Reset function
|
// Reset function
|
||||||
void reset_all(void);
|
void reset_all(void);
|
||||||
|
|
||||||
// Query functions
|
// Query functions
|
||||||
// controls/flight/
|
// controls/flight/
|
||||||
inline double get_aileron() const { return aileron; }
|
inline double get_aileron() const { return aileron; }
|
||||||
|
@ -298,7 +299,7 @@ public:
|
||||||
inline bool get_cutoff(int engine) const { return cutoff[engine]; }
|
inline bool get_cutoff(int engine) const { return cutoff[engine]; }
|
||||||
inline double get_mixture(int engine) const { return mixture[engine]; }
|
inline double get_mixture(int engine) const { return mixture[engine]; }
|
||||||
inline double get_prop_advance(int engine) const {
|
inline double get_prop_advance(int engine) const {
|
||||||
return prop_advance[engine];
|
return prop_advance[engine];
|
||||||
}
|
}
|
||||||
inline int get_magnetos(int engine) const { return magnetos[engine]; }
|
inline int get_magnetos(int engine) const { return magnetos[engine]; }
|
||||||
inline int get_feed_tank(int engine) const { return feed_tank[engine]; }
|
inline int get_feed_tank(int engine) const { return feed_tank[engine]; }
|
||||||
|
|
Loading…
Add table
Reference in a new issue