mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 04:25:35 +08:00
Ref T773, style
This commit is contained in:
committed by
Mat Sutcliffe
parent
f4f34341e6
commit
5f1bd14fcf
@@ -1363,18 +1363,22 @@ namespace BlackCore
|
||||
if (!correctedSituation.hasGroundElevation() && !canLikelySkipNearGround)
|
||||
{
|
||||
// fetch from cache or request
|
||||
const CAircraftSituationList situations = this->remoteAircraftSituations(callsign);
|
||||
const CAircraftSituationList situations = this->remoteAircraftSituations(callsign);
|
||||
const CAircraftSituation situationWithElv = situations.findCLosestElevationWithinRange(correctedSituation, correctedSituation.getDistancePerTime(100, CElevationPlane::singlePointRadius()));
|
||||
if (!situationWithElv.getGroundElevation().isNull())
|
||||
{
|
||||
// from nearby situations of own aircraft
|
||||
correctedSituation.transferGroundElevation(situationWithElv);
|
||||
}
|
||||
else
|
||||
{
|
||||
// from cache
|
||||
const CLength distance(correctedSituation.getDistancePerTime250ms(CElevationPlane::singlePointRadius())); // distance per ms
|
||||
const CElevationPlane ep = this->findClosestElevationWithinRangeOrRequest(correctedSituation, distance, callsign);
|
||||
haveRequestedElevation = ep.isNull(); // NULL means we requested
|
||||
Q_ASSERT_X(ep.isNull() || !ep.getRadius().isNull(), Q_FUNC_INFO, "null radius");
|
||||
haveRequestedElevation = ep.isNull(); // NULL means we requested
|
||||
Q_ASSERT_X(haveRequestedElevation || !ep.getRadius().isNull(), Q_FUNC_INFO, "null radius");
|
||||
|
||||
// also can handle NULL elevations
|
||||
correctedSituation.setGroundElevation(ep, CAircraftSituation::FromCache);
|
||||
}
|
||||
|
||||
@@ -1382,7 +1386,7 @@ namespace BlackCore
|
||||
{
|
||||
// we have a new situation, so we try to get the elevation
|
||||
// so far we have requested it, but we set it upfront either by
|
||||
// a) average value from other plane in the vicinity or
|
||||
// a) average value from other planes in the vicinity or
|
||||
// b) by extrapolating
|
||||
const CElevationPlane averagePlane = this->averageElevationOfNonMovingAircraft(situation, CElevationPlane::majorAirportRadius(), 2);
|
||||
if (!averagePlane.isNull())
|
||||
@@ -1392,7 +1396,7 @@ namespace BlackCore
|
||||
else
|
||||
{
|
||||
// values before updating (i.e. "storing") so the new situation is not yet considered
|
||||
const CAircraftSituationList oldSituations = this->remoteAircraftSituations(callsign);
|
||||
const CAircraftSituationList oldSituations = this->remoteAircraftSituations(callsign);
|
||||
const CAircraftSituationChangeList oldChanges = this->remoteAircraftSituationChanges(callsign);
|
||||
if (oldSituations.size() > 1)
|
||||
{
|
||||
|
||||
@@ -298,14 +298,14 @@ namespace BlackCore
|
||||
static constexpr int FastProcessIntervalMs = 50; //!< interval in ms
|
||||
QTimer m_fastProcessTimer; //!< process timer for fast updates
|
||||
|
||||
//! Processing by timer
|
||||
//! Fast processing by timer
|
||||
void fastProcessing();
|
||||
|
||||
// Processing for validations etc. (slow)
|
||||
static constexpr int SlowProcessIntervalMs = 125 * 1000; //!< interval in ms
|
||||
QTimer m_slowProcessTimer; //!< process timer for slow updates
|
||||
|
||||
//! Slow processing
|
||||
//! Slow processing by timer
|
||||
void slowProcessing();
|
||||
|
||||
// model matching times
|
||||
|
||||
@@ -408,7 +408,7 @@ namespace BlackCore
|
||||
protected:
|
||||
//! Constructor with all the providers
|
||||
ISimulator(const BlackMisc::Simulation::CSimulatorPluginInfo &pluginInfo,
|
||||
BlackMisc::Simulation::IOwnAircraftProvider *ownAircraftProvider,
|
||||
BlackMisc::Simulation::IOwnAircraftProvider *ownAircraftProvider,
|
||||
BlackMisc::Simulation::IRemoteAircraftProvider *remoteAircraftProvider,
|
||||
BlackMisc::Weather::IWeatherGridProvider *weatherGridProvider,
|
||||
BlackMisc::Network::IClientProvider *clientProvider,
|
||||
|
||||
@@ -68,9 +68,9 @@ namespace BlackGui
|
||||
ui->le_TxtMsgTo->setValidator(new CUpperCaseValidator(ui->le_TxtMsgFrom));
|
||||
ui->le_AtisCallsign->setValidator(new CUpperCaseValidator(ui->le_AtisCallsign));
|
||||
|
||||
connect(ui->pb_SendAircraftPartsGui, &QPushButton::released, this, &CInternalsComponent::sendAircraftParts);
|
||||
connect(ui->pb_SendAircraftPartsGui, &QPushButton::released, this, &CInternalsComponent::sendAircraftParts);
|
||||
connect(ui->pb_SendAircraftPartsJson, &QPushButton::released, this, &CInternalsComponent::sendAircraftParts);
|
||||
connect(ui->pb_CurrentParts, &QPushButton::released, this, &CInternalsComponent::setCurrentParts);
|
||||
connect(ui->pb_CurrentParts, &QPushButton::released, this, &CInternalsComponent::setCurrentParts);
|
||||
|
||||
connect(ui->cb_DebugContextAudio, &QCheckBox::stateChanged, this, &CInternalsComponent::enableDebug);
|
||||
connect(ui->cb_DebugContextApplication, &QCheckBox::stateChanged, this, &CInternalsComponent::enableDebug);
|
||||
@@ -92,7 +92,7 @@ namespace BlackGui
|
||||
|
||||
connect(ui->pb_NetworkUpdateAndReset, &QPushButton::released, this, &CInternalsComponent::networkStatistics);
|
||||
connect(ui->pb_NetworkUpdate, &QPushButton::released, this, &CInternalsComponent::networkStatistics);
|
||||
connect(ui->cb_NetworkStatistics, &QCheckBox::stateChanged, this, &CInternalsComponent::onNetworkStatisticsToggled);
|
||||
connect(ui->cb_NetworkStatistics, &QCheckBox::stateChanged, this, &CInternalsComponent::onNetworkStatisticsToggled);
|
||||
|
||||
connect(ui->comp_RemoteAircraftSelector, &CRemoteAircraftSelector::changedCallsign, this, &CInternalsComponent::selectorChanged);
|
||||
|
||||
@@ -152,7 +152,7 @@ namespace BlackGui
|
||||
if (reply != QMessageBox::Yes) { return; }
|
||||
client.addCapability(CClient::FsdWithAircraftConfig);
|
||||
const bool enabled = sGui->getIContextNetwork()->setOtherClient(client);
|
||||
Q_UNUSED(enabled);
|
||||
Q_UNUSED(enabled)
|
||||
}
|
||||
|
||||
const bool json = (QObject::sender() == ui->pb_SendAircraftPartsJson);
|
||||
|
||||
@@ -64,24 +64,24 @@ namespace BlackGui
|
||||
m_elvHistoryCount = elvHistoryCount;
|
||||
ui->le_ElvHistoryCount->setText(QString::number(elvHistoryCount));
|
||||
|
||||
connect(&m_updateTimer, &QTimer::timeout, this, &CInterpolationLogDisplay::updateLog);
|
||||
connect(ui->comp_CallsignCompleter, &CCallsignCompleter::editingFinishedDigest, this, &CInterpolationLogDisplay::onCallsignEntered);
|
||||
connect(ui->hs_UpdateTime, &QSlider::valueChanged, this, &CInterpolationLogDisplay::onSliderChanged);
|
||||
connect(ui->pb_StartStop, &QPushButton::released, this, &CInterpolationLogDisplay::toggleStartStop);
|
||||
connect(ui->pb_ResetLastSent, &QPushButton::released, this, &CInterpolationLogDisplay::resetLastSentValues);
|
||||
connect(ui->pb_ResetStats, &QPushButton::released, this, &CInterpolationLogDisplay::resetStatistics);
|
||||
connect(ui->pb_ShowLogInSimulator, &QPushButton::released, this, &CInterpolationLogDisplay::showLogInSimulator);
|
||||
connect(ui->pb_FollowInSimulator, &QPushButton::released, this, &CInterpolationLogDisplay::followInSimulator);
|
||||
connect(ui->pb_RequestElevation1, &QPushButton::released, this, &CInterpolationLogDisplay::requestElevationClicked);
|
||||
connect(ui->pb_RequestElevation2, &QPushButton::released, this, &CInterpolationLogDisplay::requestElevationClicked);
|
||||
connect(&m_updateTimer, &QTimer::timeout, this, &CInterpolationLogDisplay::updateLog);
|
||||
connect(ui->comp_CallsignCompleter, &CCallsignCompleter::editingFinishedDigest, this, &CInterpolationLogDisplay::onCallsignEntered);
|
||||
connect(ui->hs_UpdateTime, &QSlider::valueChanged, this, &CInterpolationLogDisplay::onSliderChanged);
|
||||
connect(ui->pb_StartStop, &QPushButton::released, this, &CInterpolationLogDisplay::toggleStartStop);
|
||||
connect(ui->pb_ResetLastSent, &QPushButton::released, this, &CInterpolationLogDisplay::resetLastSentValues);
|
||||
connect(ui->pb_ResetStats, &QPushButton::released, this, &CInterpolationLogDisplay::resetStatistics);
|
||||
connect(ui->pb_ShowLogInSimulator, &QPushButton::released, this, &CInterpolationLogDisplay::showLogInSimulator);
|
||||
connect(ui->pb_FollowInSimulator, &QPushButton::released, this, &CInterpolationLogDisplay::followInSimulator);
|
||||
connect(ui->pb_RequestElevation1, &QPushButton::released, this, &CInterpolationLogDisplay::requestElevationClicked);
|
||||
connect(ui->pb_RequestElevation2, &QPushButton::released, this, &CInterpolationLogDisplay::requestElevationClicked);
|
||||
connect(ui->pb_GetLastInterpolation, &QPushButton::released, this, &CInterpolationLogDisplay::getLogAmdDisplayLastInterpolation);
|
||||
connect(ui->pb_InjectElevation, &QPushButton::released, this, &CInterpolationLogDisplay::onInjectElevation);
|
||||
connect(ui->pb_ElvClear, &QPushButton::released, this, &CInterpolationLogDisplay::clearElevationResults);
|
||||
connect(ui->pb_InjectElevation, &QPushButton::released, this, &CInterpolationLogDisplay::onInjectElevation);
|
||||
connect(ui->pb_ElvClear, &QPushButton::released, this, &CInterpolationLogDisplay::clearElevationResults);
|
||||
connect(ui->tvp_InboundAircraftSituations, &CAircraftSituationView::requestElevation, this, &CInterpolationLogDisplay::requestElevation);
|
||||
connect(ui->le_InjectElevation, &QLineEdit::returnPressed, this, &CInterpolationLogDisplay::onInjectElevation);
|
||||
connect(ui->le_ElvHistoryCount, &QLineEdit::editingFinished, this, &CInterpolationLogDisplay::onElevationHistoryCountFinished);
|
||||
connect(ui->cb_ElvAllowPseudo, &QCheckBox::toggled, this, &CInterpolationLogDisplay::onPseudoElevationToggled);
|
||||
connect(ui->editor_ElevationCoordinate, &CCoordinateForm::changedCoordinate, this, &CInterpolationLogDisplay::requestElevationAtPosition);
|
||||
connect(ui->cb_ElvAllowPseudo, &QCheckBox::toggled, this, &CInterpolationLogDisplay::onPseudoElevationToggled);
|
||||
connect(sGui, &CGuiApplication::aboutToShutdown, this, &CInterpolationLogDisplay::onAboutToShutdown, Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
@@ -474,8 +474,7 @@ namespace BlackGui
|
||||
|
||||
if (!m_simulator->isLogCallsign(m_callsign))
|
||||
{
|
||||
static const CStatusMessage ms = CStatusMessage(this).validationError(u"No longer logging callsign");
|
||||
m = ms;
|
||||
m = CStatusMessage(this).validationError(u"No longer logging callsign '%1'") << m_callsign;
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -1048,7 +1048,7 @@ namespace BlackMisc
|
||||
|
||||
bool CAircraftSituation::canLikelySkipNearGroundInterpolation() const
|
||||
{
|
||||
// those we can exclude
|
||||
// those we can exclude, we are ON GROUND
|
||||
if (this->isOnGround() && this->hasInboundGroundDetails()) { return false; }
|
||||
|
||||
// cases where we can skip
|
||||
|
||||
@@ -37,9 +37,10 @@ namespace BlackMisc
|
||||
{
|
||||
template <typename Derived>
|
||||
CInterpolator<Derived>::CInterpolator(const CCallsign &callsign,
|
||||
ISimulationEnvironmentProvider *simEnvProvider, IInterpolationSetupProvider *setupProvider,
|
||||
ISimulationEnvironmentProvider *simEnvProvider,
|
||||
IInterpolationSetupProvider *setupProvider,
|
||||
IRemoteAircraftProvider *remoteProvider,
|
||||
CInterpolationLogger *logger) : m_callsign(callsign)
|
||||
CInterpolationLogger *logger) : m_callsign(callsign)
|
||||
{
|
||||
// normally when created m_cg is still null since there is no CG in the provider yet
|
||||
|
||||
@@ -105,7 +106,7 @@ namespace BlackMisc
|
||||
{
|
||||
const CLength addValue = os * -1.0; // positive values means too high, negative values too low
|
||||
int changed = validSituations.addAltitudeOffset(addValue);
|
||||
Q_UNUSED(changed);
|
||||
Q_UNUSED(changed)
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -318,13 +319,13 @@ namespace BlackMisc
|
||||
if (this->doLogging())
|
||||
{
|
||||
log.tsCurrent = m_currentTimeMsSinceEpoch;
|
||||
log.callsign = m_callsign;
|
||||
log.groundFactor = currentSituation.getOnGroundFactor();
|
||||
log.altCorrection = CAircraftSituation::altitudeCorrectionToString(altCorrection);
|
||||
log.situationCurrent = currentSituation;
|
||||
log.callsign = m_callsign;
|
||||
log.groundFactor = currentSituation.getOnGroundFactor();
|
||||
log.altCorrection = CAircraftSituation::altitudeCorrectionToString(altCorrection);
|
||||
log.situationCurrent = currentSituation;
|
||||
log.interpolantRecalc = interpolant.isRecalculated();
|
||||
log.change = m_pastSituationsChange;
|
||||
log.usedSetup = m_currentSetup;
|
||||
log.change = m_pastSituationsChange;
|
||||
log.usedSetup = m_currentSetup;
|
||||
log.elevationInfo = this->getElevationsFoundMissedInfo();
|
||||
log.cgAboveGround = currentSituation.getCG();
|
||||
log.sceneryOffset = m_currentSceneryOffset;
|
||||
@@ -573,7 +574,7 @@ namespace BlackMisc
|
||||
|
||||
// preset elevation here, as we do not know where the situation will be after the interpolation step!
|
||||
const bool preset = currentSituation.presetGroundElevation(oldSituation, newSituation, m_pastSituationsChange);
|
||||
Q_UNUSED(preset);
|
||||
Q_UNUSED(preset)
|
||||
|
||||
// fetch CG once
|
||||
const CLength cg(this->getModelCG());
|
||||
@@ -656,8 +657,8 @@ namespace BlackMisc
|
||||
{
|
||||
m_extraInfo.clear();
|
||||
m_isValidSituation = false;
|
||||
m_isInterpolated = false;
|
||||
m_isSameSituation = false;
|
||||
m_isInterpolated = false;
|
||||
m_isSameSituation = false;
|
||||
m_situations = -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -167,14 +167,14 @@ namespace BlackMisc
|
||||
|
||||
//! Implicit conversion @{
|
||||
operator const Aviation::CAircraftSituation &() const { return m_interpolatedSituation; }
|
||||
operator const Aviation::CAircraftParts &() const { return m_interpolatedParts; }
|
||||
operator const Aviation::CAircraftParts &() const { return m_interpolatedParts; }
|
||||
//! @}
|
||||
|
||||
private:
|
||||
Aviation::CAircraftSituation m_interpolatedSituation; //!< interpolated situation
|
||||
Aviation::CAircraftParts m_interpolatedParts; //!< guessed or interpolated parts
|
||||
CInterpolationStatus m_interpolationStatus; //!< interpolation status
|
||||
CPartsStatus m_partsStatus; //!< parts status
|
||||
Aviation::CAircraftParts m_interpolatedParts; //!< guessed or interpolated parts
|
||||
CInterpolationStatus m_interpolationStatus; //!< interpolation status
|
||||
CPartsStatus m_partsStatus; //!< parts status
|
||||
};
|
||||
|
||||
//! Interpolator, calculation inbetween positions
|
||||
|
||||
Reference in New Issue
Block a user