target lambda & afr log fields broken #4727

This commit is contained in:
rusefillc 2022-11-02 22:17:00 -04:00
parent b87f60f07d
commit 95d360f7b1
7 changed files with 24 additions and 9 deletions

View File

@ -95,10 +95,10 @@ uint16_t rpmAcceleration;dRPM;"RPM/s",1, 0, 0, 5, 2
uint16_t engineMakeCodeNameCrc16;@@GAUGE_NAME_ENGINE_CRC16@@;"crc16",1, 0, 0, 0, 0
! Wall model AE
uint16_t autoscale wallFuelAmount;@@GAUGE_NAME_FUEL_WALL_AMOUNT@@;"mg",{1/@@PACK_MULT_FUEL_MASS@@}, 0, 0, 0, 3
int16_t autoscale wallFuelCorrection;@@GAUGE_NAME_FUEL_WALL_CORRECTION@@;"mg",{1/@@PACK_MULT_FUEL_MASS@@}, 0, 0, 0, 3
int16_t autoscale wallFuelCorrectionValue;@@GAUGE_NAME_FUEL_WALL_CORRECTION@@;"mg",{1/@@PACK_MULT_FUEL_MASS@@}, 0, 0, 0, 3
uint16_t revolutionCounterSinceStart;;"",1, 0, 0, 0, 0
int16_t autoscale deltaTps;@@GAUGE_NAME_FUEL_TPS_ROC@@;"ratio",{1/@@PACK_MULT_PERCENT@@}, 0, 0, 0, 0
int16_t autoscale deltaTpsValue;@@GAUGE_NAME_FUEL_TPS_ROC@@;"ratio",{1/@@PACK_MULT_PERCENT@@}, 0, 0, 0, 0
uint16_t canReadCounter;;"",1, 0, 0, 0, 0
int16_t autoscale tpsAccelFuel;@@GAUGE_NAME_FUEL_TPS_EXTRA@@;"ms",{1/@@PACK_MULT_MS@@}, 0, 0, 0, 3

View File

@ -604,7 +604,7 @@ static void updateFuelInfo() {
engine->outputChannels.veValue = engine->engineState.currentVe;
engine->outputChannels.currentTargetAfr = engine->fuelComputer->targetAFR;
engine->outputChannels.crankingFuelMs = engine->engineState.cranking.fuel;
engine->outputChannels.crankingFuelMs = engine->engineState.crankingFuel.fuel;
}
static void updateIgnition(int rpm) {

View File

@ -56,7 +56,7 @@ floatms_t fuel;Fuel: Actual injection\nduration based on all coefficients.
end_struct
! actually define a member of 'cranking_s' type
cranking_fuel_s cranking
cranking_fuel_s crankingFuel
@ -91,8 +91,8 @@ running_fuel_s running
bit startStopState
uint32_t startStopStateToggleCounter
float egt1
float egt2
float egtValue1
float egtValue2
int16_t desiredRpmLimit;User-defined RPM hard limit;"rpm", 1, 0, 0, 30000, 0

View File

@ -54,7 +54,7 @@ float getCrankingFuel3(
/**
* Cranking fuel changes over time
*/
engine->engineState.cranking.durationCoefficient = interpolate2d(revolutionCounterSinceStart, config->crankingCycleBins,
engine->engineState.crankingFuel.durationCoefficient = interpolate2d(revolutionCounterSinceStart, config->crankingCycleBins,
config->crankingCycleCoef);
/**

Binary file not shown.

View File

@ -48,8 +48,11 @@ public class TsOutput {
* in 'Constants' section we have conditional sections and this check is not smart enough to handle those right
* A simple solution would be to allow only one variable per each conditional section - would be simpler not to check against previous field
*/
if (!usedNames.add(nameWithPrefix) && !isConstantsSection) {
throw new IllegalStateException(nameWithPrefix + " already present");
if (!usedNames.add(nameWithPrefix)
&& !isConstantsSection
&& !configField.getName().startsWith(ConfigStructure.ALIGNMENT_FILL_AT)
&& !configField.getName().startsWith(ConfigStructure.UNUSED_ANYTHING_PREFIX)) {
throw new IllegalStateException(nameWithPrefix + " already present: " + configField);
}
if (configField.getName().startsWith(ConfigStructure.ALIGNMENT_FILL_AT)) {

View File

@ -214,4 +214,16 @@ public class OutputsTest {
"; total TS size = 1\n";
assertEquals(expectedLegacy, runOriginalImplementation(test).getContent());
}
@Test
public void nameNotDuplicate() {
String test = "struct total\n" +
"float afr_type;PID dTime;\"ms\", 1, 0, 0, 3000, 0\n" +
"struct afr_type\n" +
"float afr_type2;PID dTime;\"ms\", 1, 0, 0, 3000, 0\n" +
"end_struct\n" +
"end_struct\n";
runOriginalImplementation(test);
}
}