6#ifndef SWIFT_CORE_CONTEXT_CONTEXTNETWORK_IMPL_H
7#define SWIFT_CORE_CONTEXT_CONTEXTNETWORK_IMPL_H
78 public IContextNetwork,
87 friend class IContextNetwork;
113 bool rendered)
override;
115 bool enabled)
override;
119 bool *setForOnGroundPosition)
override;
127 const QString &modelString)
override;
132 int minValues = 1,
int sufficientValues = 2)
const override;
154 bool skipEqualValues =
true)
override;
186 bool enabledForRendering)
override;
200 bool enableFastPositonUpdates)
override;
204 bool supportGndFlag)
override;
207 void enableReverseLookupMessages(swift::misc::simulation::ReverseLookupLogging enable)
override;
212 bool enabledForRendering)
override;
215 int reInitializeAllAircraft()
override;
228 const QString &modelString)
override;
237 int getAircraftInRangeCount()
const override;
258 swift::misc::simulation::ReverseLookupLogging isReverseLookupMessagesEnabled()
const override;
269 int getRemoteAircraftSupportingPartsCount()
const override;
272 bool isAircraftPartsHistoryEnabled()
const override;
278 void enableAircraftPartsHistory(
bool enabled)
override;
281 int aircraftSituationsAdded()
const override;
284 int aircraftPartsAdded()
const override;
293 QString getNetworkStatistics(
bool reset,
const QString &separator)
override;
296 bool setNetworkStatisticsEnable(
bool enabled)
override;
304 QStringList getNetworkPresetValues()
const override;
322 bool isPendingConnection()
const;
348 {
".altos callsign|? offsetvalue",
"set altitude offset value (testing), ?=all" });
350 {
".addtimeos offsetvalue",
"add (delta) time offset (testing), e.g. 50ms" });
352 {
".watchdog on|off",
"enable/disable network watchdog (testing)" });
380 const QString &extraLiveryString,
bool sendLivery,
381 const QString &extraModelString,
bool sendModelString,
395 bool isConnected()
const override;
426 void requestAircraftDataUpdates()
override;
429 void requestAtisUpdates()
override;
438 void testCreateDummyOnlineAtcStations(
int number)
override;
465 QTimer *m_requestAircraftDataTimer =
467 QTimer *m_requestAtisTimer =
nullptr;
468 QTimer *m_staggeredMatchingTimer =
nullptr;
469 int m_simulatorConnected = 0;
475 std::chrono::milliseconds(1000), 4 };
476 misc::CDigestSignal m_dsAircraftsInRangeChanged {
this, &IContextNetwork::changedAircraftInRange,
477 &IContextNetwork::changedAircraftInRangeDigest,
478 std::chrono::milliseconds(1000), 4 };
509 void emitReadyForMatching();
519 void xCtxSimulatorRenderRestrictionsChanged(
520 bool restricted,
bool enabled,
int maxAircraft,
525 void xCtxSimulatorStatusChanged(
int status);
528 bool canUseFsd()
const;
531 bool canUseAirspaceMonitor()
const;
Keeps track of other entities in the airspace: aircraft, ATC stations, etc. Central instance of data ...
ContextMode
How to handle a given context.
The class providing facades (the contexts) for all DBus relevant operations.
Network context implementation.
void rememberCGFromDB(const swift::misc::physical_quantities::CLength &cgFromDB, const swift::misc::aviation::CCallsign &callsign)
CG values from DB.
CAirspaceMonitor * airspace() const
Airspace.
void markAsSwiftClient(const swift::misc::aviation::CCallsign &callsign)
Mark as other swift client.
int updateMultipleAircraftRendered(const swift::misc::aviation::CCallsignSet &callsigns, bool rendered)
Set aircraft rendered.
swift::misc::MillisecondsMinMaxMean remoteAircraftSituationsTimestampDifferenceMinMaxMean(const swift::misc::aviation::CCallsign &callsign) const
Average update time.
swift::misc::aviation::CCallsignSet remoteAircraftSupportingParts() const
Remote aircraft supporting parts.
int updateOrAddClient(const swift::misc::aviation::CCallsign &callsign, const swift::misc::CPropertyIndexVariantMap &vm, bool skipEqualValues=true)
Update or add a client.
bool hasClientInfo(const swift::misc::aviation::CCallsign &callsign) const
Client info for given callsign?
swift::misc::geo::CElevationPlane averageElevationOfNonMovingAircraft(const swift::misc::aviation::CAircraftSituation &reference, const swift::misc::physical_quantities::CLength &range, int minValues=1, int sufficientValues=2) const
Average elevation of aircraft in given range, which are NOT moving.
swift::misc::aviation::CAircraftSituationList latestOnGroundProviderElevations() const
Latest aircraft situation "on ground" having a provider elevation.
void setClients(const swift::misc::network::CClientList &clients)
Set other clients.
swift::misc::aviation::CAircraftSituationList latestRemoteAircraftSituations() const
Latest aircraft situation for all callsigns.
bool addClientGndCapability(const swift::misc::aviation::CCallsign &callsign)
Add gnd.flag capability.
int updateAircraftGroundElevation(const swift::misc::aviation::CCallsign &callsign, const swift::misc::geo::CElevationPlane &elevation, swift::misc::aviation::CAircraftSituation::GndElevationInfo info, bool *setForOnGroundPosition)
Update the ground elevation.
swift::misc::aviation::CAircraftSituation remoteAircraftSituation(const swift::misc::aviation::CCallsign &callsign, int index) const
Rendered aircraft situations (per callsign and index).
int removeClient(const swift::misc::aviation::CCallsign &callsign)
Remove client.
void gracefulShutdown()
Gracefully shut down, e.g. for thread safety.
QMetaObject::Connection connectRawFsdMessageSignal(QObject *receiver, RawFsdMessageReceivedSlot rawFsdMessageReceivedSlot)
Connect to receive raw fsd messages.
bool updateAircraftRendered(const swift::misc::aviation::CCallsign &callsign, bool rendered)
Set aircraft rendered.
bool addNewClient(const swift::misc::network::CClient &client)
Add a new client, if existing nothing will be added.
QList< QMetaObject::Connection > connectRemoteAircraftProviderSignals(QObject *receiver, std::function< void(const swift::misc::aviation::CAircraftSituation &)> addedSituationSlot, std::function< void(const swift::misc::aviation::CCallsign &, const swift::misc::aviation::CAircraftParts &)> addedPartsSlot, std::function< void(const swift::misc::aviation::CCallsign &)> removedAircraftSlot, std::function< void(const swift::misc::simulation::CAirspaceAircraftSnapshot &)> aircraftSnapshotSlot)
Connect signals to slot receiver. As the interface is no QObject, slots can not be connected directly...
swift::misc::aviation::CAircraftSituationChangeList remoteAircraftSituationChanges(const swift::misc::aviation::CCallsign &callsign) const
Aircraft changes.
CContextNetwork(CCoreFacadeConfig::ContextMode, CCoreFacade *runtime)
Constructor, with link to runtime.
swift::misc::physical_quantities::CLength getCGFromDB(const swift::misc::aviation::CCallsign &callsign) const
CG values from DB.
bool autoAdjustCientGndCapability(const swift::misc::aviation::CAircraftSituation &situation)
Adjust gnd.flag capability from situation.
void updateMarkAllAsNotRendered()
Mark all as not rendered.
swift::misc::network::CClient getClientOrDefaultForCallsign(const swift::misc::aviation::CCallsign &callsign) const
Other client for the given callsigns.
static void registerHelp()
Register help.
int remoteAircraftSituationsCount(const swift::misc::aviation::CCallsign &callsign) const
Number of remote aircraft situations for callsign.
fsd::CFSDClient * fsdClient() const
Network library.
int remoteAircraftPartsCount(const swift::misc::aviation::CCallsign &callsign) const
All parts (per callsign, time history).
int updateMultipleAircraftEnabled(const swift::misc::aviation::CCallsignSet &callsigns, bool enabled)
Enable/disable aircraft.
int remoteAircraftSituationChangesCount(const swift::misc::aviation::CCallsign &callsign) const
Aircraft changes count.
void clearClients()
Set other clients.
swift::misc::simulation::CAirspaceAircraftSnapshot getLatestAirspaceAircraftSnapshot() const
Current snapshot.
swift::misc::aviation::CAircraftSituationList remoteAircraftSituations(const swift::misc::aviation::CCallsign &callsign) const
Rendered aircraft situations (per callsign, time history).
bool setClientGndCapability(const swift::misc::aviation::CCallsign &callsign, bool supportGndFlag)
Set gnd.flag capability.
swift::misc::aviation::CAircraftPartsList remoteAircraftParts(const swift::misc::aviation::CCallsign &callsign) const
All parts (per callsign, time history).
void changedAtcStationsOnline()
ATC station (online) list has been changed.
std::function< void(const swift::misc::network::CRawFsdMessage &)> RawFsdMessageReceivedSlot
Raw FSD message receiver functor.
void changedAtcStationsOnlineDigest()
Digest signal changedAtcStationsOnline().
FSD client Todo: Send (interim) data updates automatically Todo Check ':' in FSD messages....
Receive 1..n signals, collect them over time, and resend afer n milliseconds.
Value object encapsulating information identifying a component of a modular distributed swift process...
Specialized value object compliant map for variants, based on indexes.
static void registerCommand(const CommandHtmlHelp &command)
Register a command.
static bool registered(const QString &helpContext)
Help already registered.
Streamable status message, e.g.
Status messages, e.g. from Core -> GUI.
Value object encapsulating information of aircraft's parts.
Value object encapsulating a list of aircraft parts.
Value object encapsulating a list of aircraft parts.
Value object encapsulating information of an aircraft's situation.
GndElevationInfo
Where did we get elevation from?
List of aircraft situations.
Value object encapsulating information of airport ICAO data.
Value object encapsulating information about an ATC station.
Value object for a list of ATC stations.
Value object encapsulating information of a callsign.
Value object for a set of callsigns.
Value object for a flight plan.
Plane of same elevation, can be a single point or larger area (e.g. airport).
Value object encapsulating a list of voice rooms.
Value object encapsulating information about a connection status.
Value object encapsulating information about login mode.
Value object encapsulating information of a FSD server.
Value object encapsulating a list of servers.
Value object encapsulating information of a text message.
Value object encapsulating a list of text messages.
Value object encapsulating information of a user.
Value object encapsulating a list of voice rooms.
Direct in memory access to client (network client) data.
Physical unit length (length).
static const CLength & null()
Aircraft model (used by another pilot, my models on disk).
Current situation in the skies analyzed.
Comprehensive information of an aircraft.
Value object encapsulating a list of aircraft.
Simple hardcoded info about the corresponding simulator.
Direct thread safe in memory access to remote aircraft.
Direct in memory access to elevation data.
#define SWIFT_CORE_CONTEXTNETWORK_INTERFACENAME
DBus interface for context.
Backend services of the swift project, like dealing with the network or the simulators.
Free functions in swift::misc.
Milliseconds minimum/maximum/mean.
#define SWIFT_CORE_EXPORT
Export a class or function from the library.