Moved PatternLeg from AILocalTraffic to AIPlane
This commit is contained in:
parent
ae84180ee7
commit
139f3df761
3 changed files with 26 additions and 24 deletions
|
@ -35,20 +35,6 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
SG_USING_STD(string);
|
SG_USING_STD(string);
|
||||||
|
|
||||||
enum PatternLeg {
|
|
||||||
TAKEOFF_ROLL,
|
|
||||||
CLIMBOUT,
|
|
||||||
TURN1,
|
|
||||||
CROSSWIND,
|
|
||||||
TURN2,
|
|
||||||
DOWNWIND,
|
|
||||||
TURN3,
|
|
||||||
BASE,
|
|
||||||
TURN4,
|
|
||||||
FINAL,
|
|
||||||
LANDING_ROLL
|
|
||||||
};
|
|
||||||
|
|
||||||
enum TaxiState {
|
enum TaxiState {
|
||||||
TD_INBOUND,
|
TD_INBOUND,
|
||||||
TD_OUTBOUND,
|
TD_OUTBOUND,
|
||||||
|
@ -94,7 +80,7 @@ public:
|
||||||
void RegisterTransmission(int code);
|
void RegisterTransmission(int code);
|
||||||
|
|
||||||
// This is a hack and will probably go eventually
|
// This is a hack and will probably go eventually
|
||||||
inline bool AtHoldShort() {return(holdingShort);}
|
inline bool AtHoldShort() {return holdingShort;}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
@ -156,7 +142,7 @@ private:
|
||||||
int numInPattern; // Number of planes in the pattern (this might get more complicated if high performance GA aircraft fly a higher pattern eventually)
|
int numInPattern; // Number of planes in the pattern (this might get more complicated if high performance GA aircraft fly a higher pattern eventually)
|
||||||
int numAhead; // More importantly - how many of them are ahead of us?
|
int numAhead; // More importantly - how many of them are ahead of us?
|
||||||
double distToNext; // And even more importantly, how near are we getting to the one immediately ahead?
|
double distToNext; // And even more importantly, how near are we getting to the one immediately ahead?
|
||||||
PatternLeg leg; // Out current position in the pattern
|
//PatternLeg leg; // Our current position in the pattern - now moved to FGAIPlane
|
||||||
StartofDescent SoD; // Start of descent calculated wrt wind, pattern size & altitude, glideslope etc
|
StartofDescent SoD; // Start of descent calculated wrt wind, pattern size & altitude, glideslope etc
|
||||||
|
|
||||||
// Taxiing details
|
// Taxiing details
|
||||||
|
|
|
@ -30,6 +30,10 @@ SG_USING_STD(string);
|
||||||
#include "AIPlane.hxx"
|
#include "AIPlane.hxx"
|
||||||
#include "ATCdisplay.hxx"
|
#include "ATCdisplay.hxx"
|
||||||
|
|
||||||
|
FGAIPlane::FGAIPlane() {
|
||||||
|
leg = LEG_UNKNOWN;
|
||||||
|
}
|
||||||
|
|
||||||
FGAIPlane::~FGAIPlane() {
|
FGAIPlane::~FGAIPlane() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,14 +18,6 @@
|
||||||
// along with this program; if not, write to the Free Software
|
// along with this program; if not, write to the Free Software
|
||||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
|
||||||
/*****************************************************************
|
|
||||||
*
|
|
||||||
* WARNING - Curt has some ideas about AI traffic so anything in here
|
|
||||||
* may get rewritten or scrapped. Contact Curt curt@flightgear.org
|
|
||||||
* before spending any time or effort on this code!!!
|
|
||||||
*
|
|
||||||
******************************************************************/
|
|
||||||
|
|
||||||
#ifndef _FG_AI_PLANE_HXX
|
#ifndef _FG_AI_PLANE_HXX
|
||||||
#define _FG_AI_PLANE_HXX
|
#define _FG_AI_PLANE_HXX
|
||||||
|
|
||||||
|
@ -37,6 +29,20 @@
|
||||||
#include "AIEntity.hxx"
|
#include "AIEntity.hxx"
|
||||||
#include "ATC.hxx"
|
#include "ATC.hxx"
|
||||||
|
|
||||||
|
enum PatternLeg {
|
||||||
|
TAKEOFF_ROLL,
|
||||||
|
CLIMBOUT,
|
||||||
|
TURN1,
|
||||||
|
CROSSWIND,
|
||||||
|
TURN2,
|
||||||
|
DOWNWIND,
|
||||||
|
TURN3,
|
||||||
|
BASE,
|
||||||
|
TURN4,
|
||||||
|
FINAL,
|
||||||
|
LANDING_ROLL,
|
||||||
|
LEG_UNKNOWN
|
||||||
|
};
|
||||||
|
|
||||||
/*****************************************************************
|
/*****************************************************************
|
||||||
*
|
*
|
||||||
|
@ -51,6 +57,7 @@ class FGAIPlane : public FGAIEntity {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
FGAIPlane();
|
||||||
virtual ~FGAIPlane();
|
virtual ~FGAIPlane();
|
||||||
|
|
||||||
// Run the internal calculations
|
// Run the internal calculations
|
||||||
|
@ -59,6 +66,9 @@ public:
|
||||||
// Send a transmission *TO* the AIPlane.
|
// Send a transmission *TO* the AIPlane.
|
||||||
// FIXME int code is a hack - eventually this will receive Alexander's coded messages.
|
// FIXME int code is a hack - eventually this will receive Alexander's coded messages.
|
||||||
virtual void RegisterTransmission(int code);
|
virtual void RegisterTransmission(int code);
|
||||||
|
|
||||||
|
// Return the current pattern leg the plane is flying.
|
||||||
|
inline PatternLeg GetLeg() {return leg;}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
PlaneRec plane;
|
PlaneRec plane;
|
||||||
|
@ -86,6 +96,8 @@ protected:
|
||||||
|
|
||||||
void Bank(double angle);
|
void Bank(double angle);
|
||||||
void LevelWings(void);
|
void LevelWings(void);
|
||||||
|
|
||||||
|
PatternLeg leg;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _FG_AI_PLANE_HXX
|
#endif // _FG_AI_PLANE_HXX
|
||||||
|
|
Loading…
Add table
Reference in a new issue