[skip ci] change to read "GENERAL ENG PCT MAX RPM"

This commit is contained in:
Thomas Zobler
2026-02-06 09:15:26 +01:00
parent 6e2397d3cb
commit 5202807ab6
4 changed files with 18 additions and 18 deletions

View File

@@ -12,7 +12,7 @@ SWIFT_DEFINE_VALUEOBJECT_MIXINS(swift::misc::aviation, CAircraftEngine)
namespace swift::misc::aviation
{
CAircraftEngine::CAircraftEngine(int number, bool on, int enginePercentage)
: m_number(number), m_on(on), m_power(enginePercentage)
: m_number(number), m_on(on), m_rpm_pct(enginePercentage)
{
Q_ASSERT_X(number > 0, "CAircraftEngine", "Engine numbers have to be > 1");
}
@@ -25,10 +25,10 @@ namespace swift::misc::aviation
void CAircraftEngine::setEnginePower(double power)
{
m_power = power;
if (!m_on) m_power = 0;
if (m_power > 100) m_power = 100;
if (m_power < 0) m_power = 0;
m_rpm_pct = power;
if (!m_on) m_rpm_pct = 0;
if (m_rpm_pct > 100) m_rpm_pct = 100;
if (m_rpm_pct < 0) m_rpm_pct = 0;
}
QString CAircraftEngine::convertToQString(bool i18n) const

View File

@@ -46,7 +46,7 @@ namespace swift::misc::aviation
//! Set engine percentage (0..100)
void setEnginePower(double percentage);
double getEnginePower() const { return m_power; }
double getEnginePower() const { return m_rpm_pct; }
//! \copydoc swift::misc::mixin::String::toQString
QString convertToQString(bool i18n = false) const;
@@ -54,13 +54,13 @@ namespace swift::misc::aviation
private:
int m_number = 1;
bool m_on = false;
double m_power = 0.0;
double m_rpm_pct = 0.0;
SWIFT_METACLASS(
CAircraftEngine,
SWIFT_METAMEMBER(number, 0, DisabledForJson),
SWIFT_METAMEMBER(on),
SWIFT_METAMEMBER(power));
SWIFT_METAMEMBER(rpm_pct));
};
} // namespace swift::misc::aviation