mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-21 12:55:31 +08:00
Ref T261, minor airspace monitor improvements and formatting
This commit is contained in:
committed by
Roland Winklmeier
parent
ac953de6fd
commit
4876569a9d
@@ -129,13 +129,6 @@ namespace BlackCore
|
|||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CAirspaceMonitor::updateAircraftGroundElevation(const CCallsign &callsign, const CElevationPlane &elevation)
|
|
||||||
{
|
|
||||||
const bool vtol = this->isVtolAircraft(callsign);
|
|
||||||
const CLength cg = this->getCG(callsign);
|
|
||||||
return this->updateAircraftGroundElevationExt(callsign, elevation, vtol, cg, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
const CLogCategoryList &CAirspaceMonitor::getLogCategories()
|
const CLogCategoryList &CAirspaceMonitor::getLogCategories()
|
||||||
{
|
{
|
||||||
static const CLogCategoryList cats { CLogCategory::matching(), CLogCategory::network() };
|
static const CLogCategoryList cats { CLogCategory::matching(), CLogCategory::network() };
|
||||||
@@ -878,16 +871,14 @@ namespace BlackCore
|
|||||||
Q_UNUSED(oldStatus);
|
Q_UNUSED(oldStatus);
|
||||||
switch (newStatus)
|
switch (newStatus)
|
||||||
{
|
{
|
||||||
case INetwork::Connected:
|
case INetwork::Connected: break;
|
||||||
break;
|
|
||||||
case INetwork::Disconnected:
|
case INetwork::Disconnected:
|
||||||
case INetwork::DisconnectedError:
|
case INetwork::DisconnectedError:
|
||||||
case INetwork::DisconnectedLost:
|
case INetwork::DisconnectedLost:
|
||||||
case INetwork::DisconnectedFailed:
|
case INetwork::DisconnectedFailed:
|
||||||
this->clear();
|
this->clear();
|
||||||
break;
|
break;
|
||||||
default:
|
default: break;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -954,17 +945,26 @@ namespace BlackCore
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this->guessOnGround(correctedSituation); // does nothing if situation is not appropriate for guessing
|
this->guessOnGroundAndUpdateModelCG(correctedSituation); // does nothing if situation is not appropriate for guessing
|
||||||
CRemoteAircraftProvider::storeAircraftSituation(correctedSituation);
|
CRemoteAircraftProvider::storeAircraftSituation(correctedSituation);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CAirspaceMonitor::guessOnGround(CAircraftSituation &situation) const
|
bool CAirspaceMonitor::guessOnGroundAndUpdateModelCG(CAircraftSituation &situation)
|
||||||
{
|
{
|
||||||
if (!situation.shouldGuessOnGround()) { return false; }
|
|
||||||
const CCallsign callsign(situation.getCallsign());
|
const CCallsign callsign(situation.getCallsign());
|
||||||
const bool vtol = this->isVtolAircraft(callsign);
|
CAircraftModel aircraftModel = this->getAircraftInRangeModelForCallsign(callsign);
|
||||||
const CLength cg = this->getCG(callsign);
|
const CLength cg = this->getCG(callsign); // always x-check against simulator to override guessed values and reflect changed CGs
|
||||||
return situation.guessOnGround(vtol, cg);
|
if (!cg.isNull() && aircraftModel.getCG() != cg)
|
||||||
|
{
|
||||||
|
aircraftModel.setCG(cg);
|
||||||
|
this->updateCG(callsign, cg); // model's CG in remote provider
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!cg.isNull()) { situation.setCG(cg); }
|
||||||
|
const CAircraftSituationChange change = this->remoteAircraftSituationChange(callsign);
|
||||||
|
|
||||||
|
if (!situation.shouldGuessOnGround()) { return false; }
|
||||||
|
return situation.guessOnGround(change, aircraftModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CAirspaceMonitor::sendInitialAtcQueries(const CCallsign &callsign)
|
void CAirspaceMonitor::sendInitialAtcQueries(const CCallsign &callsign)
|
||||||
|
|||||||
@@ -76,7 +76,6 @@ namespace BlackCore
|
|||||||
virtual QObject *asQObject() override { return this; }
|
virtual QObject *asQObject() override { return this; }
|
||||||
virtual BlackMisc::Simulation::CAirspaceAircraftSnapshot getLatestAirspaceAircraftSnapshot() const override;
|
virtual BlackMisc::Simulation::CAirspaceAircraftSnapshot getLatestAirspaceAircraftSnapshot() const override;
|
||||||
virtual bool updateFastPositionEnabled(const BlackMisc::Aviation::CCallsign &callsign, bool enableFastPositonUpdates) override;
|
virtual bool updateFastPositionEnabled(const BlackMisc::Aviation::CCallsign &callsign, bool enableFastPositonUpdates) override;
|
||||||
virtual int updateAircraftGroundElevation(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Geo::CElevationPlane &elevation) override;
|
|
||||||
//! @}
|
//! @}
|
||||||
|
|
||||||
//! Returns the list of users we know about
|
//! Returns the list of users we know about
|
||||||
@@ -170,8 +169,9 @@ namespace BlackCore
|
|||||||
CAirspaceAnalyzer *m_analyzer = nullptr; //!< owned analyzer
|
CAirspaceAnalyzer *m_analyzer = nullptr; //!< owned analyzer
|
||||||
bool m_bookingsRequested = false; //!< bookings have been requested, it can happen we receive an BlackCore::Vatsim::CVatsimBookingReader::atcBookingsReadUnchanged signal
|
bool m_bookingsRequested = false; //!< bookings have been requested, it can happen we receive an BlackCore::Vatsim::CVatsimBookingReader::atcBookingsReadUnchanged signal
|
||||||
|
|
||||||
//! Guess situation if applicable
|
//! Guess situation "on ground" and update model's CG if applicable
|
||||||
bool guessOnGround(BlackMisc::Aviation::CAircraftSituation &situation) const;
|
//! \remark updates CG and ground flag in situation
|
||||||
|
bool guessOnGroundAndUpdateModelCG(BlackMisc::Aviation::CAircraftSituation &situation);
|
||||||
|
|
||||||
//! Remove ATC online stations
|
//! Remove ATC online stations
|
||||||
void removeAllOnlineAtcStations();
|
void removeAllOnlineAtcStations();
|
||||||
|
|||||||
Reference in New Issue
Block a user