Ref T231, formatting

This commit is contained in:
Klaus Basan
2018-01-24 01:41:07 +01:00
parent b76a82398f
commit 3da834e964
3 changed files with 11 additions and 8 deletions

View File

@@ -27,7 +27,7 @@ namespace BlackMisc
m_isVtol(isVtolAircraft), m_hasParts(hasParts), m_logInterpolation(log) m_isVtol(isVtolAircraft), m_hasParts(hasParts), m_logInterpolation(log)
{ } { }
CAltitude CInterpolationHints::getGroundElevation(const Aviation::CAircraftSituation &situation) const CAltitude CInterpolationHints::getGroundElevation(const CAircraftSituation &situation) const
{ {
if (m_elevationProvider) { return m_elevationProvider(situation); } if (m_elevationProvider) { return m_elevationProvider(situation); }
if (m_elevationPlane.isNull() || !m_elevationPlane.isWithinRange(situation)) { return CAltitude::null(); } if (m_elevationPlane.isNull() || !m_elevationPlane.isWithinRange(situation)) { return CAltitude::null(); }

View File

@@ -10,6 +10,7 @@
#include "interpolationrenderingsetup.h" #include "interpolationrenderingsetup.h"
#include "stringutils.h" #include "stringutils.h"
using namespace BlackMisc::Aviation;
using namespace BlackMisc::PhysicalQuantities; using namespace BlackMisc::PhysicalQuantities;
namespace BlackMisc namespace BlackMisc
@@ -151,7 +152,7 @@ namespace BlackMisc
m_callsignsToLog.clear(); m_callsignsToLog.clear();
} }
BlackMisc::Aviation::CCallsignSet CInterpolationAndRenderingSetup::getLogCallsigns() const CCallsignSet CInterpolationAndRenderingSetup::getLogCallsigns() const
{ {
return m_callsignsToLog; return m_callsignsToLog;
} }

View File

@@ -206,9 +206,9 @@ namespace BlackSimPlugin
return false; return false;
} }
void CSimulatorFsxCommon::displayStatusMessage(const BlackMisc::CStatusMessage &message) const void CSimulatorFsxCommon::displayStatusMessage(const CStatusMessage &message) const
{ {
QByteArray m = message.getMessage().toLocal8Bit().constData(); QByteArray m = message.getMessage().toLatin1().constData();
m.append('\0'); m.append('\0');
SIMCONNECT_TEXT_TYPE type = SIMCONNECT_TEXT_TYPE_PRINT_BLACK; SIMCONNECT_TEXT_TYPE type = SIMCONNECT_TEXT_TYPE_PRINT_BLACK;
@@ -224,7 +224,7 @@ namespace BlackSimPlugin
Q_UNUSED(hr); Q_UNUSED(hr);
} }
void CSimulatorFsxCommon::displayTextMessage(const BlackMisc::Network::CTextMessage &message) const void CSimulatorFsxCommon::displayTextMessage(const CTextMessage &message) const
{ {
this->displayStatusMessage(message.asStatusMessage(true, true)); this->displayStatusMessage(message.asStatusMessage(true, true));
} }
@@ -482,13 +482,14 @@ namespace BlackSimPlugin
} }
} }
// CElevationPlane: deg, deg, feet
CElevationPlane elevation(remoteAircraftData.latitude, remoteAircraftData.longitude, remoteAircraftData.elevation); CElevationPlane elevation(remoteAircraftData.latitude, remoteAircraftData.longitude, remoteAircraftData.elevation);
elevation.setSinglePointRadius(); elevation.setSinglePointRadius();
// const QString debug(hints.debugInfo(elevation)); // const QString debug(hints.debugInfo(elevation));
CInterpolationHints &hints = m_hints[simObject.getCallsign()]; CInterpolationHints &hints = m_hints[simObject.getCallsign()];
hints.setElevationPlane(elevation); // update elevation hints.setElevationPlane(elevation); // update elevation
hints.setCGAboveGround({ remoteAircraftData.cgToGround, CLengthUnit::ft() }); // normally never changing, but if user changes ModelMatching hints.setCGAboveGround({ remoteAircraftData.cgToGround, CLengthUnit::ft() }); // normally never changing, but if user changes ModelMatching update possible
// set it in the remote aircraft provider // set it in the remote aircraft provider
this->updateAircraftGroundElevation(simObject.getCallsign(), elevation); this->updateAircraftGroundElevation(simObject.getCallsign(), elevation);
@@ -1165,6 +1166,7 @@ namespace BlackSimPlugin
} }
} }
} // all callsigns } // all callsigns
const qint64 dt = QDateTime::currentMSecsSinceEpoch() - currentTimestamp; const qint64 dt = QDateTime::currentMSecsSinceEpoch() - currentTimestamp;
m_statsUpdateAircraftTimeTotalMs += dt; m_statsUpdateAircraftTimeTotalMs += dt;
m_statsUpdateAircraftCountMs++; m_statsUpdateAircraftCountMs++;
@@ -1387,7 +1389,7 @@ namespace BlackSimPlugin
if (situation.isOnGroundInfoAvailable()) if (situation.isOnGroundInfoAvailable())
{ {
const bool onGround = situation.isOnGround() == CAircraftSituation::OnGround; const bool onGround = (situation.isOnGround() == CAircraftSituation::OnGround);
position.OnGround = onGround ? 1U : 0U; position.OnGround = onGround ? 1U : 0U;
} }
return position; return position;