mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 16:56:53 +08:00
refactor: Move OnGround information to own class
This commit is contained in:
@@ -59,7 +59,7 @@ namespace BlackSimPlugin::Flightgear
|
||||
this->pitchesDeg.push_back(situation.getPitch().value(BlackMisc::PhysicalQuantities::CAngleUnit::deg()));
|
||||
this->rollsDeg.push_back(situation.getBank().value(BlackMisc::PhysicalQuantities::CAngleUnit::deg()));
|
||||
this->headingsDeg.push_back(situation.getHeading().value(BlackMisc::PhysicalQuantities::CAngleUnit::deg()));
|
||||
this->onGrounds.push_back(situation.getOnGround() == BlackMisc::Aviation::CAircraftSituation::OnGround);
|
||||
this->onGrounds.push_back(situation.isOnGround());
|
||||
this->groundSpeedKts.push_back(situation.getGroundSpeed().value(BlackMisc::PhysicalQuantities::CSpeedUnit::kts()));
|
||||
}
|
||||
|
||||
|
||||
@@ -652,7 +652,7 @@ namespace BlackSimPlugin::FsxCommon
|
||||
aircraftSituation.setPressureAltitude(CAltitude(simulatorOwnAircraft.pressureAltitudeM, CAltitude::MeanSeaLevel, CAltitude::PressureAltitude, CLengthUnit::m()));
|
||||
// set on ground also in situation for consistency and future usage
|
||||
// it is duplicated in parts
|
||||
aircraftSituation.setOnGround(dtb(simulatorOwnAircraft.simOnGround) ? CAircraftSituation::OnGround : CAircraftSituation::NotOnGround, CAircraftSituation::OutOnGroundOwnAircraft);
|
||||
aircraftSituation.setOnGroundInfo({ dtb(simulatorOwnAircraft.simOnGround) ? COnGroundInfo::OnGround : COnGroundInfo::NotOnGround, COnGroundInfo::OutOnGroundOwnAircraft });
|
||||
|
||||
CAircraftVelocity aircraftVelocity(simulatorOwnAircraft.velocityWorldX,
|
||||
simulatorOwnAircraft.velocityWorldY,
|
||||
@@ -2236,7 +2236,7 @@ namespace BlackSimPlugin::FsxCommon
|
||||
// send GND flag also when underflow detection is available
|
||||
if ((sendGnd || forceUnderflowDetection) && situation.isOnGroundInfoAvailable())
|
||||
{
|
||||
const bool onGround = (situation.getOnGround() == CAircraftSituation::OnGround);
|
||||
const bool onGround = situation.isOnGround();
|
||||
position.OnGround = onGround ? 1U : 0U;
|
||||
}
|
||||
|
||||
|
||||
@@ -953,7 +953,7 @@ namespace BlackSimPlugin::XPlane
|
||||
// adjust altitude to compensate for XP12 temperature effect
|
||||
const CLength relativeAltitude = interpolatedSituation.geodeticHeight() - getOwnAircraftPosition().geodeticHeight();
|
||||
const double altitudeDeltaWeight = 2 - qBound(3000.0, relativeAltitude.abs().value(CLengthUnit::ft()), 6000.0) / 3000;
|
||||
const CLength alt = interpolatedSituation.getAltitude() + m_altitudeDelta * altitudeDeltaWeight * (1 - interpolatedSituation.getOnGroundFactor());
|
||||
const CLength alt = interpolatedSituation.getAltitude() + m_altitudeDelta * altitudeDeltaWeight * (1 - interpolatedSituation.getOnGroundInfo().getGroundFactor());
|
||||
interpolatedSituation.setAltitude({ alt, interpolatedSituation.getAltitude().getReferenceDatum() });
|
||||
|
||||
// update situation
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace BlackSimPlugin::XPlane
|
||||
this->pitchesDeg.push_back(situation.getPitch().value(BlackMisc::PhysicalQuantities::CAngleUnit::deg()));
|
||||
this->rollsDeg.push_back(situation.getBank().value(BlackMisc::PhysicalQuantities::CAngleUnit::deg()));
|
||||
this->headingsDeg.push_back(situation.getHeading().value(BlackMisc::PhysicalQuantities::CAngleUnit::deg()));
|
||||
this->onGrounds.push_back(situation.getOnGround() == BlackMisc::Aviation::CAircraftSituation::OnGround);
|
||||
this->onGrounds.push_back(situation.isOnGround());
|
||||
}
|
||||
|
||||
QStringList callsigns; //!< List of callsigns
|
||||
|
||||
Reference in New Issue
Block a user