32 std::string_view
getTypeString(
void)
const override {
return "aircraft"; }
36 void update(
double dt)
override;
39 void setPerformance(
const std::string& acType,
const std::string& perfString);
44 void initializeFlightPlan();
60 void YawTo(
double angle);
64 void TurnTo(
double heading);
72 void setAcType(
const std::string& ac) { acType = ac; };
73 const std::string&
getAcType()
const {
return acType; }
75 const std::string&
getCompany()
const {
return company; }
76 void setCompany(
const std::string& comp) { company = comp; };
98 inline double altitudeAGL()
const {
return props->getFloatValue(
"position/altitude-agl-ft"); };
99 inline double airspeed()
const {
return props->getFloatValue(
"velocities/airspeed-kt"); };
100 const std::string&
atGate();
111 void dumpCSV(
const std::unique_ptr<sg_ofstream>& o,
int lineIndex);
125 double dt_elev_count;
126 double headingChangeRate;
129 double speedFraction;
132 double groundTargetSpeed;
136 SGPropertyNode_ptr refuel_node;
137 SGPropertyNode_ptr tcasThreatNode;
138 SGPropertyNode_ptr tcasRANode;
143 bool fpExecutable(time_t now);
144 void handleFirstWaypoint(
void);
146 bool handleAirportEndPoints(
FGAIWaypoint* prev, time_t now);
147 bool reachedEndOfCruise(
double&);
148 bool aiTrafficVisible(
void);
153 void updatePrimaryTargetValues(
double dt,
bool& flightplanActive,
bool& aiOutOfSight);
154 void updateSecondaryTargetValues(
double dt);
155 void updateHeading(
double dt);
156 void updateBankAngleTarget();
157 void updateVerticalSpeedTarget(
double dt);
158 void updatePitchAngleTarget();
159 void updateActualState(
double dt);
160 void updateModelProperties(
double dt);
162 void updateUserFlightPlan(
double dt);
165 int determineNextLeg(
int leg);
166 void handleATCRequests(
double dt);
168 inline bool isStationary()
173 inline bool needGroundElevation()
176 _needsGroundElevation =
true;
177 return _needsGroundElevation;
180 double sign(
double x);
183 std::string getTimeString(
int timeOffset);
186 void lazyInitControlsNodes();
190 std::string transponderCode;
195 const int AI_STUCK_LIMIT = 100000;
196 int stuckCounter = 0;
197 bool tracked =
false;
202 bool repositioned =
false;
204 double prev_dist_to_go;
206 bool holdPos =
false;
209 const char* _getTransponderCode()
const;
211 bool needsTaxiClearance =
false;
212 bool _needsGroundElevation =
true;
213 time_t timeElapsed{0};
215 PerformanceData* _performance;
218 void assertSpeed(
double speed);
229 SGPropertyNode_ptr _controlsLateralModeNode,
230 _controlsVerticalModeNode,
231 _controlsTargetHeadingNode,
232 _controlsTargetRollNode,
233 _controlsTargetAltitude,
234 _controlsTargetPitch,
235 _controlsTargetSpeed;
237 std::unique_ptr<sg_ofstream> csvFile;
void dumpCSVHeader(const std::unique_ptr< sg_ofstream > &o)
void clearATCController()
void setPerformance(const std::string &acType, const std::string &perfString)
double getVerticalSpeedFPM() const
double getBearing(double crse)
Returns a normalised bearing.
PerformanceData * getPerformance()
void setTrafficRef(FGAISchedule *ref)
FGAIAircraft(FGAISchedule *ref=0)
void dumpCSV(const std::unique_ptr< sg_ofstream > &o, int lineIndex)
void getGroundElev(double dt)
time_t checkForArrivalTime(const std::string &wptName)
void setAcType(const std::string &ac)
double getAltitude() const
FGAIFlightPlan * GetFlightPlan() const
std::string_view getTypeString(void) const override
bool loadNextLeg(double dist=0)
void TurnTo(double heading)
void ProcessFlightPlan(double dt, time_t now)
FGATCController * getATCController()
double altitudeAGL() const
void processATC(const FGATCInstruction &instruction)
Process ATC instructions and report back.
const std::string & getCompany() const
void PitchTo(double angle)
void resetPositionFromFlightPlan()
void AccelTo(double speed)
void setTaxiClearanceRequest(bool arg)
FGAISchedule * getTrafficRef()
void RollTo(double angle)
void setCompany(const std::string &comp)
void update(double dt) override
const std::string & getAcType() const
std::string acwakecategory
double calcVerticalSpeed(double vert_ft, double dist_m, double speed, double error)
bool getTaxiClearanceRequest()
const std::string & GetTransponderCode()
bool isBlockedBy(FGAIAircraft *other)
void SetTransponderCode(const std::string &tc)
void ClimbTo(double altitude)
void readFromScenario(SGPropertyNode *scFileNode) override
void announcePositionToController()
const std::string & atGate()
void setFlightPlan(const std::string &fp, bool repat=false)
void scheduleForATCTowerRunwayControl()
FGAIBaseAircraft(object_type otype=object_type::otAircraft)
std::unique_ptr< FGAIFlightPlan > fp
class FGATCController NOTE: this class serves as an abstraction layer for all sorts of ATC controller...