FlightGear next
EnRouteController.cxx
Go to the documentation of this file.
1/*
2 * SPDX-FileName: EnRouteController.cxx
3 * SPDX-FileComment: ATC Controller controlling Leg 3/4
4 * SPDX-FileCopyrightText: Copyright (C) 2025 Keith Paterson - keith.paterson@gmx.de
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 */
8
11#include <ATC/ATCController.hxx>
13
14using std::string;
15
16string EnRouteController::getTransponderCode(const string& fltRules)
17{
18 return genTransponderCode(fltRules);
19};
20
23 FGAIFlightPlan* intendedRoute, int currentRoute,
24 double lat, double lon,
25 double heading, double speed,
26 double alt, double radius,
27 int leg,
28 FGAIAircraft* aircraft)
29{
30 // Search activeTraffic for a record matching our id
32
33 // Add a new TrafficRecord if no one exsists for this aircraft.
34 if (i == activeTraffic.end() || activeTraffic.empty()) {
36 rec->setId(id);
37
38 rec->setPositionAndHeading(lat, lon, heading, speed, alt, leg);
39 rec->setRunway(intendedRoute->getRunway());
40 rec->setLeg(leg);
41 rec->setCallsign(aircraft->getCallSign());
42 rec->setAircraft(aircraft);
43 rec->setPlannedArrivalTime(intendedRoute->getArrivalTime());
44 activeTraffic.push_back(rec);
45 } else {
46 (*i)->setRunway(intendedRoute->getRunway());
47 (*i)->setPositionAndHeading(lat, lon, heading, speed, alt, leg);
48 (*i)->setPlannedArrivalTime(intendedRoute->getArrivalTime());
49 }
50};
52 double heading, double speed, double alt, double dt) {};
54std::string EnRouteController::getName() const { return "EnRoute Controller"; };
const double rec
#define i(x)
void announcePosition(int id, FGAIFlightPlan *intendedRoute, int currentRoute, double lat, double lon, double heading, double speed, double alt, double radius, int leg, FGAIAircraft *aircraft)
int getFrequency()
Returns the frequency to be used.
void updateAircraftInformation(int id, SGGeod geod, double heading, double speed, double alt, double dt)
std::string getName() const
string getTransponderCode(const string &fltRules)
const std::string & getCallSign() const
Definition AIBase.hxx:367
const std::string & getRunway() const
time_t getArrivalTime() const
TrafficVectorIterator searchActiveTraffic(int id) const
Search activeTraffic vector to find matching id.
TrafficVector activeTraffic
std::string genTransponderCode(const std::string &fltRules)
std::list< SGSharedPtr< FGTrafficRecord > >::const_iterator TrafficVectorIterator