/** * @file accel_enrichment.h * @brief Acceleration enrichment calculator * * @date Apr 21, 2014 * @author Dmitry Sidin * @author Andrey Belomutskiy, (c) 2012-2020 */ #pragma once #include "cyclic_buffer.h" #include "table_helper.h" #include "wall_fuel_state_generated.h" #include "tps_accel_state_generated.h" typedef Map3D tps_tps_Map3D_t; /** * this object is used for MAP rate-of-change and TPS rate-of-change corrections */ class AccelEnrichment : public tps_accel_state_s { public: AccelEnrichment(); int getMaxDeltaIndex(DECLARE_ENGINE_PARAMETER_SIGNATURE); float getMaxDelta(DECLARE_ENGINE_PARAMETER_SIGNATURE); void resetAE(); void setLength(int length); cyclic_buffer cb; void onNewValue(float currentValue DECLARE_ENGINE_PARAMETER_SUFFIX); int onUpdateInvocationCounter = 0; }; class TpsAccelEnrichment : public AccelEnrichment { public: /** * @return Extra fuel squirt duration for TPS acceleration */ floatms_t getTpsEnrichment(DECLARE_ENGINE_PARAMETER_SIGNATURE); void onEngineCycleTps(DECLARE_ENGINE_PARAMETER_SIGNATURE); void resetFractionValues(); void resetAE(); }; void initAccelEnrichment(DECLARE_ENGINE_PARAMETER_SIGNATURE); void setTpsAccelThr(float value); void setTpsDecelThr(float value); void setTpsDecelMult(float value); void setTpsAccelLen(int length); void updateAccelParameters();