refactoring: better variable names

This commit is contained in:
rusefi 2019-05-27 11:17:28 -04:00
parent 413d318da6
commit c52e5aa465
5 changed files with 13 additions and 7 deletions

View File

@ -273,7 +273,7 @@ static void printSensors(Logging *log, bool fileFormat) {
reportSensorF(log, fileFormat, GAUGE_NAME_TCHARGE, "K", engine->engineState.tChargeK, 2); // log column #8
if (hasMapSensor(PASS_ENGINE_PARAMETER_SIGNATURE)) {
reportSensorF(log, fileFormat, GAUGE_NAME_FUEL_VE, "%", engine->engineState.currentVE * PERCENT_MULT, 2);
reportSensorF(log, fileFormat, GAUGE_NAME_FUEL_VE, "%", engine->engineState.currentBaroCorrectedVE * PERCENT_MULT, 2);
}
reportSensorF(log, fileFormat, GAUGE_NAME_VVT, "deg", engine->triggerCentral.vvtPosition, 1);
@ -705,7 +705,7 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_
if (hasMapSensor(PASS_ENGINE_PARAMETER_SIGNATURE)) {
float mapValue = getMap();
tsOutputChannels->veValue = engine->engineState.currentVE * PERCENT_MULT;
tsOutputChannels->veValue = engine->engineState.currentBaroCorrectedVE * PERCENT_MULT;
// todo: bug here? target afr could work based on real MAF?
tsOutputChannels->currentTargetAfr = afrMap.getValue(rpm, mapValue);
tsOutputChannels->manifoldAirPressure = mapValue;

View File

@ -233,7 +233,8 @@ public:
float tChargeK = 0;
efitick_t timeSinceLastTChargeK;
float currentVE = 0;
float currentRawVE = 0;
float currentBaroCorrectedVE = 0;
float targetAFR = 0;
int vssEventCounter = 0;

View File

@ -215,14 +215,14 @@ void EngineState::periodicFastCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
/**
* *0.01 because of https://sourceforge.net/p/rusefi/tickets/153/
*/
float rawVe = veMap.getValue(rpm, CONFIGB(useTPSBasedVeTable) ? tps : map);
currentRawVE = veMap.getValue(rpm, CONFIGB(useTPSBasedVeTable) ? tps : map);
// get VE from the separate table for Idle
if (CONFIG(useSeparateVeForIdle)) {
float idleVe = interpolate2d("idleVe", rpm, config->idleVeBins, config->idleVe, IDLE_VE_CURVE_SIZE);
// interpolate between idle table and normal (running) table using TPS threshold
rawVe = interpolateClamped(0.0f, idleVe, CONFIGB(idlePidDeactivationTpsThreshold), rawVe, tps);
currentRawVE = interpolateClamped(0.0f, idleVe, CONFIGB(idlePidDeactivationTpsThreshold), currentRawVE, tps);
}
currentVE = baroCorrection * rawVe * 0.01;
currentBaroCorrectedVE = baroCorrection * currentRawVE * PERCENT_DIV;
targetAFR = afrMap.getValue(rpm, map);
} else {
baseTableFuel = getBaseTableFuel(rpm, engineLoad);

View File

@ -28,7 +28,12 @@
// I believe that TunerStudio curve editor has a bug with F32 support
// because of that bug we cannot have '1.05' for 5% extra multiplier
/**
* *0.01 because of https://sourceforge.net/p/rusefi/tickets/153/
*/
#define PERCENT_MULT 100.0f
#define PERCENT_DIV 0.01f
/**
* http://rusefi.com/wiki/index.php?title=Manual:Engine_Type

View File

@ -130,7 +130,7 @@ floatms_t getSpeedDensityFuel(float map DECLARE_GLOBAL_SUFFIX) {
float adjustedMap = map + engine->engineLoadAccelEnrichment.getEngineLoadEnrichment(PASS_GLOBAL_SIGNATURE);
efiAssert(CUSTOM_ERR_ASSERT, !cisnan(adjustedMap), "NaN adjustedMap", 0);
float airMass = getCylinderAirMass(ENGINE(engineState.currentVE), adjustedMap, tChargeK PASS_GLOBAL_SUFFIX);
float airMass = getCylinderAirMass(ENGINE(engineState.currentBaroCorrectedVE), adjustedMap, tChargeK PASS_GLOBAL_SUFFIX);
if (cisnan(airMass)) {
warning(CUSTOM_ERR_6685, "NaN airMass");
return 0;