mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
Use "fixed "gear down" if on ground.
Reason: Some sims do send incorrect gear down. Follow up of T778
This commit is contained in:
committed by
Mat Sutcliffe
parent
df69ef47a0
commit
4e45249142
@@ -315,6 +315,11 @@ namespace BlackMisc
|
||||
m_lights.setAllOff();
|
||||
}
|
||||
|
||||
bool CAircraftParts::isFixedGearDown() const
|
||||
{
|
||||
return this->isGearDown() || this->isOnGround();
|
||||
}
|
||||
|
||||
CAircraftEngine CAircraftParts::getEngine(int number) const
|
||||
{
|
||||
return m_engines.getEngine(number);
|
||||
|
||||
@@ -101,6 +101,10 @@ namespace BlackMisc
|
||||
//! Is gear down?
|
||||
bool isGearDown() const { return m_gearDown; }
|
||||
|
||||
//! Is fixed gear down?
|
||||
//! \remark using also other attributes to decide if gear is down
|
||||
bool isFixedGearDown() const;
|
||||
|
||||
//! Set gear down
|
||||
void setGearDown(bool down) { m_gearDown = down; }
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ namespace BlackSimPlugin
|
||||
void push_back(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Aviation::CAircraftParts &parts)
|
||||
{
|
||||
this->callsigns.push_back(callsign.asString());
|
||||
this->gears.push_back(parts.isGearDown() ? 1 : 0);
|
||||
this->gears.push_back(parts.isFixedGearDown() ? 1 : 0);
|
||||
this->flaps.push_back(parts.getFlapsPercent() / 100.0);
|
||||
this->spoilers.push_back(parts.isSpoilersOut() ? 1 : 0);
|
||||
this->speedBrakes.push_back(parts.isSpoilersOut() ? 1 : 0);
|
||||
|
||||
@@ -356,7 +356,7 @@ namespace BlackSimPlugin
|
||||
|
||||
void DataDefinitionRemoteAircraftPartsWithoutLights::initFromParts(const CAircraftParts &parts)
|
||||
{
|
||||
gearHandlePosition = parts.isGearDown() ? 1.0 : 0.0;
|
||||
gearHandlePosition = parts.isFixedGearDown() ? 1.0 : 0.0;
|
||||
const double trail = parts.getFlapsPercent() / 100.0;
|
||||
const double lead = trail;
|
||||
flapsTrailingEdgeLeftPercent = trail;
|
||||
|
||||
@@ -93,7 +93,7 @@ namespace BlackSimPlugin
|
||||
void push_back(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Aviation::CAircraftParts &parts)
|
||||
{
|
||||
this->callsigns.push_back(callsign.asString());
|
||||
this->gears.push_back(parts.isGearDown() ? 1 : 0);
|
||||
this->gears.push_back(parts.isFixedGearDown() ? 1 : 0);
|
||||
this->flaps.push_back(parts.getFlapsPercent() / 100.0);
|
||||
this->spoilers.push_back(parts.isSpoilersOut() ? 1 : 0);
|
||||
this->speedBrakes.push_back(parts.isSpoilersOut() ? 1 : 0);
|
||||
|
||||
Reference in New Issue
Block a user