2020-03-23 17:44:34 -07:00
|
|
|
/*
|
|
|
|
* @file launch_control.h
|
|
|
|
*
|
|
|
|
* @date Mar 23, 2020
|
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2020
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2020-11-19 05:15:56 -08:00
|
|
|
#include "engine_ptr.h"
|
2020-11-30 16:35:06 -08:00
|
|
|
#include "timer.h"
|
2020-03-23 17:44:34 -07:00
|
|
|
|
2020-11-19 05:15:56 -08:00
|
|
|
class Logging;
|
2020-03-23 17:44:34 -07:00
|
|
|
void initLaunchControl(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX);
|
2020-03-23 20:20:54 -07:00
|
|
|
void setDefaultLaunchParameters(DECLARE_CONFIG_PARAMETER_SIGNATURE);
|
2020-09-22 13:25:27 -07:00
|
|
|
void applyLaunchControlLimiting(bool *limitedSpark, bool *limitedFuel DECLARE_ENGINE_PARAMETER_SUFFIX);
|
2020-12-01 10:03:42 -08:00
|
|
|
void updateLaunchConditions(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
2020-11-19 05:15:56 -08:00
|
|
|
|
|
|
|
class LaunchControlBase {
|
|
|
|
public:
|
|
|
|
DECLARE_ENGINE_PTR;
|
|
|
|
|
|
|
|
// Update the state of the launch control system
|
|
|
|
void update();
|
|
|
|
|
|
|
|
bool isInsideSpeedCondition() const;
|
|
|
|
bool isInsideTpsCondition() const;
|
2020-11-19 18:14:38 -08:00
|
|
|
bool isInsideSwitchCondition() const;
|
|
|
|
bool isInsideRPMCondition(int rpm) const;
|
2020-11-19 05:15:56 -08:00
|
|
|
bool isLaunchConditionMet(int rpm) const;
|
|
|
|
|
|
|
|
private:
|
2020-11-30 16:35:06 -08:00
|
|
|
Timer m_launchTimer;
|
2020-11-19 05:15:56 -08:00
|
|
|
};
|