parent
55062b1ef6
commit
9cbd8b9e73
|
@ -27,6 +27,9 @@ public class Field {
|
||||||
private final int bitOffset;
|
private final int bitOffset;
|
||||||
private final String[] options;
|
private final String[] options;
|
||||||
private double scale = 1;
|
private double scale = 1;
|
||||||
|
/**
|
||||||
|
* LiveData fragments go one after another in the overall "outputs" region
|
||||||
|
*/
|
||||||
private int baseOffset;
|
private int baseOffset;
|
||||||
|
|
||||||
public Field(String name, int offset, FieldType type) {
|
public Field(String name, int offset, FieldType type) {
|
||||||
|
@ -123,10 +126,17 @@ public class Field {
|
||||||
return type.getLoadCommand() + " " + getOffset();
|
return type.getLoadCommand() + " " + getOffset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* todo: replace all (?) usages with #getTotalOffset?
|
||||||
|
*/
|
||||||
public int getOffset() {
|
public int getOffset() {
|
||||||
return offset;
|
return offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getTotalOffset() {
|
||||||
|
return baseOffset + offset;
|
||||||
|
}
|
||||||
|
|
||||||
public String[] getOptions() {
|
public String[] getOptions() {
|
||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,9 @@ package com.rusefi.core;
|
||||||
|
|
||||||
import com.rusefi.config.Field;
|
import com.rusefi.config.Field;
|
||||||
import com.rusefi.config.FieldType;
|
import com.rusefi.config.FieldType;
|
||||||
|
import com.rusefi.config.generated.EngineState;
|
||||||
import com.rusefi.config.generated.Fields;
|
import com.rusefi.config.generated.Fields;
|
||||||
|
import com.rusefi.config.generated.FuelComputer;
|
||||||
import com.rusefi.config.generated.TsOutputs;
|
import com.rusefi.config.generated.TsOutputs;
|
||||||
import com.rusefi.sensor_logs.BinaryLogEntry;
|
import com.rusefi.sensor_logs.BinaryLogEntry;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
@ -55,7 +57,7 @@ public enum Sensor implements BinaryLogEntry {
|
||||||
//
|
//
|
||||||
// // fuel math
|
// // fuel math
|
||||||
// CHARGE_AIR_MASS("airmass", SensorCategory.OPERATIONS, FieldType.UINT16, 44, 0.001, 0, 3, "g/cyl"),
|
// 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"),
|
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"),
|
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"),
|
// 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
|
// // Idle & ETB
|
||||||
// idlePosition("Idle Position", SensorCategory.OPERATIONS, FieldType.INT16, 90, 1.0 / PACK_MULT_PERCENT, 0, 100, "%"),
|
// 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, "%"),
|
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, "%"),
|
// 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) {
|
Sensor(String name, SensorCategory category, FieldType type, Field field, double scale, double minValue, double maxValue, String units) {
|
||||||
this.name = name == null ? name() : name;
|
this.name = name == null ? name() : name;
|
||||||
this.type = type;
|
this.type = type;
|
||||||
this.offset = field.getOffset();
|
this.offset = field.getTotalOffset();
|
||||||
this.scale = scale;
|
this.scale = scale;
|
||||||
this.category = category;
|
this.category = category;
|
||||||
this.units = units;
|
this.units = units;
|
||||||
|
|
Loading…
Reference in New Issue