mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-23 05:45:35 +08:00
Ref T709, style
This commit is contained in:
committed by
Mat Sutcliffe
parent
a596121ea2
commit
2fc01bc568
@@ -1321,7 +1321,7 @@ namespace BlackSimPlugin
|
|||||||
m_DBusConnection.disconnectFromBus(m_DBusConnection.name());
|
m_DBusConnection.disconnectFromBus(m_DBusConnection.name());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
checkConnectionCommon();
|
checkConnectionCommon(); // bus
|
||||||
m_DBusConnection.disconnectFromBus(m_DBusConnection.name());
|
m_DBusConnection.disconnectFromBus(m_DBusConnection.name());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1334,7 +1334,7 @@ namespace BlackSimPlugin
|
|||||||
m_DBusConnection.disconnectFromPeer(m_DBusConnection.name());
|
m_DBusConnection.disconnectFromPeer(m_DBusConnection.name());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
checkConnectionCommon();
|
checkConnectionCommon(); // peer
|
||||||
m_DBusConnection.disconnectFromPeer(m_DBusConnection.name());
|
m_DBusConnection.disconnectFromPeer(m_DBusConnection.name());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1344,11 +1344,11 @@ namespace BlackSimPlugin
|
|||||||
CXSwiftBusTrafficProxy traffic(m_DBusConnection);
|
CXSwiftBusTrafficProxy traffic(m_DBusConnection);
|
||||||
CXSwiftBusWeatherProxy weather(m_DBusConnection);
|
CXSwiftBusWeatherProxy weather(m_DBusConnection);
|
||||||
|
|
||||||
bool result = service.isValid() && traffic.isValid() && weather.isValid();
|
const bool result = service.isValid() && traffic.isValid() && weather.isValid();
|
||||||
if (! result) { return; }
|
if (!result) { return; }
|
||||||
|
|
||||||
QString swiftVersion = CBuildConfig::getVersionString();
|
const QString swiftVersion = CBuildConfig::getVersionString();
|
||||||
QString xswiftbusVersion = service.getVersionNumber();
|
const QString xswiftbusVersion = service.getVersionNumber();
|
||||||
if (xswiftbusVersion.isEmpty())
|
if (xswiftbusVersion.isEmpty())
|
||||||
{
|
{
|
||||||
CLogMessage(this).warning(u"Could not determine which version of XSwiftBus is running. Mismatched versions might cause instability.");
|
CLogMessage(this).warning(u"Could not determine which version of XSwiftBus is running. Mismatched versions might cause instability.");
|
||||||
@@ -1364,8 +1364,8 @@ namespace BlackSimPlugin
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
MultiplayerAcquireInfo info = traffic.acquireMultiplayerPlanes();
|
const MultiplayerAcquireInfo info = traffic.acquireMultiplayerPlanes();
|
||||||
if (! info.hasAcquired)
|
if (!info.hasAcquired)
|
||||||
{
|
{
|
||||||
CLogMessage(this).error(u"Connection to XSwiftBus successful, but could not acquire multiplayer planes. %1 has acquired them already. Disable %2 or remove it if not required and reload XSwiftBus.") << info.owner << info.owner;
|
CLogMessage(this).error(u"Connection to XSwiftBus successful, but could not acquire multiplayer planes. %1 has acquired them already. Disable %2 or remove it if not required and reload XSwiftBus.") << info.owner << info.owner;
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -822,8 +822,9 @@ namespace XSwiftBus
|
|||||||
|
|
||||||
int CTraffic::getPlaneData(void *id, int dataType, void *io_data)
|
int CTraffic::getPlaneData(void *id, int dataType, void *io_data)
|
||||||
{
|
{
|
||||||
auto planeIt = m_planesById.find(id);
|
const auto planeIt = m_planesById.find(id);
|
||||||
assert(planeIt != m_planesById.end());
|
// assert(planeIt != m_planesById.end());
|
||||||
|
if (planeIt == m_planesById.end()) { return xpmpData_Unavailable; } // less drastic version
|
||||||
Plane *plane = planeIt->second;
|
Plane *plane = planeIt->second;
|
||||||
if (!plane) { return xpmpData_Unavailable; }
|
if (!plane) { return xpmpData_Unavailable; }
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ namespace XSwiftBus
|
|||||||
CTraffic(ISettingsProvider *settingsProvider);
|
CTraffic(ISettingsProvider *settingsProvider);
|
||||||
|
|
||||||
//! Destructor
|
//! Destructor
|
||||||
~CTraffic() override;
|
virtual ~CTraffic() override;
|
||||||
|
|
||||||
//! DBus interface name
|
//! DBus interface name
|
||||||
static const std::string &InterfaceName()
|
static const std::string &InterfaceName()
|
||||||
@@ -139,9 +139,9 @@ namespace XSwiftBus
|
|||||||
//! Camera
|
//! Camera
|
||||||
struct DeltaCameraPosition
|
struct DeltaCameraPosition
|
||||||
{
|
{
|
||||||
double dx = 0.0;
|
double dx = 0.0;
|
||||||
double dy = 0.0;
|
double dy = 0.0;
|
||||||
double dz = 0.0;
|
double dz = 0.0;
|
||||||
double headingDeg = 0.0;
|
double headingDeg = 0.0;
|
||||||
double pitchDeg = 0.0;
|
double pitchDeg = 0.0;
|
||||||
bool isInitialized = false;
|
bool isInitialized = false;
|
||||||
@@ -241,7 +241,7 @@ namespace XSwiftBus
|
|||||||
static void planeLoaded(void *id, bool succeeded, void *self)
|
static void planeLoaded(void *id, bool succeeded, void *self)
|
||||||
{
|
{
|
||||||
auto *traffic = static_cast<CTraffic *>(self);
|
auto *traffic = static_cast<CTraffic *>(self);
|
||||||
auto planeIt = traffic->m_planesById.find(id);
|
auto planeIt = traffic->m_planesById.find(id);
|
||||||
if (planeIt == traffic->m_planesById.end()) { return; }
|
if (planeIt == traffic->m_planesById.end()) { return; }
|
||||||
|
|
||||||
if (succeeded) { traffic->emitPlaneAdded(planeIt->second->callsign); }
|
if (succeeded) { traffic->emitPlaneAdded(planeIt->second->callsign); }
|
||||||
|
|||||||
Reference in New Issue
Block a user