rename isLaunchPreCondition indicator to isPreLaunchCondition

This commit is contained in:
kifir 2024-06-11 18:39:15 +03:00 committed by rusefillc
parent 2d03accf4b
commit 8055596c43
3 changed files with 7 additions and 7 deletions

View File

@ -103,7 +103,7 @@ LaunchCondition LaunchControlBase::calculateLaunchCondition(const int rpm) {
LaunchControlBase::LaunchControlBase() {
launchActivatePinState = false;
isLaunchPreCondition = false;
isPreLaunchCondition = false;
isLaunchCondition = false;
}
@ -119,7 +119,7 @@ void LaunchControlBase::update() {
const int rpm = Sensor::getOrZero(SensorType::Rpm);
const LaunchCondition launchCondition = calculateLaunchCondition(rpm);
isLaunchCondition = combinedConditions = (launchCondition == LaunchCondition::Launch);
isLaunchPreCondition = (launchCondition == LaunchCondition::PreLaunch);
isPreLaunchCondition = (launchCondition == LaunchCondition::PreLaunch);
//and still recalculate in case user changed the values
retardThresholdRpm = engineConfiguration->launchRpm;
@ -144,7 +144,7 @@ float LaunchControlBase::calculateSparkSkipRatio(const int rpm) const {
if (engineConfiguration->launchControlEnabled && engineConfiguration->launchSparkCutEnable) {
if (isLaunchCondition) {
result = 1.0f;
} else if (isLaunchPreCondition) {
} else if (isPreLaunchCondition) {
const int launchRpm = engineConfiguration->launchRpm;
const int sparkSkipStartRpm = launchRpm - engineConfiguration->launchRpmWindow;
if (sparkSkipStartRpm <= rpm) {

View File

@ -4,7 +4,7 @@ int retardThresholdRpm
bit combinedConditions
bit launchActivatePinState
bit isLaunchPreCondition
bit isPreLaunchCondition
bit isLaunchCondition
bit isSwitchActivated
bit isClutchActivated

View File

@ -123,17 +123,17 @@ void SparkSkipRatioTest::doTest(
if (testDataItem.expectedLaunchCondition.has_value()) {
switch (testDataItem.expectedLaunchCondition.value()) {
case LaunchCondition::NotMet: {
EXPECT_FALSE(engine->launchController.isLaunchPreCondition) << testDataItem.context;
EXPECT_FALSE(engine->launchController.isPreLaunchCondition) << testDataItem.context;
EXPECT_FALSE(engine->launchController.isLaunchCondition) << testDataItem.context;
break;
}
case LaunchCondition::PreLaunch: {
EXPECT_TRUE(engine->launchController.isLaunchPreCondition) << testDataItem.context;
EXPECT_TRUE(engine->launchController.isPreLaunchCondition) << testDataItem.context;
EXPECT_FALSE(engine->launchController.isLaunchCondition) << testDataItem.context;
break;
}
case LaunchCondition::Launch: {
EXPECT_FALSE(engine->launchController.isLaunchPreCondition) << testDataItem.context;
EXPECT_FALSE(engine->launchController.isPreLaunchCondition) << testDataItem.context;
EXPECT_TRUE(engine->launchController.isLaunchCondition) << testDataItem.context;
break;
}