2015-07-10 06:01:56 -07:00
|
|
|
/**
|
|
|
|
* @file accel_enrichment.h
|
|
|
|
* @brief Acceleration enrichment calculator
|
|
|
|
*
|
|
|
|
* @date Apr 21, 2014
|
|
|
|
* @author Dmitry Sidin
|
2020-01-13 18:57:43 -08:00
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2020
|
2015-07-10 06:01:56 -07:00
|
|
|
*/
|
|
|
|
|
2019-11-14 21:00:13 -08:00
|
|
|
#pragma once
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
#include "cyclic_buffer.h"
|
2016-03-10 21:01:55 -08:00
|
|
|
#include "table_helper.h"
|
2021-10-13 21:09:31 -07:00
|
|
|
#include "wall_fuel_state_generated.h"
|
2021-10-30 19:03:19 -07:00
|
|
|
#include "tps_accel_state_generated.h"
|
2016-03-10 21:01:55 -08:00
|
|
|
|
2021-11-03 16:53:26 -07:00
|
|
|
typedef Map3D<TPS_TPS_ACCEL_TABLE, TPS_TPS_ACCEL_TABLE, float, float, float> tps_tps_Map3D_t;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2024-08-01 21:45:54 -07:00
|
|
|
class TpsAccelEnrichment : public tps_accel_state_s, public EngineModule {
|
2019-07-12 20:15:52 -07:00
|
|
|
public:
|
2021-12-07 15:49:21 -08:00
|
|
|
TpsAccelEnrichment();
|
|
|
|
|
2024-08-01 21:45:54 -07:00
|
|
|
void onConfigurationChange(engine_configuration_s const* previousConfig) override;
|
|
|
|
|
2021-11-16 01:15:29 -08:00
|
|
|
int getMaxDeltaIndex();
|
|
|
|
float getMaxDelta();
|
2019-07-12 20:15:52 -07:00
|
|
|
|
|
|
|
void setLength(int length);
|
|
|
|
cyclic_buffer<float> cb;
|
2021-11-16 01:15:29 -08:00
|
|
|
void onNewValue(float currentValue);
|
2019-10-16 19:10:38 -07:00
|
|
|
int onUpdateInvocationCounter = 0;
|
2019-07-12 20:15:52 -07:00
|
|
|
|
2015-08-23 18:03:42 -07:00
|
|
|
/**
|
|
|
|
* @return Extra fuel squirt duration for TPS acceleration
|
|
|
|
*/
|
2021-11-16 01:15:29 -08:00
|
|
|
floatms_t getTpsEnrichment();
|
|
|
|
void onEngineCycleTps();
|
2019-03-28 19:47:20 -07:00
|
|
|
void resetFractionValues();
|
2019-07-12 20:15:52 -07:00
|
|
|
void resetAE();
|
2015-07-10 06:01:56 -07:00
|
|
|
};
|
|
|
|
|
2021-11-16 01:15:29 -08:00
|
|
|
void initAccelEnrichment();
|