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() setUpTestConfig(ShiftTorqueReductionTestConfig()
.setTorqueReductionEnabled(true) .setTorqueReductionEnabled(true)
.setTorqueReductionActivationMode(torqueReductionActivationMode_e::TORQUE_REDUCTION_BUTTON) .setTorqueReductionActivationMode(torqueReductionActivationMode_e::TORQUE_REDUCTION_BUTTON)
.setTriggerPin(TEST_TORQUE_REDUCTION_BUTTON_PIN) .setTorqueReductionTriggerPin(TEST_TORQUE_REDUCTION_BUTTON_PIN)
.setLimitTorqueReductionTime(false) .setLimitTorqueReductionTime(false)
.setTorqueReductionIgnitionCut(m_torqueReductionIgnitionCut) .setTorqueReductionIgnitionCut(m_torqueReductionIgnitionCut)
.setTorqueReductionIgnitionRetard(m_torqueReductionIgnitionRetard) .setTorqueReductionIgnitionRetard(m_torqueReductionIgnitionRetard)

View File

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

View File

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

View File

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

View File

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

View File

@ -69,7 +69,7 @@ namespace {
setUpTestConfig(ShiftTorqueReductionTestConfig() setUpTestConfig(ShiftTorqueReductionTestConfig()
.setTorqueReductionEnabled(true) .setTorqueReductionEnabled(true)
.setTorqueReductionActivationMode(torqueReductionActivationMode_e::TORQUE_REDUCTION_BUTTON) .setTorqueReductionActivationMode(torqueReductionActivationMode_e::TORQUE_REDUCTION_BUTTON)
.setTriggerPin(TEST_TORQUE_REDUCTION_BUTTON_PIN) .setTorqueReductionTriggerPin(TEST_TORQUE_REDUCTION_BUTTON_PIN)
.setLaunchActivatePin(TEST_LAUNCH_BUTTON_PIN) .setLaunchActivatePin(TEST_LAUNCH_BUTTON_PIN)
); );
@ -102,8 +102,8 @@ namespace {
setUpTestConfig(ShiftTorqueReductionTestConfig() setUpTestConfig(ShiftTorqueReductionTestConfig()
.setTorqueReductionEnabled(true) .setTorqueReductionEnabled(true)
.setTorqueReductionActivationMode(torqueReductionActivationMode_e::TORQUE_REDUCTION_BUTTON) .setTorqueReductionActivationMode(torqueReductionActivationMode_e::TORQUE_REDUCTION_BUTTON)
.setTriggerPin(TEST_TORQUE_REDUCTION_BUTTON_PIN) .setTorqueReductionTriggerPin(TEST_TORQUE_REDUCTION_BUTTON_PIN)
.setPinInverted(true) .setTorqueReductionTriggerPinInverted(true)
); );
checkShiftTorqueReductionStateAfterPeriodicFastCallback({ "Default trigger pin state", true, true }); checkShiftTorqueReductionStateAfterPeriodicFastCallback({ "Default trigger pin state", true, true });
@ -123,7 +123,7 @@ namespace {
setUpTestConfig(ShiftTorqueReductionTestConfig() setUpTestConfig(ShiftTorqueReductionTestConfig()
.setTorqueReductionEnabled(true) .setTorqueReductionEnabled(true)
.setTorqueReductionActivationMode(torqueReductionActivationMode_e::LAUNCH_BUTTON) .setTorqueReductionActivationMode(torqueReductionActivationMode_e::LAUNCH_BUTTON)
.setTriggerPin(TEST_TORQUE_REDUCTION_BUTTON_PIN) .setTorqueReductionTriggerPin(TEST_TORQUE_REDUCTION_BUTTON_PIN)
.setLaunchActivatePin(TEST_LAUNCH_BUTTON_PIN) .setLaunchActivatePin(TEST_LAUNCH_BUTTON_PIN)
); );
@ -156,7 +156,7 @@ namespace {
setUpTestConfig(ShiftTorqueReductionTestConfig() setUpTestConfig(ShiftTorqueReductionTestConfig()
.setTorqueReductionEnabled(false) .setTorqueReductionEnabled(false)
.setTorqueReductionActivationMode(torqueReductionActivationMode_e::TORQUE_REDUCTION_BUTTON) .setTorqueReductionActivationMode(torqueReductionActivationMode_e::TORQUE_REDUCTION_BUTTON)
.setTriggerPin(TEST_TORQUE_REDUCTION_BUTTON_PIN) .setTorqueReductionTriggerPin(TEST_TORQUE_REDUCTION_BUTTON_PIN)
.setLaunchActivatePin(TEST_LAUNCH_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()) { if (pin.has_value()) {
engineConfiguration->torqueReductionTriggerPin = pin.value(); engineConfiguration->torqueReductionTriggerPin = pin.value();
} else { } else {

View File

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