mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-22 13:15:39 +08:00
feat: Add wing light property
This commit is contained in:
@@ -23,14 +23,20 @@ namespace swift::misc::aviation
|
|||||||
m_logoOn(logoOn), m_recognitionOn(recognition), m_cabinOn(cabin)
|
m_logoOn(logoOn), m_recognitionOn(recognition), m_cabinOn(cabin)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
CAircraftLights::CAircraftLights(bool strobeOn, bool landingOn, bool taxiOn, bool beaconOn, bool navOn, bool logoOn,
|
||||||
|
bool recognition, bool cabin, bool wing)
|
||||||
|
: m_strobeOn(strobeOn), m_landingOn(landingOn), m_taxiOn(taxiOn), m_beaconOn(beaconOn), m_navOn(navOn),
|
||||||
|
m_logoOn(logoOn), m_recognitionOn(recognition), m_cabinOn(cabin), m_wingOn(wing)
|
||||||
|
{}
|
||||||
|
|
||||||
CAircraftLights CAircraftLights::allLightsOn()
|
CAircraftLights CAircraftLights::allLightsOn()
|
||||||
{
|
{
|
||||||
return CAircraftLights { true, true, true, true, true, true, true, true };
|
return CAircraftLights { true, true, true, true, true, true, true, true, true };
|
||||||
}
|
}
|
||||||
|
|
||||||
CAircraftLights CAircraftLights::allLightsOff()
|
CAircraftLights CAircraftLights::allLightsOff()
|
||||||
{
|
{
|
||||||
return CAircraftLights { false, false, false, false, false, false, false, false };
|
return CAircraftLights { false, false, false, false, false, false, false, false, false };
|
||||||
}
|
}
|
||||||
|
|
||||||
QString CAircraftLights::convertToQString(bool i18n) const
|
QString CAircraftLights::convertToQString(bool i18n) const
|
||||||
@@ -39,7 +45,8 @@ namespace swift::misc::aviation
|
|||||||
const QString s = u"strobe: " % boolToYesNo(m_strobeOn) % u" landing: " % boolToYesNo(m_landingOn) %
|
const QString s = u"strobe: " % boolToYesNo(m_strobeOn) % u" landing: " % boolToYesNo(m_landingOn) %
|
||||||
u" taxi: " % boolToYesNo(m_taxiOn) % u" beacon: " % boolToYesNo(m_beaconOn) % u" nav: " %
|
u" taxi: " % boolToYesNo(m_taxiOn) % u" beacon: " % boolToYesNo(m_beaconOn) % u" nav: " %
|
||||||
boolToYesNo(m_navOn) % u" logo: " % boolToYesNo(m_logoOn) % u" recognition: " %
|
boolToYesNo(m_navOn) % u" logo: " % boolToYesNo(m_logoOn) % u" recognition: " %
|
||||||
boolToYesNo(m_recognitionOn) % u" cabin: " % boolToYesNo(m_cabinOn);
|
boolToYesNo(m_recognitionOn) % u" cabin: " % boolToYesNo(m_cabinOn) % u" cabin: " %
|
||||||
|
boolToYesNo(m_wingOn);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,6 +66,7 @@ namespace swift::misc::aviation
|
|||||||
case IndexTaxi: return QVariant::fromValue(m_taxiOn);
|
case IndexTaxi: return QVariant::fromValue(m_taxiOn);
|
||||||
case IndexRecognition: return QVariant::fromValue(m_recognitionOn);
|
case IndexRecognition: return QVariant::fromValue(m_recognitionOn);
|
||||||
case IndexCabin: return QVariant::fromValue(m_cabinOn);
|
case IndexCabin: return QVariant::fromValue(m_cabinOn);
|
||||||
|
case IndexWing: return QVariant::fromValue(m_wingOn);
|
||||||
default: return CValueObject::propertyByIndex(index);
|
default: return CValueObject::propertyByIndex(index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -83,6 +91,7 @@ namespace swift::misc::aviation
|
|||||||
case IndexTaxi: m_taxiOn = variant.toBool(); break;
|
case IndexTaxi: m_taxiOn = variant.toBool(); break;
|
||||||
case IndexCabin: m_cabinOn = variant.toBool(); break;
|
case IndexCabin: m_cabinOn = variant.toBool(); break;
|
||||||
case IndexRecognition: m_recognitionOn = variant.toBool(); break;
|
case IndexRecognition: m_recognitionOn = variant.toBool(); break;
|
||||||
|
case IndexWing: m_wingOn = variant.toBool(); break;
|
||||||
default: CValueObject::setPropertyByIndex(index, variant); break;
|
default: CValueObject::setPropertyByIndex(index, variant); break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -101,6 +110,7 @@ namespace swift::misc::aviation
|
|||||||
case IndexTaxi: return Compare::compare(m_taxiOn, compareValue.isTaxiOn());
|
case IndexTaxi: return Compare::compare(m_taxiOn, compareValue.isTaxiOn());
|
||||||
case IndexCabin: return Compare::compare(m_cabinOn, compareValue.isCabinOn());
|
case IndexCabin: return Compare::compare(m_cabinOn, compareValue.isCabinOn());
|
||||||
case IndexRecognition: return Compare::compare(m_recognitionOn, compareValue.isRecognitionOn());
|
case IndexRecognition: return Compare::compare(m_recognitionOn, compareValue.isRecognitionOn());
|
||||||
|
case IndexWing: return Compare::compare(m_wingOn, compareValue.isWingOn());
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@@ -116,6 +126,7 @@ namespace swift::misc::aviation
|
|||||||
m_taxiOn = true;
|
m_taxiOn = true;
|
||||||
m_cabinOn = true;
|
m_cabinOn = true;
|
||||||
m_recognitionOn = true;
|
m_recognitionOn = true;
|
||||||
|
m_wingOn = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CAircraftLights::setAllOff()
|
void CAircraftLights::setAllOff()
|
||||||
@@ -128,5 +139,6 @@ namespace swift::misc::aviation
|
|||||||
m_taxiOn = false;
|
m_taxiOn = false;
|
||||||
m_recognitionOn = false;
|
m_recognitionOn = false;
|
||||||
m_cabinOn = false;
|
m_cabinOn = false;
|
||||||
|
m_wingOn = false;
|
||||||
}
|
}
|
||||||
} // namespace swift::misc::aviation
|
} // namespace swift::misc::aviation
|
||||||
|
|||||||
@@ -33,7 +33,8 @@ namespace swift::misc::aviation
|
|||||||
IndexNav,
|
IndexNav,
|
||||||
IndexLogo,
|
IndexLogo,
|
||||||
IndexRecognition,
|
IndexRecognition,
|
||||||
IndexCabin
|
IndexCabin,
|
||||||
|
IndexWing,
|
||||||
};
|
};
|
||||||
|
|
||||||
//! Default constructor
|
//! Default constructor
|
||||||
@@ -49,6 +50,10 @@ namespace swift::misc::aviation
|
|||||||
CAircraftLights(bool strobeOn, bool landingOn, bool taxiOn, bool beaconOn, bool navOn, bool logoOn,
|
CAircraftLights(bool strobeOn, bool landingOn, bool taxiOn, bool beaconOn, bool navOn, bool logoOn,
|
||||||
bool recognition, bool cabin);
|
bool recognition, bool cabin);
|
||||||
|
|
||||||
|
//! Constructor
|
||||||
|
CAircraftLights(bool strobeOn, bool landingOn, bool taxiOn, bool beaconOn, bool navOn, bool logoOn,
|
||||||
|
bool recognitionOn, bool cabin, bool wingOn);
|
||||||
|
|
||||||
//! Strobes lights on?
|
//! Strobes lights on?
|
||||||
bool isStrobeOn() const { return m_strobeOn; }
|
bool isStrobeOn() const { return m_strobeOn; }
|
||||||
|
|
||||||
@@ -97,6 +102,12 @@ namespace swift::misc::aviation
|
|||||||
//! Set cabin lights
|
//! Set cabin lights
|
||||||
void setCabinOn(bool on) { m_cabinOn = on; }
|
void setCabinOn(bool on) { m_cabinOn = on; }
|
||||||
|
|
||||||
|
//! Wing light on?
|
||||||
|
bool isWingOn() const { return m_wingOn; }
|
||||||
|
|
||||||
|
//! Set wing lights
|
||||||
|
void setWingOn(bool on) { m_wingOn = on; }
|
||||||
|
|
||||||
//! All on
|
//! All on
|
||||||
void setAllOn();
|
void setAllOn();
|
||||||
|
|
||||||
@@ -137,6 +148,7 @@ namespace swift::misc::aviation
|
|||||||
bool m_logoOn = false;
|
bool m_logoOn = false;
|
||||||
bool m_recognitionOn = false; //!< not supported by aircraft config (VATSIM)
|
bool m_recognitionOn = false; //!< not supported by aircraft config (VATSIM)
|
||||||
bool m_cabinOn = false; //!< not supported by aircraft config (VATSIM)
|
bool m_cabinOn = false; //!< not supported by aircraft config (VATSIM)
|
||||||
|
bool m_wingOn = false; //!< not supported by aircraft config (VATSIM)
|
||||||
|
|
||||||
SWIFT_METACLASS(
|
SWIFT_METACLASS(
|
||||||
CAircraftLights,
|
CAircraftLights,
|
||||||
@@ -149,6 +161,7 @@ namespace swift::misc::aviation
|
|||||||
SWIFT_METAMEMBER_NAMED(logoOn, "logo_on"),
|
SWIFT_METAMEMBER_NAMED(logoOn, "logo_on"),
|
||||||
SWIFT_METAMEMBER(recognitionOn, 0, DisabledForJson), // disable since JSON is used for network
|
SWIFT_METAMEMBER(recognitionOn, 0, DisabledForJson), // disable since JSON is used for network
|
||||||
SWIFT_METAMEMBER(cabinOn, 0, DisabledForJson) // disable since JSON is used for network
|
SWIFT_METAMEMBER(cabinOn, 0, DisabledForJson) // disable since JSON is used for network
|
||||||
|
SWIFT_METAMEMBER(wingOn, 0, DisabledForJson) // disable since JSON is used for network
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
} // namespace swift::misc::aviation
|
} // namespace swift::misc::aviation
|
||||||
|
|||||||
Reference in New Issue
Block a user