Target AFR table Y axis stuck at 0 #4826

progress towards HW CI
This commit is contained in:
rusefillc 2022-11-26 12:55:22 -05:00
parent c729b10bbe
commit 739188d3f1
2 changed files with 16 additions and 3 deletions

View File

@ -27,6 +27,9 @@ public class Field {
private final int bitOffset;
private final String[] options;
private double scale = 1;
/**
* LiveData fragments go one after another in the overall "outputs" region
*/
private int baseOffset;
public Field(String name, int offset, FieldType type) {
@ -123,10 +126,17 @@ public class Field {
return type.getLoadCommand() + " " + getOffset();
}
/**
* todo: replace all (?) usages with #getTotalOffset?
*/
public int getOffset() {
return offset;
}
public int getTotalOffset() {
return baseOffset + offset;
}
public String[] getOptions() {
return options;
}

View File

@ -2,7 +2,9 @@ package com.rusefi.core;
import com.rusefi.config.Field;
import com.rusefi.config.FieldType;
import com.rusefi.config.generated.EngineState;
import com.rusefi.config.generated.Fields;
import com.rusefi.config.generated.FuelComputer;
import com.rusefi.config.generated.TsOutputs;
import com.rusefi.sensor_logs.BinaryLogEntry;
import org.jetbrains.annotations.Nullable;
@ -55,7 +57,7 @@ public enum Sensor implements BinaryLogEntry {
//
// // fuel math
// CHARGE_AIR_MASS("airmass", SensorCategory.OPERATIONS, FieldType.UINT16, 44, 0.001, 0, 3, "g/cyl"),
// crankingFuel(GAUGE_NAME_FUEL_CRANKING, SensorCategory.FUEL, FieldType.UINT16, 46, 1.0 / PACK_MULT_MS, 0, 30, "ms"),
crankingFuel(GAUGE_NAME_FUEL_CRANKING, SensorCategory.FUEL, FieldType.UINT16, EngineState.CRANKINGFUEL_BASEFUEL, 1, 0, 30, "ms"),
baseFuel(Fields.GAUGE_NAME_FUEL_BASE, SensorCategory.FUEL, FieldType.UINT16, TsOutputs.BASEFUEL, 1.0 / PACK_MULT_MS, 0, 30, "ms"),
runningFuel(GAUGE_NAME_FUEL_RUNNING, SensorCategory.FUEL, FieldType.UINT16, TsOutputs.FUELRUNNING, 1.0 / PACK_MULT_FUEL_MASS, 0, 15, "ms"),
// actualLastInjection(GAUGE_NAME_FUEL_LAST_INJECTION, SensorCategory.FUEL, FieldType.UINT16, 54, 1.0 / PACK_MULT_MS, 0, 30, "ms"),
@ -86,7 +88,8 @@ public enum Sensor implements BinaryLogEntry {
//
// // Idle & ETB
// idlePosition("Idle Position", SensorCategory.OPERATIONS, FieldType.INT16, 90, 1.0 / PACK_MULT_PERCENT, 0, 100, "%"),
etbTarget(GAUGE_NAME_ETB_TARGET, SensorCategory.OTHERS, FieldType.INT16, TsOutputs.ETBTARGET, 1.0 / PACK_MULT_PERCENT, 0, 100, "%"),
etbTargetLegacy(GAUGE_NAME_ETB_TARGET, SensorCategory.OTHERS, FieldType.INT16, TsOutputs.ETBTARGET, 1.0 / PACK_MULT_PERCENT, 0, 100, "%"),
etbTarget(GAUGE_NAME_ETB_TARGET, SensorCategory.OTHERS, FieldType.INT16, FuelComputer.TARGETAFR, 1.0 / 1000, 0, 20, ""),
etb1DutyCycle(GAUGE_NAME_ETB_DUTY, SensorCategory.OTHERS, FieldType.INT16, TsOutputs.ETB1DUTYCYCLE, 1.0 / PACK_MULT_PERCENT, 0, 100, "%"),
// etb1Error(GAUGE_NAME_ETB_ERROR, SensorCategory.OTHERS, FieldType.INT16, 96, 1.0 / PACK_MULT_PERCENT, 0, 100, "%"),
@ -186,7 +189,7 @@ public enum Sensor implements BinaryLogEntry {
Sensor(String name, SensorCategory category, FieldType type, Field field, double scale, double minValue, double maxValue, String units) {
this.name = name == null ? name() : name;
this.type = type;
this.offset = field.getOffset();
this.offset = field.getTotalOffset();
this.scale = scale;
this.category = category;
this.units = units;