only:refactoring: renaming

This commit is contained in:
kifir 2024-11-20 22:29:33 +02:00 committed by kifir23917
parent 34787eedf8
commit 4ca3f7a933
8 changed files with 26 additions and 24 deletions

View File

@ -19,7 +19,7 @@ void FlatShiftConditionTestBase::SetUp() {
setUpTestConfig(ShiftTorqueReductionTestConfig()
.setTorqueReductionEnabled(true)
.setTorqueReductionActivationMode(torqueReductionActivationMode_e::TORQUE_REDUCTION_BUTTON)
.setTriggerPin(TEST_TORQUE_REDUCTION_BUTTON_PIN)
.setTorqueReductionTriggerPin(TEST_TORQUE_REDUCTION_BUTTON_PIN)
.setLimitTorqueReductionTime(false)
.setTorqueReductionIgnitionCut(m_torqueReductionIgnitionCut)
.setTorqueReductionIgnitionRetard(m_torqueReductionIgnitionRetard)

View File

@ -20,15 +20,17 @@ ShiftTorqueReductionTestConfig ShiftTorqueReductionTestConfig::setTorqueReductio
return *this;
}
ShiftTorqueReductionTestConfig ShiftTorqueReductionTestConfig::setTriggerPin(
ShiftTorqueReductionTestConfig ShiftTorqueReductionTestConfig::setTorqueReductionTriggerPin(
const std::optional<switch_input_pin_e> value
) {
m_torqueReductionTriggerPin = value;
return *this;
}
ShiftTorqueReductionTestConfig ShiftTorqueReductionTestConfig::setPinInverted(const std::optional<bool> value) {
m_pinInverted = value;
ShiftTorqueReductionTestConfig ShiftTorqueReductionTestConfig::setTorqueReductionTriggerPinInverted(
const std::optional<bool> value
) {
m_torqueReductionTriggerPinInverted = value;
return *this;
}
@ -85,8 +87,8 @@ ShiftTorqueReductionTestConfig ShiftTorqueReductionTestConfig::setTorqueReductio
void ShiftTorqueReductionTestBase::setUpTestConfig(const ShiftTorqueReductionTestConfig& config) {
getTestEngineConfiguration().configureTorqueReductionEnabled(config.getTorqueReductionEnabled());
getTestEngineConfiguration().configureTorqueReductionActivationMode(config.getTorqueReductionActivationMode());
getTestEngineConfiguration().configureTorqueReductionButton(config.getTriggerPin());
getTestEngineConfiguration().configureTorqueReductionButtonInverted(config.getPinInverted());
getTestEngineConfiguration().configureTorqueReductionTriggerPin(config.getTorqueReductionTriggerPin());
getTestEngineConfiguration().configureTorqueReductionButtonInverted(config.getTorqueReductionTriggerPinInverted());
getTestEngineConfiguration().configureLaunchActivatePin(config.getLaunchActivatePin());
getTestEngineConfiguration().configureLaunchActivateInverted(config.getLaunchActivateInverted());
getTestEngineConfiguration().configureLimitTorqueReductionTime(config.getLimitTorqueReductionTime());

View File

@ -12,8 +12,8 @@ public:
std::optional<torqueReductionActivationMode_e> getTorqueReductionActivationMode() const {
return m_torqueReductionActivationMode;
}
std::optional<switch_input_pin_e> getTriggerPin() const { return m_torqueReductionTriggerPin; }
std::optional<bool> getPinInverted() const { return m_pinInverted; }
std::optional<switch_input_pin_e> getTorqueReductionTriggerPin() const { return m_torqueReductionTriggerPin; }
std::optional<bool> getTorqueReductionTriggerPinInverted() const { return m_torqueReductionTriggerPinInverted; }
std::optional<switch_input_pin_e> getLaunchActivatePin() const { return m_launchActivatePin; }
std::optional<bool> getLaunchActivateInverted() const { return m_launchActivateInverted; }
std::optional<bool> getLimitTorqueReductionTime() const { return m_limitTorqueReductionTime; }
@ -29,8 +29,8 @@ public:
ShiftTorqueReductionTestConfig setTorqueReductionActivationMode(
std::optional<torqueReductionActivationMode_e> value
);
ShiftTorqueReductionTestConfig setTriggerPin(std::optional<switch_input_pin_e> value);
ShiftTorqueReductionTestConfig setPinInverted(std::optional<bool> value);
ShiftTorqueReductionTestConfig setTorqueReductionTriggerPin(std::optional<switch_input_pin_e> value);
ShiftTorqueReductionTestConfig setTorqueReductionTriggerPinInverted(std::optional<bool> value);
ShiftTorqueReductionTestConfig setLaunchActivatePin(std::optional<switch_input_pin_e> value);
ShiftTorqueReductionTestConfig setLaunchActivateInverted(std::optional<bool> value);
ShiftTorqueReductionTestConfig setLimitTorqueReductionTime(std::optional<bool> value);
@ -43,7 +43,7 @@ private:
std::optional<bool> m_isTorqueReductionEnabled;
std::optional<torqueReductionActivationMode_e> m_torqueReductionActivationMode;
std::optional<switch_input_pin_e> m_torqueReductionTriggerPin;
std::optional<bool> m_pinInverted;
std::optional<bool> m_torqueReductionTriggerPinInverted;
std::optional<switch_input_pin_e> m_launchActivatePin;
std::optional<bool> m_launchActivateInverted;
std::optional<bool> m_limitTorqueReductionTime;

View File

@ -29,7 +29,7 @@ namespace {
setUpTestConfig(ShiftTorqueReductionTestConfig()
.setTorqueReductionEnabled(true)
.setTorqueReductionActivationMode(torqueReductionActivationMode_e::TORQUE_REDUCTION_BUTTON)
.setTriggerPin(TEST_TORQUE_REDUCTION_BUTTON_PIN)
.setTorqueReductionTriggerPin(TEST_TORQUE_REDUCTION_BUTTON_PIN)
.setLimitTorqueReductionTime(true)
.setTorqueReductionTime(TEST_TORQUE_REDUCTION_TIME)
.setTorqueReductionArmingRpm(TEST_TORQUE_REDUCTION_ARMING_RPM)

View File

@ -45,7 +45,7 @@ namespace {
setUpTestConfig(ShiftTorqueReductionTestConfig()
.setTorqueReductionEnabled(true)
.setTorqueReductionActivationMode(torqueReductionActivationMode_e::TORQUE_REDUCTION_BUTTON)
.setTriggerPin(TEST_TORQUE_REDUCTION_BUTTON_PIN)
.setTorqueReductionTriggerPin(TEST_TORQUE_REDUCTION_BUTTON_PIN)
.setLimitTorqueReductionTime(true)
.setTorqueReductionTime(TEST_TORQUE_REDUCTION_TIME)
);
@ -64,7 +64,7 @@ namespace {
setUpTestConfig(ShiftTorqueReductionTestConfig()
.setTorqueReductionEnabled(true)
.setTorqueReductionActivationMode(torqueReductionActivationMode_e::TORQUE_REDUCTION_BUTTON)
.setTriggerPin(TEST_TORQUE_REDUCTION_BUTTON_PIN)
.setTorqueReductionTriggerPin(TEST_TORQUE_REDUCTION_BUTTON_PIN)
.setLimitTorqueReductionTime(true)
.setTorqueReductionTime(TEST_TORQUE_REDUCTION_TIME)
);
@ -82,7 +82,7 @@ namespace {
setUpTestConfig(ShiftTorqueReductionTestConfig()
.setTorqueReductionEnabled(true)
.setTorqueReductionActivationMode(torqueReductionActivationMode_e::TORQUE_REDUCTION_BUTTON)
.setTriggerPin(TEST_TORQUE_REDUCTION_BUTTON_PIN)
.setTorqueReductionTriggerPin(TEST_TORQUE_REDUCTION_BUTTON_PIN)
.setLimitTorqueReductionTime(true)
.setTorqueReductionTime(TEST_TORQUE_REDUCTION_TIME)
);
@ -107,7 +107,7 @@ namespace {
setUpTestConfig(ShiftTorqueReductionTestConfig()
.setTorqueReductionEnabled(true)
.setTorqueReductionActivationMode(torqueReductionActivationMode_e::TORQUE_REDUCTION_BUTTON)
.setTriggerPin(TEST_TORQUE_REDUCTION_BUTTON_PIN)
.setTorqueReductionTriggerPin(TEST_TORQUE_REDUCTION_BUTTON_PIN)
.setLimitTorqueReductionTime(true)
.setTorqueReductionTime(IMMEDIATELY)
);
@ -132,7 +132,7 @@ namespace {
setUpTestConfig(ShiftTorqueReductionTestConfig()
.setTorqueReductionEnabled(true)
.setTorqueReductionActivationMode(torqueReductionActivationMode_e::TORQUE_REDUCTION_BUTTON)
.setTriggerPin(TEST_TORQUE_REDUCTION_BUTTON_PIN)
.setTorqueReductionTriggerPin(TEST_TORQUE_REDUCTION_BUTTON_PIN)
.setLimitTorqueReductionTime(false)
.setTorqueReductionTime(TEST_TORQUE_REDUCTION_TIME)
);

View File

@ -69,7 +69,7 @@ namespace {
setUpTestConfig(ShiftTorqueReductionTestConfig()
.setTorqueReductionEnabled(true)
.setTorqueReductionActivationMode(torqueReductionActivationMode_e::TORQUE_REDUCTION_BUTTON)
.setTriggerPin(TEST_TORQUE_REDUCTION_BUTTON_PIN)
.setTorqueReductionTriggerPin(TEST_TORQUE_REDUCTION_BUTTON_PIN)
.setLaunchActivatePin(TEST_LAUNCH_BUTTON_PIN)
);
@ -102,8 +102,8 @@ namespace {
setUpTestConfig(ShiftTorqueReductionTestConfig()
.setTorqueReductionEnabled(true)
.setTorqueReductionActivationMode(torqueReductionActivationMode_e::TORQUE_REDUCTION_BUTTON)
.setTriggerPin(TEST_TORQUE_REDUCTION_BUTTON_PIN)
.setPinInverted(true)
.setTorqueReductionTriggerPin(TEST_TORQUE_REDUCTION_BUTTON_PIN)
.setTorqueReductionTriggerPinInverted(true)
);
checkShiftTorqueReductionStateAfterPeriodicFastCallback({ "Default trigger pin state", true, true });
@ -123,7 +123,7 @@ namespace {
setUpTestConfig(ShiftTorqueReductionTestConfig()
.setTorqueReductionEnabled(true)
.setTorqueReductionActivationMode(torqueReductionActivationMode_e::LAUNCH_BUTTON)
.setTriggerPin(TEST_TORQUE_REDUCTION_BUTTON_PIN)
.setTorqueReductionTriggerPin(TEST_TORQUE_REDUCTION_BUTTON_PIN)
.setLaunchActivatePin(TEST_LAUNCH_BUTTON_PIN)
);
@ -156,7 +156,7 @@ namespace {
setUpTestConfig(ShiftTorqueReductionTestConfig()
.setTorqueReductionEnabled(false)
.setTorqueReductionActivationMode(torqueReductionActivationMode_e::TORQUE_REDUCTION_BUTTON)
.setTriggerPin(TEST_TORQUE_REDUCTION_BUTTON_PIN)
.setTorqueReductionTriggerPin(TEST_TORQUE_REDUCTION_BUTTON_PIN)
.setLaunchActivatePin(TEST_LAUNCH_BUTTON_PIN)
);

View File

@ -142,7 +142,7 @@ void TestEngineConfiguration::configureTorqueReductionActivationMode(
}
}
void TestEngineConfiguration::configureTorqueReductionButton(const std::optional<switch_input_pin_e> pin) {
void TestEngineConfiguration::configureTorqueReductionTriggerPin(const std::optional<switch_input_pin_e> pin) {
if (pin.has_value()) {
engineConfiguration->torqueReductionTriggerPin = pin.value();
} else {

View File

@ -31,7 +31,7 @@ public:
// Shift Torque Reduction (Flat Shift)
void configureTorqueReductionEnabled(std::optional<bool> isTorqueReductionEnabled);
void configureTorqueReductionActivationMode(std::optional<torqueReductionActivationMode_e> activationMode);
void configureTorqueReductionButton(std::optional<switch_input_pin_e> pin);
void configureTorqueReductionTriggerPin(std::optional<switch_input_pin_e> pin);
void configureTorqueReductionButtonInverted(std::optional<bool> pinInverted);
void configureLaunchActivatePin(std::optional<switch_input_pin_e> pin);
void configureLaunchActivateInverted(std::optional<bool> pinInverted);