// // Created by kifir on 6/12/24. // #pragma once #include "util/test_base.h" class LaunchTestConfig { public: std::optional getLaunchControlEnabled() const { return m_launchControlEnabled; } std::optional getLaunchRpm() const { return m_launchRpm; } std::optional getLaunchRpmWindow() const { return m_launchRpmWindow; } std::optional getLaunchCorrectionsEndRpm() const { return m_launchCorrectionsEndRpm; } std::optional getIgnitionRetardEnable() const { return m_ignitionRetardEnable; } std::optional getIgnitionRetard() const { return m_ignitionRetard; } std::optional getSmoothRetardMode() const { return m_smoothRetardMode; } std::optional getEnableIgnitionCut() const { return m_enableIgnitionCut; } std::optional getInitialIgnitionCut() const { return m_initialIgnitionCut; } std::optional getFinalIgnitionCutBeforeLaunch() const { return m_finalIgnitionCutBeforeLaunch; } bool getSatisfyActivationSwithSpeedAndTpsConditions() const { return m_satisfyActivationSwithSpeedAndTpsConditions; } protected: void setLaunchControlEnabled(const std::optional value) { m_launchControlEnabled = value; } void setLaunchRpm(const std::optional value) { m_launchRpm = value; } void setLaunchRpmWindow(const std::optional value) { m_launchRpmWindow = value; } void setLaunchCorrectionsEndRpm(const std::optional value) { m_launchCorrectionsEndRpm = value; } void setIgnitionRetardEnable(const std::optional value) { m_ignitionRetardEnable = value; } void setIgnitionRetard(const std::optional value) { m_ignitionRetard = value; } void setSmoothRetardMode(const std::optional value) { m_smoothRetardMode = value; } void setEnableIgnitionCut(const std::optional value) { m_enableIgnitionCut = value; } void setInitialIgnitionCut(const std::optional value) { m_initialIgnitionCut = value; } void setFinalIgnitionCutBeforeLaunch(const std::optional value) { m_finalIgnitionCutBeforeLaunch = value; } void setSatisfyActivationSwithSpeedAndTpsConditions(const bool value) { m_satisfyActivationSwithSpeedAndTpsConditions = value; } private: std::optional m_launchControlEnabled; std::optional m_launchRpm; std::optional m_launchRpmWindow; std::optional m_launchCorrectionsEndRpm; std::optional m_ignitionRetardEnable; std::optional m_ignitionRetard; std::optional m_smoothRetardMode; std::optional m_enableIgnitionCut; std::optional m_initialIgnitionCut; std::optional m_finalIgnitionCutBeforeLaunch; bool m_satisfyActivationSwithSpeedAndTpsConditions { false }; }; class LaunchTestBase : public TestBase { protected: void setUpTestConfig(const LaunchTestConfig& config); void updateRpm(const int rpm); private: void configureLaunchControlEnabled(std::optional launchControlEnabled); void configureLaunchRpm(std::optional launchRpm); void configureLaunchRpmWindow(std::optional launchRpmWindow); void configureLaunchCorrectionsEndRpm(std::optional launchCorrectionsEndRpm); void configureIgnitionRetardEnable(std::optional ignitionRetardEnable); void configureIgnitionRetard(std::optional ignitionRetard); void configureSmoothRetardMode(std::optional smoothRetardMode); void configureEnableIgnitionCut(std::optional enableIgnitionCut); void configureInitialIgnitionCutPercent(std::optional initialIgnitionCut); void configureFinalIgnitionCutPercentBeforeLaunch(std::optional finalIgnitionCutBeforeLaunch); void configureSatisfiedActivationSwithSpeedAndTpsConditions(); };