- int id, waitsForId;
- int currentPos;
- int leg;
- int frequencyId;
- int state;
- bool allowTransmission;
- time_t timer;
- intVec intentions;
- FGATCInstruction instruction;
- double latitude, longitude, heading, speed, altitude, radius;
- string runway;
- //FGAISchedule *trafficRef;
- FGAIAircraft *aircraft;
-
-
-public:
- FGTrafficRecord();
-
- void setId(int val) { id = val; };
- void setRadius(double rad) { radius = rad;};
- void setPositionAndIntentions(int pos, FGAIFlightPlan *route);
- void setRunway(string rwy) { runway = rwy;};
- void setLeg(int lg) { leg = lg;};
- int getId() { return id;};
- int getState() { return state;};
- void setState(int s) { state = s;}
- FGATCInstruction getInstruction() { return instruction;};
- bool hasInstruction() { return instruction.hasInstruction(); };
- void setPositionAndHeading(double lat, double lon, double hdg, double spd, double alt);
- bool checkPositionAndIntentions(FGTrafficRecord &other);
- int crosses (FGGroundNetwork *, FGTrafficRecord &other);
- bool isOpposing (FGGroundNetwork *, FGTrafficRecord &other, int node);
-
- bool onRoute(FGGroundNetwork *, FGTrafficRecord &other);
-
- bool getSpeedAdjustment() { return instruction.getChangeSpeed(); };
-
- double getLatitude () { return latitude ; };
- double getLongitude() { return longitude; };
- double getHeading () { return heading ; };
- double getSpeed () { return speed ; };
- double getAltitude () { return altitude ; };
- double getRadius () { return radius ; };
-
- int getWaitsForId () { return waitsForId; };
-
- void setSpeedAdjustment(double spd);
- void setHeadingAdjustment(double heading);
- void clearSpeedAdjustment () { instruction.setChangeSpeed (false); };
- void clearHeadingAdjustment() { instruction.setChangeHeading(false); };
-
- bool hasHeadingAdjustment() { return instruction.getChangeHeading(); };
- bool hasHoldPosition() { return instruction.getHoldPosition(); };
- void setHoldPosition (bool inst) { instruction.setHoldPosition(inst); };
-
- void setWaitsForId(int id) { waitsForId = id; };
-
- void setResolveCircularWait() { instruction.setResolveCircularWait(true); };
- void clearResolveCircularWait() { instruction.setResolveCircularWait(false); };
-
- string getRunway() { return runway; };
- //void setCallSign(string clsgn) { callsign = clsgn; };
- void setAircraft(FGAIAircraft *ref) { aircraft = ref;};
- void updateState() { state++; allowTransmission=true; };
- //string getCallSign() { return callsign; };
- FGAIAircraft *getAircraft() { return aircraft;};
- int getTime() { return timer; };
- int getLeg() { return leg; };
- void setTime(time_t time) { timer = time; };
-
- bool pushBackAllowed();
- bool allowTransmissions() { return allowTransmission; };
- void suppressRepeatedTransmissions () { allowTransmission=false; };
- void allowRepeatedTransmissions () { allowTransmission=true; };
- void nextFrequency() { frequencyId++; };
- int getNextFrequency() { return frequencyId; };
- intVec& getIntentions() { return intentions; };
- int getCurrentPosition() { return currentPos; };
-};
-
-typedef vector<FGTrafficRecord> TrafficVector;
-typedef vector<FGTrafficRecord>::iterator TrafficVectorIterator;