only:reordering: separate `Launch Control` configuration settings from `Shift Torque Reduction (Flat Shift)` settings

This commit is contained in:
kifir 2024-11-21 13:41:46 +02:00 committed by kifir23917
parent 4ca3f7a933
commit 5a7f41bcd6
2 changed files with 35 additions and 22 deletions

View File

@ -6,6 +6,20 @@
#include "shift_torque_reduction_test_base.h"
ShiftTorqueReductionTestConfig ShiftTorqueReductionTestConfig::setLaunchActivatePin(
const std::optional<switch_input_pin_e> value
) {
m_launchActivatePin = value;
return *this;
}
ShiftTorqueReductionTestConfig ShiftTorqueReductionTestConfig::setLaunchActivateInverted(
const std::optional<bool> value
) {
m_launchActivateInverted = value;
return *this;
}
ShiftTorqueReductionTestConfig ShiftTorqueReductionTestConfig::setTorqueReductionEnabled(
const std::optional<bool> value
) {
@ -34,20 +48,6 @@ ShiftTorqueReductionTestConfig ShiftTorqueReductionTestConfig::setTorqueReductio
return *this;
}
ShiftTorqueReductionTestConfig ShiftTorqueReductionTestConfig::setLaunchActivatePin(
const std::optional<switch_input_pin_e> value
) {
m_launchActivatePin = value;
return *this;
}
ShiftTorqueReductionTestConfig ShiftTorqueReductionTestConfig::setLaunchActivateInverted(
const std::optional<bool> value
) {
m_launchActivateInverted = value;
return *this;
}
ShiftTorqueReductionTestConfig ShiftTorqueReductionTestConfig::setLimitTorqueReductionTime(std::optional<bool> value) {
m_limitTorqueReductionTime = value;
return *this;
@ -85,12 +85,15 @@ ShiftTorqueReductionTestConfig ShiftTorqueReductionTestConfig::setTorqueReductio
}
void ShiftTorqueReductionTestBase::setUpTestConfig(const ShiftTorqueReductionTestConfig& config) {
// Launch Control
getTestEngineConfiguration().configureLaunchActivatePin(config.getLaunchActivatePin());
getTestEngineConfiguration().configureLaunchActivateInverted(config.getLaunchActivateInverted());
// Shift Torque Reduction (Flat Shift)
getTestEngineConfiguration().configureTorqueReductionEnabled(config.getTorqueReductionEnabled());
getTestEngineConfiguration().configureTorqueReductionActivationMode(config.getTorqueReductionActivationMode());
getTestEngineConfiguration().configureTorqueReductionTriggerPin(config.getTorqueReductionTriggerPin());
getTestEngineConfiguration().configureTorqueReductionButtonInverted(config.getTorqueReductionTriggerPinInverted());
getTestEngineConfiguration().configureLaunchActivatePin(config.getLaunchActivatePin());
getTestEngineConfiguration().configureLaunchActivateInverted(config.getLaunchActivateInverted());
getTestEngineConfiguration().configureLimitTorqueReductionTime(config.getLimitTorqueReductionTime());
getTestEngineConfiguration().configureTorqueReductionTime(config.getTorqueReductionTime());
getTestEngineConfiguration().configureTorqueReductionArmingRpm(config.getTorqueReductionArmingRpm());

View File

@ -8,14 +8,17 @@
class ShiftTorqueReductionTestConfig {
public:
// Launch Control
std::optional<switch_input_pin_e> getLaunchActivatePin() const { return m_launchActivatePin; }
std::optional<bool> getLaunchActivateInverted() const { return m_launchActivateInverted; }
// Shift Torque Reduction (Flat Shift)
std::optional<bool> getTorqueReductionEnabled() const { return m_isTorqueReductionEnabled; }
std::optional<torqueReductionActivationMode_e> getTorqueReductionActivationMode() const {
return m_torqueReductionActivationMode;
}
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; }
std::optional<float> getTorqueReductionTime() const { return m_torqueReductionTime; }
std::optional<float> getTorqueReductionArmingRpm() const { return m_torqueReductionArmingRpm; }
@ -25,14 +28,18 @@ public:
// We do not core about performance in tests, but we want to use builder-like style, so setters return new instance
// of configuration:
// Launch Control
ShiftTorqueReductionTestConfig setLaunchActivatePin(std::optional<switch_input_pin_e> value);
ShiftTorqueReductionTestConfig setLaunchActivateInverted(std::optional<bool> value);
// Shift Torque Reduction (Flat Shift)
ShiftTorqueReductionTestConfig setTorqueReductionEnabled(std::optional<bool> value);
ShiftTorqueReductionTestConfig setTorqueReductionActivationMode(
std::optional<torqueReductionActivationMode_e> 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);
ShiftTorqueReductionTestConfig setTorqueReductionTime(std::optional<float> value);
ShiftTorqueReductionTestConfig setTorqueReductionArmingRpm(std::optional<float> value);
@ -40,12 +47,15 @@ public:
ShiftTorqueReductionTestConfig setTorqueReductionIgnitionCut(std::optional<int8_t> value);
ShiftTorqueReductionTestConfig setTorqueReductionIgnitionRetard(std::optional<float> value);
private:
// Launch Control
std::optional<switch_input_pin_e> m_launchActivatePin;
std::optional<bool> m_launchActivateInverted;
// Shift Torque Reduction (Flat Shift)
std::optional<bool> m_isTorqueReductionEnabled;
std::optional<torqueReductionActivationMode_e> m_torqueReductionActivationMode;
std::optional<switch_input_pin_e> m_torqueReductionTriggerPin;
std::optional<bool> m_torqueReductionTriggerPinInverted;
std::optional<switch_input_pin_e> m_launchActivatePin;
std::optional<bool> m_launchActivateInverted;
std::optional<bool> m_limitTorqueReductionTime;
std::optional<float> m_torqueReductionTime;
std::optional<float> m_torqueReductionArmingRpm;