swift
Loading...
Searching...
No Matches
contextownaircraftimpl.cpp
1// SPDX-FileCopyrightText: Copyright (C) 2014 swift Project Community / Contributors
2// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3
5
6#include <QReadLocker>
7#include <QWriteLocker>
8#include <QtGlobal>
9
10// ----- cross context -----
14// ----- cross context -----
15
16#include "core/application.h"
25#include "misc/dbusserver.h"
26#include "misc/geo/latitude.h"
27#include "misc/geo/longitude.h"
28#include "misc/logcategories.h"
29#include "misc/logmessage.h"
31#include "misc/network/server.h"
33#include "misc/pq/units.h"
34#include "misc/sequence.h"
36#include "misc/statusmessage.h"
37
38using namespace swift::misc;
39using namespace swift::misc::physical_quantities;
40using namespace swift::misc::aviation;
41using namespace swift::misc::network;
42using namespace swift::misc::geo;
43using namespace swift::misc::audio;
44using namespace swift::misc::simulation;
45using namespace swift::core;
46using namespace swift::core::db;
47
48namespace swift::core::context
49{
51 : IContextOwnAircraft(mode, runtime), CIdentifiable(this)
52 {
53 Q_ASSERT(this->getRuntime());
54
55 connect(&m_historyTimer, &QTimer::timeout, this, &CContextOwnAircraft::evaluateUpdateHistory);
56 this->setObjectName("CContextOwnAircraft");
57 m_historyTimer.setObjectName(this->objectName() + "::historyTimer");
58 m_historyTimer.start(2500);
59 m_situationHistory.setSortHint(CAircraftSituationList::TimestampLatestFirst);
60
62
63 if (sApp && sApp->getWebDataServices())
64 {
65 connect(sApp->getWebDataServices(), &CWebDataServices::swiftDbAllDataRead, this,
66 &CContextOwnAircraft::allSwiftWebDataRead);
67 }
68
69 // Init own aircraft
70 this->initOwnAircraft();
71 }
72
74 {
75 if (isDebugEnabled())
76 {
77 CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO;
78 }
79 QReadLocker l(&m_lockAircraft);
80 return m_ownAircraft;
81 }
82
84 {
85 if (isDebugEnabled())
86 {
87 CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO;
88 }
89 QReadLocker l(&m_lockAircraft);
90 return m_ownAircraft.getComSystem(unit);
91 }
92
94 {
95 if (isDebugEnabled())
96 {
97 CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO;
98 }
99 QReadLocker l(&m_lockAircraft);
100 return m_ownAircraft.getTransponder();
101 }
102
104 {
105 QReadLocker l(&m_lockAircraft);
106 return m_ownAircraft.getCallsign();
107 }
108
110 {
111 QReadLocker l(&m_lockAircraft);
112 return m_ownAircraft.getPosition();
113 }
114
116 {
117 QReadLocker l(&m_lockAircraft);
118 return m_ownAircraft.getSituation();
119 }
120
122 {
123 QReadLocker l(&m_lockAircraft);
124 return m_ownAircraft.getParts();
125 }
126
128 {
129 QReadLocker l(&m_lockAircraft);
130 return m_ownAircraft.getModel();
131 }
132
137
138 void CContextOwnAircraft::initOwnAircraft()
139 {
140 Q_ASSERT(this->getRuntime());
141 CSimulatedAircraft ownAircraft;
142 {
143 // use copy to minimize lock time
144 QReadLocker rl(&m_lockAircraft);
145 ownAircraft = m_ownAircraft;
146 }
147
148 ownAircraft.initComSystems();
149 ownAircraft.initTransponder();
150 ownAircraft.setSituation(getDefaultSituation());
151 ownAircraft.setPilot(m_currentNetworkServer.get().getUser());
152
153 // If we already have a model from somehwere, keep it, otherwise init default
154 ownAircraft.setModel(reverseLookupModel(ownAircraft.getModel()));
155 if (!ownAircraft.getAircraftIcaoCode().hasValidDesignator())
156 {
158 }
159
160 // override empty values
161 if (!ownAircraft.hasValidCallsign())
162 {
163 ownAircraft.setCallsign(CCallsign("SWIFT"));
164 }
165
166 // update object
167 {
168 QWriteLocker l(&m_lockAircraft);
169 m_ownAircraft = ownAircraft;
170 }
171 }
172
173 void CContextOwnAircraft::evaluateUpdateHistory()
174 {
175 if (!m_history)
176 {
177 return;
178 }
179 if (!this->getIContextSimulator())
180 {
181 return;
182 }
183 if (!this->getIContextSimulator()->isSimulatorSimulating())
184 {
185 return;
186 }
187
188 QReadLocker rl(&m_lockAircraft);
189 const CAircraftSituationList situations = m_situationHistory; // latest first
190 rl.unlock();
191
192 constexpr int minElements = qRound(MaxHistoryElements * 0.75);
193 if (m_situationHistory.size() < minElements)
194 {
195 return;
196 }
197
198 // using copy to minimize lock time
199 // 500km/h => 1sec: 0.1388 km
200 // we check if there are situation for own aircraft outside the max.distance
201 static const CLength maxDistance(25, CLengthUnit::km());
202 const CAircraftSituation latest = situations.front();
203 const bool jumpDetected = situations.containsObjectOutsideRange(situations.front(), maxDistance);
204
205 if (jumpDetected)
206 {
207 const CAircraftSituationList ownDistances = situations.findFarthest(1, latest);
208 const CLength distance = ownDistances.front().calculateGreatCircleDistance(latest);
209 {
210 QWriteLocker wl(&m_lockAircraft);
211 m_situationHistory.clear();
212 }
213 emit this->movedAircraft(distance);
214 }
215 }
216
217 CAircraftModel CContextOwnAircraft::reverseLookupModel(const CAircraftModel &model)
218 {
219 bool modified = false;
220 const CAircraftModel reverseModel =
222 return reverseModel;
223 }
224
226 {
227 return updateOwnModel(model, this->identifier());
228 }
229
230 bool CContextOwnAircraft::updateOwnModel(const CAircraftModel &model, const CIdentifier &identifier)
231 {
232 CAircraftModel updateModel(reverseLookupModel(model));
233 {
234 QWriteLocker l(&m_lockAircraft);
235 const bool changed = (m_ownAircraft.getModel() != updateModel);
236 if (!changed)
237 {
238 return false;
239 }
240 m_ownAircraft.setModel(updateModel);
241 }
242
243 // changed model
244 emit this->ps_changedModel(updateModel, identifier);
245 return true;
246 }
247
249 {
250 QWriteLocker l(&m_lockAircraft);
251 // there is intentionally no equal check
252 m_ownAircraft.setSituation(situation);
253
254 if (m_situationHistory.isEmpty() ||
255 qAbs(situation.getTimeDifferenceMs(m_situationHistory.front())) > MinHistoryDeltaMs)
256 {
257 m_situationHistory.push_frontKeepLatestAdjustedFirst(situation, true);
258 if (m_situationHistory.size() > MaxHistoryElements)
259 {
260 m_situationHistory.pop_back();
261 }
262 }
263 return true;
264 }
265
267 {
268 QWriteLocker l(&m_lockAircraft);
269 const bool changed = (m_ownAircraft.getParts() != parts);
270 if (!changed)
271 {
272 return false;
273 }
274 m_ownAircraft.setParts(parts);
275 return true;
276 }
277
279 {
280 QWriteLocker l(&m_lockAircraft);
281 const bool changed = (m_ownAircraft.getModel().getCG() != cg);
282 if (!changed)
283 {
284 return false;
285 }
286 m_ownAircraft.setCG(cg);
287 return true;
288 }
289
291 const swift::misc::aviation::CAltitude &altitude,
292 const CAltitude &pressureAltitude)
293 {
294 if (isDebugEnabled())
295 {
296 CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO << position << altitude;
297 }
298 QWriteLocker l(&m_lockAircraft);
299 bool changed = (m_ownAircraft.getPosition() != position);
300 if (changed)
301 {
302 m_ownAircraft.setPosition(position);
303 }
304
305 if (m_ownAircraft.getAltitude() != altitude)
306 {
307 changed = true;
308 m_ownAircraft.setAltitude(altitude);
309 }
310
311 if (m_ownAircraft.getPressureAltitude() != pressureAltitude)
312 {
313 changed = true;
314 m_ownAircraft.setPressureAltitude(pressureAltitude);
315 }
316 return changed;
317 }
318
320 const CTransponder &transponder, const CIdentifier &originator)
321 {
322 if (isDebugEnabled())
323 {
324 CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO << com1 << com2 << transponder;
325 }
326 bool changed {};
327 {
328 QWriteLocker l(&m_lockAircraft);
329 changed = m_ownAircraft.hasChangedCockpitData(com1, com2, transponder);
330 if (changed)
331 {
332 m_ownAircraft.setCockpit(com1, com2, transponder);
333 }
334 }
335 if (changed)
336 {
337 emit this->changedAircraftCockpit(m_ownAircraft, originator);
338 }
339 return changed;
340 }
341
343 const CIdentifier &originator)
344 {
345 if (isDebugEnabled())
346 {
347 CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO << transponderMode;
348 }
349 bool changed {};
350 {
351 QWriteLocker l(&m_lockAircraft);
352 changed = m_ownAircraft.setTransponderMode(transponderMode);
353 }
354 if (changed)
355 {
356 emit this->changedAircraftCockpit(m_ownAircraft, originator);
357 }
358 return changed;
359 }
360
362 const CIdentifier &originator)
363 {
364 if (unit != CComSystem::Com1 && unit != CComSystem::Com2)
365 {
366 return false;
367 }
368 if (!CComSystem::isValidComFrequency(frequency))
369 {
370 return false;
371 }
372 CComSystem com1, com2;
373 CTransponder xpdr;
374 {
375 QReadLocker l(&m_lockAircraft);
376 com1 = m_ownAircraft.getCom1System();
377 com2 = m_ownAircraft.getCom2System();
378 xpdr = m_ownAircraft.getTransponder();
379 }
380 if (unit == CComSystem::Com1)
381 {
382 com1.setFrequencyActive(frequency);
383 }
384 else
385 {
386 com2.setFrequencyActive(frequency);
387 }
388
389 const bool changed = this->updateCockpit(com1, com2, xpdr, originator);
390 return changed;
391 }
392
394 const CIdentifier &originator)
395 {
396 if (unit != CComSystem::Com1 && unit != CComSystem::Com2)
397 {
398 return false;
399 }
400 if (!CComSystem::isValidComFrequency(frequency))
401 {
402 return false;
403 }
404 CComSystem com1, com2;
405 CTransponder xpdr;
406 {
407 QReadLocker l(&m_lockAircraft);
408 com1 = m_ownAircraft.getCom1System();
409 com2 = m_ownAircraft.getCom2System();
410 xpdr = m_ownAircraft.getTransponder();
411 }
412 if (unit == CComSystem::Com1)
413 {
414 com1.setFrequencyStandby(frequency);
415 }
416 else
417 {
418 com2.setFrequencyStandby(frequency);
419 }
420
421 const bool changed = this->updateCockpit(com1, com2, xpdr, originator);
422 return changed;
423 }
424
426 {
427 {
428 QWriteLocker l(&m_lockAircraft);
429 if (m_ownAircraft.getPilot() == pilot)
430 {
431 return false;
432 }
433 m_ownAircraft.setPilot(pilot);
434 }
435 emit this->changedPilot(pilot);
436 return true;
437 }
438
440 {
441 CTransponder xpdr;
442 CComSystem com1;
443 CComSystem com2;
444 {
445 QReadLocker l(&m_lockAircraft);
446 com1 = m_ownAircraft.getCom1System();
447 com2 = m_ownAircraft.getCom2System();
448 xpdr = m_ownAircraft.getTransponder();
449 }
451 this->updateCockpit(com1, com2, xpdr, this->identifier());
452 }
453
458
460 {
461 {
462 QWriteLocker l(&m_lockAircraft);
463 if (m_ownAircraft.getCallsign() == callsign)
464 {
465 return false;
466 }
467 m_ownAircraft.setCallsign(callsign);
468 }
469 emit this->changedCallsign(callsign);
470 return true;
471 }
472
474 const swift::misc::aviation::CAirlineIcaoCode &airlineIcaoCode)
475 {
476 {
477 QWriteLocker l(&m_lockAircraft);
478 if (!m_ownAircraft.setIcaoCodes(aircraftIcaoCode, airlineIcaoCode))
479 {
480 return false;
481 }
482 }
483 emit this->changedAircraftIcaoCodes(aircraftIcaoCode, airlineIcaoCode);
484 return true;
485 }
486
487 bool CContextOwnAircraft::updateSelcal(const CSelcal &selcal, const CIdentifier &originator)
488 {
489 {
490 QWriteLocker l(&m_lockAircraft);
491 if (m_ownAircraft.getSelcal() == selcal)
492 {
493 return false;
494 }
495 m_ownAircraft.setSelcal(selcal);
496 }
497 emit this->changedSelcal(selcal, originator);
498 return true;
499 }
500
501 void CContextOwnAircraft::xCtxChangedSimulatorModel(const CAircraftModel &model, const CIdentifier &identifier)
502 {
503 this->updateOwnModel(model, identifier);
504 }
505
506 void CContextOwnAircraft::xCtxChangedSimulatorStatus(int status)
507 {
508 const ISimulator::SimulatorStatus s = static_cast<ISimulator::SimulatorStatus>(status);
510 {
511 // connected
512 }
513 else
514 {
515 // disconnected
516 QWriteLocker l(&m_lockAircraft);
517 m_situationHistory.clear();
518 }
519 }
520
521 void CContextOwnAircraft::actionToggleTransponder(bool keydown)
522 {
523 if (!keydown)
524 {
525 return;
526 }
527 this->toggleTransponderMode();
528 }
529
530 void CContextOwnAircraft::actionIdent(bool keydown)
531 {
532 if (this->getOwnTransponder().isInStandby())
533 {
534 return;
535 }
536 const CTransponder::TransponderMode m = keydown ? CTransponder::StateIdent : CTransponder::ModeC;
537 this->updateTransponderMode(m, this->identifier());
538 }
539
540 void CContextOwnAircraft::allSwiftWebDataRead()
541 {
542 // we should already have received a reverse lookup model
543 // from the driver
544 }
545
546 bool CContextOwnAircraft::parseCommandLine(const QString &commandLine, const CIdentifier &originator)
547 {
548 Q_UNUSED(originator)
549 if (commandLine.isEmpty())
550 {
551 return false;
552 }
553 CSimpleCommandParser parser({ ".x", ".xpdr", // transponder
554 ".com1", ".com2", // com1, com2 frequencies
555 ".c1", ".c2", // com1, com2 frequencies
556 ".selcal" });
557 parser.parse(commandLine);
558 if (!parser.isKnownCommand())
559 {
560 return false;
561 }
562
563 CSimulatedAircraft myAircraft(this->getOwnAircraft());
564 if (parser.matchesCommand(".x", ".xpdr") && parser.countParts() > 1)
565 {
566 CTransponder transponder = myAircraft.getTransponder();
567 int xprCode = parser.toInt(1);
569 {
570 transponder.setTransponderCode(xprCode);
571 // todo RW: replace originator
572 this->updateCockpit(myAircraft.getCom1System(), myAircraft.getCom2System(), transponder,
573 CIdentifier("commandline"));
574 return true;
575 }
576 else
577 {
579 transponder.setTransponderMode(mode);
580 // todo RW: replace originator
581 this->updateCockpit(myAircraft.getCom1System(), myAircraft.getCom2System(), transponder,
582 CIdentifier("commandline"));
583 return true;
584 }
585 }
586 else if (parser.commandStartsWith("com") || parser.commandStartsWith("c"))
587 {
588 CFrequency frequency(parser.toDouble(1), CFrequencyUnit::MHz());
589 if (CComSystem::isValidComFrequency(frequency))
590 {
591 CComSystem com1 = myAircraft.getCom1System();
592 CComSystem com2 = myAircraft.getCom2System();
593 if (parser.commandEndsWith("1"))
594 {
595 com1.setFrequencyActive(frequency);
596 }
597 else if (parser.commandEndsWith("2"))
598 {
599 com2.setFrequencyActive(frequency);
600 }
601 else
602 {
603 return false;
604 }
605 this->updateCockpit(com1, com2, myAircraft.getTransponder(), identifier());
606 return true;
607 }
608 }
609 else if (parser.matchesCommand(".selcal"))
610 {
611 if (CSelcal::isValidCode(parser.part(1)))
612 {
613 this->updateSelcal(parser.part(1), this->identifier());
614 return true;
615 }
616 }
617 return false;
618 }
619} // namespace swift::core::context
static CFrequencyUnit MHz()
Megahertz.
Definition units.h:380
ContextMode
How to handle a given context.
void swiftDbAllDataRead()
All swift DB data have been read.
static bool isAnyConnectedStatus(SimulatorStatus status)
Any connected status?
bool setTransponderMode(swift::misc::aviation::CTransponder::TransponderMode mode)
Set XPDR mode.
swift::misc::simulation::CAircraftModel getOwnAircraftModel() const
Own aircraft model.
bool updateActiveComFrequency(const swift::misc::physical_quantities::CFrequency &frequency, swift::misc::aviation::CComSystem::ComUnit comUnit, const swift::misc::CIdentifier &originator)
Tune in a COM frequency (active).
swift::misc::aviation::CAircraftSituation getOwnAircraftSituation() const
Get own aircraft.
swift::misc::physical_quantities::CLength getDistanceToOwnAircraft(const swift::misc::geo::ICoordinateGeodetic &position) const
Distance to own aircraft.
bool updateTransponderMode(const swift::misc::aviation::CTransponder::TransponderMode &transponderMode, const swift::misc::CIdentifier &originator)
Update own transponder mode.
bool updateOwnPosition(const swift::misc::geo::CCoordinateGeodetic &position, const swift::misc::aviation::CAltitude &altitude, const swift::misc::aviation::CAltitude &pressureAltitude)
Update position.
swift::misc::aviation::CTransponder getOwnTransponder() const
Get own transponder.
bool updateOwnCallsign(const swift::misc::aviation::CCallsign &callsign)
Set callsign.
bool updateOwnIcaoCodes(const swift::misc::aviation::CAircraftIcaoCode &aircraftIcaoCode, const swift::misc::aviation::CAirlineIcaoCode &airlineIcaoCode)
Set ICAO data.
swift::misc::geo::CCoordinateGeodetic getOwnAircraftPosition() const
Own aircraft's position.
swift::misc::simulation::CSimulatedAircraft getOwnAircraft() const
Get own aircraft.
swift::misc::aviation::CCallsign getOwnCallsign() const
Own aircraft's callsign.
bool updateOwnSituation(const swift::misc::aviation::CAircraftSituation &situation)
Update own situation.
bool updateCockpit(const swift::misc::aviation::CComSystem &com1, const swift::misc::aviation::CComSystem &com2, const swift::misc::aviation::CTransponder &transponder, const swift::misc::CIdentifier &originator)
Update own cockpit.
bool updateOwnModel(const swift::misc::simulation::CAircraftModel &model)
Update model.
CContextOwnAircraft(CCoreFacadeConfig::ContextMode, CCoreFacade *runtime)
Constructor, with link to runtime.
bool updateOwnParts(const swift::misc::aviation::CAircraftParts &parts)
Update own parts.
swift::misc::aviation::CAircraftParts getOwnAircraftParts() const
Own aircraft's parts.
bool updateOwnCG(const swift::misc::physical_quantities::CLength &cg)
Update own parts.
bool updateOwnAircraftPilot(const swift::misc::network::CUser &pilot)
Set current pilot.
bool updateStandbyComFrequency(const swift::misc::physical_quantities::CFrequency &frequency, swift::misc::aviation::CComSystem::ComUnit comUnit, const swift::misc::CIdentifier &originator)
Tune in a COM frequency (standby).
swift::misc::aviation::CComSystem getOwnComSystem(swift::misc::aviation::CComSystem::ComUnit unit) const
Get own COM system.
bool updateSelcal(const swift::misc::aviation::CSelcal &selcal, const swift::misc::CIdentifier &originator)
Own SELCAL code.
const IContextSimulator * getIContextSimulator() const
Context for simulator.
Definition context.cpp:72
bool isDebugEnabled() const
Debug enabled?
Definition context.cpp:62
CCoreFacade * getRuntime()
Runtime.
Definition context.h:57
void changedAircraftCockpit(const swift::misc::simulation::CSimulatedAircraft &aircraft, const swift::misc::CIdentifier &originator)
Aircraft cockpit update.
void changedPilot(const swift::misc::network::CUser &pilot)
Own pilot (aka the swift user) changed.
void changedCallsign(const swift::misc::aviation::CCallsign &callsign)
Own callsign was changed.
void changedAircraftIcaoCodes(const swift::misc::aviation::CAircraftIcaoCode &aircraftIcaoCode, const swift::misc::aviation::CAirlineIcaoCode &airlineIcaoCode)
Own ICAO was changed.
void movedAircraft(const swift::misc::physical_quantities::CLength &distance)
Aircraft has been moved from one location to another (changed scenery).
static swift::misc::simulation::CAircraftModel getDefaultOwnAircraftModel()
Default own aircraft.
static const swift::misc::aviation::CAircraftSituation & getDefaultSituation()
Default situation.
void changedSelcal(const swift::misc::aviation::CSelcal &selcal, const swift::misc::CIdentifier &originator)
Changed SELCAL code.
static swift::misc::simulation::CAircraftModel consolidateOwnAircraftModelWithDbData(const swift::misc::simulation::CAircraftModel &model, bool force, bool *modified=nullptr)
Consolidate own (aircraft) model data with DB data.
T get() const
Get a copy of the current value.
Definition valuecache.h:411
CIdentifiable(const QString &objectName)
Use literal based object name.
const CIdentifier & identifier() const
Get identifier.
Value object encapsulating information identifying a component of a modular distributed swift process...
Definition identifier.h:29
static const QString & contextSlot()
Context slots.
Class for emitting a log message.
Definition logmessage.h:27
Derived & debug()
Set the severity to debug.
reference front()
Access the first element.
Definition sequence.h:225
void clear()
Removes all elements in the sequence.
Definition sequence.h:288
Utility methods for simple line parsing used with the command line.
void parse(const QString &commandLine)
Parse.
qint64 getTimeDifferenceMs(qint64 compareTime) const
Time difference in ms.
Value object for ICAO classification.
bool hasValidDesignator() const
Valid aircraft designator?
Value object encapsulating information of aircraft's parts.
Value object encapsulating information of an aircraft's situation.
Value object for ICAO classification.
Altitude as used in aviation, can be AGL or MSL altitude.
Definition altitude.h:52
Value object encapsulating information of a callsign.
Definition callsign.h:30
COM system (aka "radio").
Definition comsystem.h:37
static CComSystem getCom1System(double activeFrequencyMHz, double standbyFrequencyMHz=-1)
COM1 unit.
Definition comsystem.cpp:70
void setFrequencyStandby(const physical_quantities::CFrequency &frequency)
Set active frequency.
Definition comsystem.cpp:48
static bool isValidComFrequency(const physical_quantities::CFrequency &f)
Valid COM frequency (either civil or military).
void setFrequencyActive(const physical_quantities::CFrequency &frequency)
Set active frequency.
Definition comsystem.cpp:37
static CComSystem getCom2System(double activeFrequencyMHz, double standbyFrequencyMHz=-1)
COM2 unit.
Definition comsystem.cpp:84
Value object for SELCAL.
Definition selcal.h:31
static bool isValidCode(const QString &code)
Valid SELCAL code?
Definition selcal.cpp:60
static bool isValidTransponderCode(const QString &transponderCode)
Is valid transponder code?
void setTransponderCode(int transponderCode)
Set transponder code.
static TransponderMode modeFromString(const QString &modeString)
Mode from string.
bool setTransponderMode(TransponderMode mode)
Set transponder mode.
void toggleTransponderMode()
Transponder mode toggled.
@ StateIdent
not a real mode, more a state
Definition transponder.h:39
Geodetic coordinate, a position in 3D space relative to the reference geoid.
physical_quantities::CLength calculateGreatCircleDistance(const ICoordinateGeodetic &otherCoordinate) const
Great circle distance.
bool containsObjectOutsideRange(const ICoordinateGeodetic &coordinate, const physical_quantities::CLength &range) const
Any object in range?
CONTAINER findFarthest(int number, const ICoordinateGeodetic &coordinate) const
Find 0..n objects farthest to the given coordinate.
const CUser & getUser() const
Get user.
Definition server.h:63
Value object encapsulating information of a user.
Definition user.h:28
Physical unit length (length).
Definition length.h:18
static CLengthUnit km()
Kilometer km.
Definition units.h:165
Aircraft model (used by another pilot, my models on disk).
Comprehensive information of an aircraft.
void setCallsign(const aviation::CCallsign &callsign)
Set callsign.
void setModel(const CAircraftModel &model)
Set model.
const aviation::CComSystem & getCom2System() const
Get COM2 system.
void initTransponder()
Meaningful default settings for Transponder.
const aviation::CComSystem & getCom1System() const
Get COM1 system.
void initComSystems()
Meaningful default settings for COM Systems.
void setSituation(const aviation::CAircraftSituation &situation)
Set situation. Won't overwrite the velocity unless it held the default value.
const aviation::CAircraftIcaoCode & getAircraftIcaoCode() const
Get aircraft ICAO info.
const aviation::CTransponder & getTransponder() const
Get transponder.
const simulation::CAircraftModel & getModel() const
Get model (model used for mapping).
void setPilot(const network::CUser &user)
Set pilot.
bool parseCommandLine(const QString &commandLine, const swift::misc::CIdentifier &originator)
Classes interacting with the swift database (aka "datastore").
Backend services of the swift project, like dealing with the network or the simulators.
Definition actionbind.cpp:7
Free functions in swift::misc.
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
void setObjectName(QAnyStringView name)
bool isEmpty() const const
void timeout()