Merge remote-tracking branch 'origin/master' into fresh_chibios_2nd

This commit is contained in:
rusefi 2017-04-03 21:31:30 -04:00
commit 67c8ce921c
9 changed files with 56 additions and 19 deletions

View File

@ -1,4 +1,4 @@
// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Mon Mar 27 22:26:05 EDT 2017
// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Mon Apr 03 21:10:42 EDT 2017
// begin
#ifndef ENGINE_CONFIGURATION_GENERATED_H_
#define ENGINE_CONFIGURATION_GENERATED_H_
@ -2057,4 +2057,4 @@ typedef struct {
#endif
// end
// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Mon Mar 27 22:26:05 EDT 2017
// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Mon Apr 03 21:10:42 EDT 2017

View File

@ -1495,3 +1495,4 @@
#define GAUGE_NAME_FUEL_EL_EXTRA "fuel: engine load acceleration extra fuel"
#define GAUGE_NAME_FUEL_INJ_DUTY "fuel: injector duty cycle"
#define GAUGE_NAME_DWELL_DUTY "dwell: coil duty cycle"
#define GAUGE_COIL_DWELL_TIME "dwell: coil charge time"

View File

@ -870,4 +870,6 @@ end_struct
#define GAUGE_NAME_FUEL_INJ_DUTY "fuel: injector duty cycle"
#define GAUGE_NAME_DWELL_DUTY "dwell: coil duty cycle"
#define GAUGE_NAME_DWELL_DUTY "dwell: coil duty cycle"
#define GAUGE_COIL_DWELL_TIME "dwell: coil charge time"

View File

@ -591,14 +591,14 @@ fileVersion = { 20161225 }
entry = baseFuel, "fuel: base", float, "%.2f"
entry = fuelPidCorrection,"fuel: pid", float, "%.2f"
entry = veValue, "fuel: VE", float, "%.3f"
entry = injectorDutyCycle,"fuel: duty cyc",float,"%.3f"
entry = coilDutyCycle, "dwell: duty", float,"%.3f"
entry = injectorDutyCycle,@@GAUGE_NAME_FUEL_INJ_DUTY@@,float,"%.3f"
entry = coilDutyCycle, @@GAUGE_NAME_DWELL_DUTY@@, float,"%.3f"
entry = engineLoadAccelExtra, "fuel: load extra",float, "%.3f"
entry = engineLoadAccelExtra, @@GAUGE_NAME_FUEL_EL_EXTRA@@,float, "%.3f"
entry = engineLoadDelta, "fuel: load change",float, "%.3f"
entry = deltaTps, "fuel: TPS change",float, "%.3f"
entry = tpsAccelFuel, "fuel: TOS enrich", float, "%.3f"
entry = tpsAccelFuel, @@GAUGE_NAME_FUEL_TPS_EXTRA@@, float, "%.3f"
entry = wallFuelCorrection,"fuel: wall corr ms", float, "%.3f"
entry = wallFuelAmount, "fuel: wall amount", float, "%.3f"
@ -607,7 +607,7 @@ fileVersion = { 20161225 }
entry = iatCorrection, "fuel: IAT corr", float, "%.3f"
entry = cltCorrection, "cltCorrection", float,"%.3f"
entry = sparkDwellValue, "dwell", float,"%.3f"
entry = sparkDwellValue, @@GAUGE_COIL_DWELL_TIME@@, float,"%.3f"
entry = vvtPosition, "VVT", float,"%.2f"
; is there a way to log parameter? entry = debugMode, "debugMode",int,"%d"

View File

@ -1,6 +1,6 @@
package com.rusefi.config;
// this file was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Mon Mar 27 22:26:05 EDT 2017
// this file was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Mon Apr 03 21:25:16 EDT 2017
public class Fields {
public static final int LE_COMMAND_LENGTH = 200;
public static final int FSIO_ADC_COUNT = 4;
@ -1026,6 +1026,11 @@ public class Fields {
public static final int fsioTable4LoadBins_offset = 16312;
public static final int fsioTable4RpmBins_offset = 16344;
public static final int TOTAL_CONFIG_SIZE = 16376;
public static final String GAUGE_NAME_FUEL_TPS_EXTRA = "fuel: TPS acceleration extra fuel";
public static final String GAUGE_NAME_FUEL_EL_EXTRA = "fuel: engine load acceleration extra fuel";
public static final String GAUGE_NAME_FUEL_INJ_DUTY = "fuel: injector duty cycle";
public static final String GAUGE_NAME_DWELL_DUTY = "dwell: coil duty cycle";
public static final String GAUGE_COIL_DWELL_TIME = "dwell: coil charge time";
public static final Field ENGINETYPE = Field.create("ENGINETYPE", 0, FieldType.INT);
public static final Field ENGINESNIFFERRPMTHRESHOLD = Field.create("ENGINESNIFFERRPMTHRESHOLD", 4, FieldType.INT);
public static final Field INJECTOR_FLOW = Field.create("INJECTOR_FLOW", 8, FieldType.FLOAT);

View File

@ -1,6 +1,7 @@
package com.rusefi.core;
import com.rusefi.config.FieldType;
import com.rusefi.config.Fields;
import eu.hansolo.steelseries.tools.BackgroundColor;
import java.util.ArrayList;
@ -95,7 +96,7 @@ public enum Sensor {
T_CHARGE(SensorCategory.FUEL, FieldType.FLOAT, 52, BackgroundColor.MUD, 30, 140),
// todo: unify with TIMING
ignitionAdvance(SensorCategory.OPERATIONS, FieldType.FLOAT, 56, BackgroundColor.MUD, 30, 140),
DWELL(SensorCategory.OPERATIONS, FieldType.FLOAT, 60, BackgroundColor.MUD, 1, 10),
DWELL(Fields.GAUGE_COIL_DWELL_TIME, SensorCategory.OPERATIONS, FieldType.FLOAT, 60, BackgroundColor.MUD, 1, 10),
actualLastInjection(SensorCategory.FUEL, FieldType.FLOAT, 64, BackgroundColor.MUD, 0, 30, "ms"),
debugFloatField1(SensorCategory.OPERATIONS, FieldType.FLOAT, 68, BackgroundColor.MUD, 0, 5),
VSS(SensorCategory.OPERATIONS, FieldType.FLOAT, 76, BackgroundColor.BLUE),
@ -104,8 +105,8 @@ public enum Sensor {
deltaTps(SensorCategory.FUEL, FieldType.FLOAT, 116, BackgroundColor.MUD),
engineLoadAccelDelta(SensorCategory.FUEL, FieldType.FLOAT, 124, BackgroundColor.MUD),
tpsAccelFuel(SensorCategory.FUEL, FieldType.FLOAT, 128, BackgroundColor.MUD),
injectorDutyCycle(SensorCategory.OPERATIONS, FieldType.FLOAT, 140, BackgroundColor.MUD),
tpsAccelFuel(Fields.GAUGE_NAME_FUEL_TPS_EXTRA, SensorCategory.FUEL, FieldType.FLOAT, 128, BackgroundColor.MUD),
injectorDutyCycle(Fields.GAUGE_NAME_FUEL_INJ_DUTY, SensorCategory.OPERATIONS, FieldType.FLOAT, 140, BackgroundColor.MUD),
wallFuelAmount(SensorCategory.FUEL, FieldType.FLOAT, 160, BackgroundColor.MUD),
iatCorrection(SensorCategory.FUEL, FieldType.FLOAT, 164, BackgroundColor.MUD, 0, 5),
wallFuelCorrection(SensorCategory.FUEL, FieldType.FLOAT, 168, BackgroundColor.MUD),
@ -136,7 +137,7 @@ public enum Sensor {
debugFloatField6(SensorCategory.OPERATIONS, FieldType.FLOAT, 256, BackgroundColor.MUD, 0, 5),
debugFloatField7(SensorCategory.OPERATIONS, FieldType.FLOAT, 260, BackgroundColor.MUD, 0, 5),
coilDutyCycle(SensorCategory.OPERATIONS, FieldType.FLOAT, 272, BackgroundColor.MUD),
coilDutyCycle(Fields.GAUGE_NAME_DWELL_DUTY, SensorCategory.OPERATIONS, FieldType.FLOAT, 272, BackgroundColor.MUD),
INJ_1_2_DELTA("inj 1-2 delta", SensorCategory.SNIFFING),
INJ_3_4_DELTA("inj 3-4 delta", SensorCategory.SNIFFING),
@ -151,8 +152,8 @@ public enum Sensor {
private final FieldType type;
private final int offset;
Sensor(SensorCategory category, FieldType type, int offset, BackgroundColor color, double minValue, double maxValue, String units) {
name = name();
Sensor(String name, SensorCategory category, FieldType type, int offset, BackgroundColor color, double minValue, double maxValue, String units) {
this.name = name == null ? name() : name;
this.type = type;
this.offset = offset;
this.category = category;
@ -162,12 +163,24 @@ public enum Sensor {
this.maxValue = maxValue;
}
Sensor(SensorCategory category, FieldType type, int offset, BackgroundColor color, double minValue, double maxValue, String units) {
this(null, category, type, offset, color, minValue, maxValue, units);
}
Sensor(String name, SensorCategory category, FieldType type, int offset, BackgroundColor color, double minValue, double maxValue) {
this(name, category, type, offset, color, minValue, maxValue, "n/a");
}
Sensor(SensorCategory category, FieldType type, int offset, BackgroundColor color, double minValue, double maxValue) {
this(category, type, offset, color, minValue, maxValue, "n/a");
this(null, category, type, offset, color, minValue, maxValue);
}
Sensor(SensorCategory category, FieldType type, int offset, BackgroundColor color) {
this(category, type, offset, color, 0, 100);
this(null, category, type, offset, color);
}
Sensor(String name, SensorCategory category, FieldType type, int offset, BackgroundColor color) {
this(name, category, type, offset, color, 0, 100);
}
Sensor(String name, SensorCategory category) {

Binary file not shown.

View File

@ -29,6 +29,7 @@ public class ConfigField {
public static final int LENGTH = 24;
private static final char TS_COMMENT_TAG = '+';
public static final String ENUM_SUFFIX = "_enum";
/**
* field name without structure name
@ -224,7 +225,7 @@ public class ConfigField {
writeJavaFieldName(javaFieldsWriter, nameWithPrefix, tsPosition);
javaFieldsWriter.write("FieldType.FLOAT);" + EOL);
} else {
String enumOptions = VariableRegistry.INSTANCE.get(type + "_enum");
String enumOptions = VariableRegistry.INSTANCE.get(type + ENUM_SUFFIX);
if (enumOptions != null && !javaEnums.contains(type)) {
javaEnums.add(type);

View File

@ -24,6 +24,7 @@ public class VariableRegistry extends TreeMap<String, String> {
private final StringBuilder cAllDefinitions = new StringBuilder("//\n// generated by ConfigDefinition.jar tool based on rusefi_config.txt\n//\n\n");
private final StringBuilder javaNumbericDefinitions = new StringBuilder();
private final StringBuilder javaStringDefinitions = new StringBuilder();
private VariableRegistry() {
super(String.CASE_INSENSITIVE_ORDER);
@ -64,9 +65,23 @@ public class VariableRegistry extends TreeMap<String, String> {
javaNumbericDefinitions.append("\tpublic static final int " + var + " = " + intValue + ";" + EOL);
} catch (NumberFormatException e) {
System.out.println("Not an integer: " + value);
if (isQuoted(value) && !var.trim().endsWith(ConfigField.ENUM_SUFFIX)) {
// quoted and not with enum suffix means plain string define statement
javaStringDefinitions.append("\tpublic static final String " + var + " = " + value + ";" + EOL);
}
}
}
private boolean isQuoted(String value) {
if (value == null)
return false;
value = value.trim();
if (value.isEmpty())
return false;
return value.charAt(0) == '"' && value.charAt(value.length() - 1) == '"';
}
public void register(String var, int i) {
register(var, Integer.toString(i));
register(var + "_hex", Integer.toString(i, 16));
@ -82,6 +97,6 @@ public class VariableRegistry extends TreeMap<String, String> {
}
public String getJavaConstants() {
return javaNumbericDefinitions.toString();
return javaNumbericDefinitions.toString() + javaStringDefinitions.toString();
}
}