17using namespace swift::misc::aviation;
18using namespace swift::misc::geo;
19using namespace swift::misc::math;
20using namespace swift::misc::network;
21using namespace swift::misc::physical_quantities;
22using namespace swift::misc::simulation;
31 static const CServer trafficServer(
"fooserver",
"a foo server",
"localhost", 1234,
32 CUser(
"112233",
"Some real name",
"email@xyz.com",
"secret"), CFsdSetup(),
45 CPropertyIndexVariantMap getCPropertyIndexVariantMapImpl()
47 CPropertyIndexVariantMap valueMap;
52 valueMap.
addValue(5000, QString(
"foobar"));
58 static const CPropertyIndexVariantMap valueMap(getCPropertyIndexVariantMapImpl());
64 static const CCoordinateGeodetic c =
71 static const CCoordinateGeodetic c =
78 static const CFlightPlanAircraftInfo info(
"T/A320/F");
79 static const CFlightPlan fp(
89 static const CAtcStation t(CCallsign(
"EDDM_TWR"), CUser(
"654321",
"John Doe"),
97 static const CAtcStation t(CCallsign(
"EDDF_TWR"), CUser(
"654321",
"Joe Bar"),
105 static const CAtcStation t(CCallsign(
"eddm_app"), CUser(
"654321",
"Jen Doe"),
113 static const CAtcStationList stations(
126 static const CCallsignSet callsigns({ CCallsign(
"DEMBZ"), CCallsign(
"DLH123"), CCallsign(
"RYR635L"),
127 CCallsign(
"LGL974"), CCallsign(
"AUI129"), CCallsign(
"CLX756") });
134 return callsigns[randomIndex(callsigns.size())];
139 static const CCallsignSet callsigns({ CCallsign(
"EDDM_TWR"), CCallsign(
"EDDM_APP"), CCallsign(
"EDDM_GND"),
140 CCallsign(
"EDDF_TWR"), CCallsign(
"EDDF_APP"), CCallsign(
"EDDF_GND") });
147 return callsigns[randomIndex(callsigns.size())];
153 static const CUserList pilots({
154 CUser(
"100100",
"Joe Doe", callsigns[0]),
155 CUser(
"100101",
"Jane Foo", callsigns[1]),
156 CUser(
"100200",
"Frank Sky", callsigns[2]),
157 CUser(
"100300",
"Richard F. Frings", callsigns[3]),
158 CUser(
"100301",
"Torben Frey", callsigns[4]),
159 CUser(
"100400",
"Kay Dòresn", callsigns[5]),
173 static const CUserList controllers({
174 CUser(
"300100",
"Jeff Doe", callsigns[0]),
175 CUser(
"300101",
"Foo Mister", callsigns[1]),
176 CUser(
"300200",
"Sky Du", callsigns[2]),
177 CUser(
"300300",
"F. Frings", callsigns[3]),
178 CUser(
"300301",
"Ralf Smith", callsigns[4]),
179 CUser(
"300400",
"Doreen Jump", callsigns[5]),
190 CAircraftSituation getAircraftSituationAboveMunichTowerImpl()
202 static const CAircraftSituation situation(getAircraftSituationAboveMunichTowerImpl());
206 CAircraftSituation getAircraftSituationAboveFrankfurtTowerImpl()
218 static const CAircraftSituation situation(getAircraftSituationAboveFrankfurtTowerImpl());
224 static const QString json =
226 static const CAircraftIcaoCode icao(CAircraftIcaoCode::fromJson(json));
227 Q_ASSERT(icao.hasValidDbKey());
233 static const QString json =
235 static const CAircraftIcaoCode icao(CAircraftIcaoCode::fromJson(json));
236 Q_ASSERT(icao.hasValidDbKey());
242 static const QString json =
244 static const CAirlineIcaoCode icao(CAirlineIcaoCode::fromJson(json));
245 Q_ASSERT(icao.hasValidDbKey());
251 static const QString json =
253 static const CAirlineIcaoCode icao(CAirlineIcaoCode::fromJson(json));
254 Q_ASSERT(icao.hasValidDbKey());
260 static const QString json =
262 static const CLivery livery(CLivery::fromJson(json));
263 Q_ASSERT(livery.hasValidDbKey());
269 static const QString json =
272 Q_ASSERT(model.hasValidDbKey());
273 Q_ASSERT(!model.getModelString().isEmpty());
279 static const QString json =
282 Q_ASSERT(model.hasValidDbKey());
283 Q_ASSERT(!model.getModelString().isEmpty());
287 CSimulatedAircraft getC172AircraftImpl()
292 CTransponder t = CTransponder(7000, CTransponder::ModeC);
293 aircraft.setTransponder(t);
301 static const CSimulatedAircraft aircraft(getC172AircraftImpl());
305 CSimulatedAircraft getA320AircraftImpl()
310 const CTransponder t = CTransponder(7000, CTransponder::ModeC);
311 aircraft.setTransponder(t);
319 static const CSimulatedAircraft aircraft(getA320AircraftImpl());
static CAngleUnit deg()
Degrees.
static CFrequencyUnit MHz()
Megahertz.
static QString readFileToString(const QString &fileNameAndPath)
Read file into string.
void addValue(const CPropertyIndex &index, const CVariant &value)
Add a value.
size_type size() const
Returns number of elements in the sequence.
static const QString & testFilesDirectory()
Where test files are located.
static CVariant fromValue(T &&value)
Construct a variant from a value.
@ IFR
Instrument flight rules.
static CCoordinateGeodetic fromWgs84(const QString &latitudeWgs84, const QString &longitudeWgs84, const aviation::CAltitude &geodeticHeight={})
Coordinate by WGS84 position data.
static int randomInteger(int low, int high)
Random number between low and high.
const aviation::CCallsign & getCallsign() const
Get associated callsign.
static CLengthUnit km()
Kilometer km.
static CLengthUnit m()
Meter m.
static CLengthUnit ft()
Foot ft.
static CSpeedUnit km_h()
Kilometer/hour km/h.
static CSpeedUnit m_s()
Meter/second m/s.
static CSpeedUnit kts()
Knots.
static CTimeUnit h()
Hour.
static CAircraftModel fromDatabaseJson(const QJsonObject &json, const QString &prefix=QString("mod_"))
From swift DB JSON.
static const swift::misc::network::CServer & getTrafficServer()
Traffic server (dummy).
static const swift::misc::aviation::CAtcStation & getRandomAtcStation()
Get ATC station.
static const swift::misc::simulation::CAircraftModel & getDbAircraftModelFsxAerosoftA320()
FSX aircraft model, an Airbus A320.
static const swift::misc::aviation::CAircraftIcaoCode & getDBAircraftIcaoC172()
C172 ICAO code (as from DB).
static const swift::misc::geo::CCoordinateGeodetic & getCoordinateMunichTower()
Munich tower coordinate.
static const swift::misc::aviation::CCallsign & getRandomControllerCallsign()
Get a random callsign (ATC).
static const swift::misc::aviation::CAtcStation & getMunichApproach()
Munich approach.
static const swift::misc::aviation::CAircraftSituation & getAircraftSituationAboveMunichTower()
Aircraft situation (Munich).
static const swift::misc::aviation::CCallsign & getRandomPilotCallsign()
Get a random callsign (aircraft).
static const swift::misc::aviation::CFlightPlan & getFlightPlan()
Prefilled flightplan from EDDM-EDDF.
static const swift::misc::network::CUser & getRandomPilot()
Get a random pilot user.
static const swift::misc::network::CUserList & getPilots()
Get a random pilot.
static const swift::misc::aviation::CAtcStation & getFrankfurtTower()
Frankfurt tower.
static const swift::misc::aviation::CAtcStation & getMunichTower()
Munich tower.
static const swift::misc::aviation::CAtcStationList & getAtcStations()
Tower stations.
static const swift::misc::aviation::CAirlineIcaoCode & getDbAirlineIcaoDLH()
DLH ICAO code (as from DB).
static const swift::misc::simulation::CAircraftModel & getDbAircraftModelFsxA2AC172Skyhawk()
FSX aircraft model, a C172 Skyhawk.
static const swift::misc::aviation::CAircraftIcaoCode & getDBAircraftIcaoB737()
B737 ICAO code (as from DB).
static const swift::misc::network::CUser & getRandomController()
Get a random controller user.
static const swift::misc::CVariantList & getCVariantList()
Get a variant list with various data.
static const swift::misc::aviation::CCallsignSet & getPilotCallsigns()
Get aircraft callsigns.
static const swift::misc::aviation::CCallsignSet & getControllerCallsigns()
Get controller callsigns.
static const swift::misc::network::CUserList & getControllers()
Get a random controller.
static const swift::misc::aviation::CLivery & getDbLiveryDLHStarAlliance()
Aircraft model.
static const swift::misc::CPropertyIndexVariantMap & getCPropertyIndexVariantMap()
Get a variant map.
static const swift::misc::simulation::CSimulatedAircraft & getC172Aircraft()
C172 simulated aircraft, a C172.
static const swift::misc::simulation::CSimulatedAircraft & getA320Aircraft()
A320 simulated aircraft, a A.
static const swift::misc::aviation::CAirlineIcaoCode & getDbAirlineIcaoBAW()
BAW ICAO code (as from DB).
static const swift::misc::geo::CCoordinateGeodetic & getCoordinateFrankfurtTower()
Frankfurt tower coordinate.
static const swift::misc::aviation::CAircraftSituation & getAircraftSituationAboveFrankfurtTower()
Aircraft situation (Frankfurt).
QJsonObject jsonObjectFromString(const QString &json, bool acceptCacheFormat)
JSON Object from string.
Generate data for testing purposes.
QDateTime currentDateTime()
QDateTime currentDateTimeUtc()