This commit is contained in:
rusefi 2017-04-04 21:42:10 -04:00
commit 68ae5b3028
13 changed files with 76 additions and 31 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 // begin
#ifndef ENGINE_CONFIGURATION_GENERATED_H_ #ifndef ENGINE_CONFIGURATION_GENERATED_H_
#define ENGINE_CONFIGURATION_GENERATED_H_ #define ENGINE_CONFIGURATION_GENERATED_H_
@ -2057,4 +2057,4 @@ typedef struct {
#endif #endif
// end // 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_EL_EXTRA "fuel: engine load acceleration extra fuel"
#define GAUGE_NAME_FUEL_INJ_DUTY "fuel: injector duty cycle" #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

@ -871,3 +871,5 @@ end_struct
#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

@ -44,7 +44,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code ; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START ; CONFIG_DEFINITION_START
; 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:25:16 EDT 2017
pageSize = 16376 pageSize = 16376
page = 1 page = 1
@ -1320,14 +1320,14 @@ fileVersion = { 20161225 }
entry = baseFuel, "fuel: base", float, "%.2f" entry = baseFuel, "fuel: base", float, "%.2f"
entry = fuelPidCorrection,"fuel: pid", float, "%.2f" entry = fuelPidCorrection,"fuel: pid", float, "%.2f"
entry = veValue, "fuel: VE", float, "%.3f" entry = veValue, "fuel: VE", float, "%.3f"
entry = injectorDutyCycle,"fuel: duty cyc",float,"%.3f" entry = injectorDutyCycle,"fuel: injector duty cycle",float,"%.3f"
entry = coilDutyCycle, "dwell: duty", float,"%.3f" entry = coilDutyCycle, "dwell: coil duty cycle", float,"%.3f"
entry = engineLoadAccelExtra, "fuel: load extra",float, "%.3f" entry = engineLoadAccelExtra, "fuel: engine load acceleration extra fuel",float, "%.3f"
entry = engineLoadDelta, "fuel: load change",float, "%.3f" entry = engineLoadDelta, "fuel: load change",float, "%.3f"
entry = deltaTps, "fuel: TPS change",float, "%.3f" entry = deltaTps, "fuel: TPS change",float, "%.3f"
entry = tpsAccelFuel, "fuel: TOS enrich", float, "%.3f" entry = tpsAccelFuel, "fuel: TPS acceleration extra fuel", float, "%.3f"
entry = wallFuelCorrection,"fuel: wall corr ms", float, "%.3f" entry = wallFuelCorrection,"fuel: wall corr ms", float, "%.3f"
entry = wallFuelAmount, "fuel: wall amount", float, "%.3f" entry = wallFuelAmount, "fuel: wall amount", float, "%.3f"
@ -1336,7 +1336,7 @@ fileVersion = { 20161225 }
entry = iatCorrection, "fuel: IAT corr", float, "%.3f" entry = iatCorrection, "fuel: IAT corr", float, "%.3f"
entry = cltCorrection, "cltCorrection", float,"%.3f" entry = cltCorrection, "cltCorrection", float,"%.3f"
entry = sparkDwellValue, "dwell", float,"%.3f" entry = sparkDwellValue, "dwell: coil charge time", float,"%.3f"
entry = vvtPosition, "VVT", float,"%.2f" entry = vvtPosition, "VVT", float,"%.2f"
; is there a way to log parameter? entry = debugMode, "debugMode",int,"%d" ; is there a way to log parameter? entry = debugMode, "debugMode",int,"%d"

View File

@ -591,14 +591,14 @@ fileVersion = { 20161225 }
entry = baseFuel, "fuel: base", float, "%.2f" entry = baseFuel, "fuel: base", float, "%.2f"
entry = fuelPidCorrection,"fuel: pid", float, "%.2f" entry = fuelPidCorrection,"fuel: pid", float, "%.2f"
entry = veValue, "fuel: VE", float, "%.3f" entry = veValue, "fuel: VE", float, "%.3f"
entry = injectorDutyCycle,"fuel: duty cyc",float,"%.3f" entry = injectorDutyCycle,@@GAUGE_NAME_FUEL_INJ_DUTY@@,float,"%.3f"
entry = coilDutyCycle, "dwell: 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 = engineLoadDelta, "fuel: load change",float, "%.3f"
entry = deltaTps, "fuel: TPS 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 = wallFuelCorrection,"fuel: wall corr ms", float, "%.3f"
entry = wallFuelAmount, "fuel: wall amount", float, "%.3f" entry = wallFuelAmount, "fuel: wall amount", float, "%.3f"
@ -607,7 +607,7 @@ fileVersion = { 20161225 }
entry = iatCorrection, "fuel: IAT corr", float, "%.3f" entry = iatCorrection, "fuel: IAT corr", float, "%.3f"
entry = cltCorrection, "cltCorrection", 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" entry = vvtPosition, "VVT", float,"%.2f"
; is there a way to log parameter? entry = debugMode, "debugMode",int,"%d" ; is there a way to log parameter? entry = debugMode, "debugMode",int,"%d"

View File

@ -1,3 +1,3 @@
rem Let's regemerate 'svnversion.h' rem Let's regemerate 'svnversion.h'
rem TODO: handle std err - for example, in case svn needs upgrade rem TODO: handle std err - for example, in case svn needs upgrade
java -jar ../java_tools/version2header.jar 10000 java -jar ../java_tools/version2header.jar 10000 https://github.com/rusefi/rusefi

View File

@ -1,6 +1,6 @@
package com.rusefi.config; 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 class Fields {
public static final int LE_COMMAND_LENGTH = 200; public static final int LE_COMMAND_LENGTH = 200;
public static final int FSIO_ADC_COUNT = 4; 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 fsioTable4LoadBins_offset = 16312;
public static final int fsioTable4RpmBins_offset = 16344; public static final int fsioTable4RpmBins_offset = 16344;
public static final int TOTAL_CONFIG_SIZE = 16376; 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 ENGINETYPE = Field.create("ENGINETYPE", 0, FieldType.INT);
public static final Field ENGINESNIFFERRPMTHRESHOLD = Field.create("ENGINESNIFFERRPMTHRESHOLD", 4, 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); public static final Field INJECTOR_FLOW = Field.create("INJECTOR_FLOW", 8, FieldType.FLOAT);

View File

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

Binary file not shown.

View File

@ -29,6 +29,7 @@ public class ConfigField {
public static final int LENGTH = 24; public static final int LENGTH = 24;
private static final char TS_COMMENT_TAG = '+'; private static final char TS_COMMENT_TAG = '+';
public static final String ENUM_SUFFIX = "_enum";
/** /**
* field name without structure name * field name without structure name
@ -224,7 +225,7 @@ public class ConfigField {
writeJavaFieldName(javaFieldsWriter, nameWithPrefix, tsPosition); writeJavaFieldName(javaFieldsWriter, nameWithPrefix, tsPosition);
javaFieldsWriter.write("FieldType.FLOAT);" + EOL); javaFieldsWriter.write("FieldType.FLOAT);" + EOL);
} else { } else {
String enumOptions = VariableRegistry.INSTANCE.get(type + "_enum"); String enumOptions = VariableRegistry.INSTANCE.get(type + ENUM_SUFFIX);
if (enumOptions != null && !javaEnums.contains(type)) { if (enumOptions != null && !javaEnums.contains(type)) {
javaEnums.add(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 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 javaNumbericDefinitions = new StringBuilder();
private final StringBuilder javaStringDefinitions = new StringBuilder();
private VariableRegistry() { private VariableRegistry() {
super(String.CASE_INSENSITIVE_ORDER); super(String.CASE_INSENSITIVE_ORDER);
@ -64,8 +65,22 @@ public class VariableRegistry extends TreeMap<String, String> {
javaNumbericDefinitions.append("\tpublic static final int " + var + " = " + intValue + ";" + EOL); javaNumbericDefinitions.append("\tpublic static final int " + var + " = " + intValue + ";" + EOL);
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
System.out.println("Not an integer: " + value); 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) { public void register(String var, int i) {
register(var, Integer.toString(i)); register(var, Integer.toString(i));
@ -82,6 +97,6 @@ public class VariableRegistry extends TreeMap<String, String> {
} }
public String getJavaConstants() { public String getJavaConstants() {
return javaNumbericDefinitions.toString(); return javaNumbericDefinitions.toString() + javaStringDefinitions.toString();
} }
} }

Binary file not shown.

View File

@ -14,17 +14,25 @@ public class Version2Header {
private static final String HEADER_TAG = "VCS_VERSION"; private static final String HEADER_TAG = "VCS_VERSION";
public static void main(String[] args) throws IOException { public static void main(String[] args) throws IOException {
if (args.length!=1) { if (args.length != 1 && args.length != 2) {
System.out.println("Version offset value is now a mandatory parameter!"); System.out.println("Version offset value is now a mandatory parameter!");
System.exit(-1); System.exit(-1);
} }
int versionOffsetValue = Integer.parseInt(args[0]); int versionOffsetValue = Integer.parseInt(args[0]);
String url = args.length == 2 ? args[1] : "";
System.out.println("Hi, it's " + new Date()); System.out.println("Hi, it's " + new Date());
if (url.isEmpty()) {
System.out.println("Looking for local version");
} else {
System.out.println("Looking for remove version: " + url);
}
String command = COMMAND + url;
System.out.println("Working with " + NL.length() + " line ends, offset " + versionOffsetValue); System.out.println("Working with " + NL.length() + " line ends, offset " + versionOffsetValue);
Process simulatorProcess = null; Process simulatorProcess = null;
try { try {
System.out.println("Executing [" + COMMAND + "]"); System.out.println("Executing [" + command + "]");
simulatorProcess = Runtime.getRuntime().exec(COMMAND); simulatorProcess = Runtime.getRuntime().exec(command);
BufferedReader stdout = BufferedReader stdout =
new BufferedReader(new InputStreamReader(simulatorProcess.getInputStream())); new BufferedReader(new InputStreamReader(simulatorProcess.getInputStream()));
@ -32,7 +40,7 @@ public class Version2Header {
int counter = 0; int counter = 0;
String line; String line;
while ((line = stdout.readLine()) != null) { while ((line = stdout.readLine()) != null) {
System.out.println("from " + COMMAND + ": " + line); System.out.println("from " + command + ": " + line);
counter++; counter++;
if (line.startsWith(VERSION_MARKER)) { if (line.startsWith(VERSION_MARKER)) {