auto-sync

This commit is contained in:
rusEfi 2016-03-11 11:03:18 -05:00
parent 1afb0a1a57
commit a9b6961265
5 changed files with 39 additions and 7 deletions

View File

@ -608,7 +608,7 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_
tsOutputChannels->injectorLagMs = ENGINE(engineState.injectorLag);
tsOutputChannels->timeSeconds = getTimeNowSeconds();
if (engineConfiguration->debugMode == TPS_ACCEL) {
if (engineConfiguration->debugMode == DBG_TPS_ACCEL) {
tsOutputChannels->debugIntField1 = engine->tpsAccelEnrichment.cb.getSize();
}

View File

@ -26,10 +26,17 @@
#include "engine_state.h"
#include "engine_math.h"
#include "signal_executor.h"
#if !EFI_UNIT_TEST
#include "tunerstudio_configuration.h"
extern TunerStudioOutputChannels tsOutputChannels;
#endif
EXTERN_ENGINE
;
tps_tps_Map3D_t tpsTpsMap("tpsTps");
static Logging *logger = NULL;
WallFuel::WallFuel() {
@ -95,9 +102,25 @@ float AccelEnrichmemnt::getMaxDelta(DECLARE_ENGINE_PARAMETER_F) {
// todo: eliminate code duplication between these two methods! Some pointer magic would help.
floatms_t AccelEnrichmemnt::getTpsEnrichment(DECLARE_ENGINE_PARAMETER_F) {
float d = getMaxDelta(PASS_ENGINE_PARAMETER_F);
int index = getMaxDeltaIndex(PASS_ENGINE_PARAMETER_F);
// FuelSchedule *fs = engine->engineConfiguration2->injectionEvents;
float tpsTo = cb.get(index);
float tpsFrom = cb.get(index - 1);
float d = tpsTo - tpsFrom;
float deltaMult = tpsTpsMap.getValue(tpsFrom, tpsTo);
#if !EFI_UNIT_TEST
if (engineConfiguration->debugMode == DBG_TPS_ACCEL) {
tsOutputChannels.debugFloatField1 = tpsFrom;
tsOutputChannels.debugFloatField2 = tpsTo;
}
#endif
if (d > engineConfiguration->tpsAccelEnrichmentThreshold) {
return d * engineConfiguration->tpsAccelEnrichmentMultiplier;
return deltaMult;
}
if (d < -engineConfiguration->tpsDecelEnleanmentThreshold) {
return d * engineConfiguration->tpsDecelEnleanmentMultiplier;
@ -220,8 +243,14 @@ void updateAccelParameters() {
setTpsAccelLen(engineConfiguration->tpsAccelLength);
}
void initAccelEnrichment(Logging *sharedLogger) {
#endif /* ! EFI_UNIT_TEST */
void initAccelEnrichment(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_S) {
logger = sharedLogger;
tpsTpsMap.init(config->tpsTpsAccelTable, config->tpsTpsAccelFromRpmBins, config->tpsTpsAccelToRpmBins);
#if ! EFI_UNIT_TEST || defined(__DOXYGEN__)
addConsoleActionI("set_tps_accel_len", setTpsAccelLen);
addConsoleActionF("set_tps_accel_threshold", setTpsAccelThr);
addConsoleActionF("set_tps_accel_multiplier", setTpsAccelMult);
@ -236,5 +265,6 @@ void initAccelEnrichment(Logging *sharedLogger) {
addConsoleAction("accelinfo", accelInfo);
updateAccelParameters();
}
#endif /* ! EFI_UNIT_TEST */
}

View File

@ -61,7 +61,7 @@ private:
floatms_t wallFuel[INJECTION_PIN_COUNT];
};
void initAccelEnrichment(Logging *sharedLogger);
void initAccelEnrichment(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_S);
void setEngineLoadAccelLen(int len);
void setEngineLoadAccelThr(float value);

View File

@ -576,7 +576,7 @@ typedef enum {
typedef enum {
ALTERNATOR = 0,
TPS_ACCEL = 1,
DBG_TPS_ACCEL = 1,
WARMUP_ENRICH = 2,
IDLE = 3,

View File

@ -10,6 +10,7 @@
#include "trigger_decoder.h"
#include "speed_density.h"
#include "fuel_math.h"
#include "accel_enrichment.h"
extern int timeNow;
@ -39,6 +40,7 @@ EngineTestHelper::EngineTestHelper(engine_type_e engineType) : engine (&persiste
Engine *engine = &this->engine;
prepareFuelMap(PASS_ENGINE_PARAMETER_F);
initAccelEnrichment(NULL PASS_ENGINE_PARAMETER);
initSpeedDensity(PASS_ENGINE_PARAMETER_F);