feat(xswiftbus): Expose callsign as dataref

Fixes #379
This commit is contained in:
Lars Toenning
2025-12-12 20:28:04 +01:00
parent a71b8e3491
commit 2cb18c5b90
12 changed files with 90 additions and 9 deletions

View File

@@ -802,12 +802,15 @@ namespace swift::core::context
{
Q_UNUSED(from)
SWIFT_VERIFY_X(this->getIContextNetwork(), Q_FUNC_INFO, "Missing network context");
SWIFT_VERIFY_X(this->getIContextOwnAircraft(), Q_FUNC_INFO, "Missing own aircraft context");
if (to.isConnected() && this->getIContextNetwork())
{
m_networkSessionId = this->getIContextNetwork()->getConnectedServer().getServerSessionId(false);
if (m_simulatorPlugin.second) // check in case the plugin has been unloaded
{
m_simulatorPlugin.second->setFlightNetworkConnected(true);
m_simulatorPlugin.second->setOwnCallsign(
this->getIContextOwnAircraft()->getOwnAircraft().getCallsign());
}
}
else if (to.isDisconnected())
@@ -821,6 +824,7 @@ namespace swift::core::context
{
m_simulatorPlugin.second->removeAllRemoteAircraft(); // also removes aircraft
m_simulatorPlugin.second->setFlightNetworkConnected(false);
m_simulatorPlugin.second->setOwnCallsign({});
}
}
}