Ref T778, also update sim.data if elevation did change

Use ISimulator::isEqualLastSent in equalPbhVectorAltitudeElevation
This commit is contained in:
Klaus Basan
2020-04-05 03:40:49 +02:00
committed by Mat Sutcliffe
parent 46d417c5a2
commit cc887ea0f8
3 changed files with 13 additions and 1 deletions

View File

@@ -656,7 +656,8 @@ namespace BlackCore
Q_ASSERT_X(compare.hasCallsign(), Q_FUNC_INFO, "Need callsign");
if (!m_lastSentSituations.contains(compare.getCallsign())) { return false; }
if (compare.isNull()) { return false; }
return compare.equalPbhVectorAltitude(m_lastSentSituations.value(compare.getCallsign()));
return compare.equalPbhVectorAltitudeElevation(m_lastSentSituations.value(compare.getCallsign()));
// return compare.equalPbhVectorAltitude(m_lastSentSituations.value(compare.getCallsign()));
}
bool ISimulator::isEqualLastSent(const CAircraftParts &compare, const CCallsign &callsign) const

View File

@@ -467,6 +467,13 @@ namespace BlackMisc
return c == 0;
}
bool CAircraftSituation::equalPbhVectorAltitudeElevation(const CAircraftSituation &other) const
{
if (!this->equalPbhVectorAltitude(other)) { return false; }
const int c = this->getGroundElevation().compare(other.getGroundElevation());
return c == 0;
}
void CAircraftSituation::setNull()
{
m_position.setNull();

View File

@@ -190,6 +190,10 @@ namespace BlackMisc
//! \sa Geo::ICoordinateGeodetic::equalNormalVectorDouble
bool equalPbhVectorAltitude(const CAircraftSituation &other) const;
//! Equal PBH and vecto, plus altitude/elevation
//! \sa Geo::ICoordinateGeodetic::equalNormalVectorDouble
bool equalPbhVectorAltitudeElevation(const CAircraftSituation &other) const;
//! Set to null
void setNull();