From 25b5e4943c2611a02cba5d717a6a3aa212505add Mon Sep 17 00:00:00 2001 From: rusefi Date: Mon, 3 Apr 2017 21:09:04 -0400 Subject: [PATCH 1/6] #382 improvements to generator to support simple string constants --- java_tools/ConfigDefinition.jar | Bin 32357 -> 32879 bytes .../src/com/rusefi/ConfigField.java | 3 ++- .../src/com/rusefi/VariableRegistry.java | 17 ++++++++++++++++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/java_tools/ConfigDefinition.jar b/java_tools/ConfigDefinition.jar index 7ce6969b9295f69d6e42aed5a325d68ac2ecef2f..22711af658c71546d48b5538053558e1325cae0c 100644 GIT binary patch delta 11147 zcmeI&)mPMUlmKu*x&)*f>6Y%4M!F;g>F$mnB`x8A#7KiQf`by$NW;JY(mB%L3=NX& zp0oR~`w#5H@_o54-}629>7IK(_q%nAii|`f(A9i`j*EhVjekkS63W__(oSYSKwlL_)_9udWkQDenqZmRT4 zru?=~%I5A=_XfeqjtJvP*J^{x;ST-H^2}DOb~Q{1eMxgeZ-KfOW)&^U$92!QMEi;R zo0BmQ-u2TZAq~T_Iqt*7vymQ~1j}46!SG6W4!i{(&`(1a$Ptl$v|M&Y-w(!UH;J1Y zZBW+sGzw!V>01&;;7 z({0qguVacI0nVAgk)W~NAMnY-HCqtSn|{_EjpgV2Ikd z%35%x(JS!gJP+{`CwyYv`i;(Ix7z+t6g?a8W}>@u28dwO4$(!aDRy#kViA~MTN6sB zR`*BtX)6Z2ZK!fww|*F!>{(sie0lWg^-x*XpJkhaIhs8>yTTRYb>Q49kSWa)B0@hSNONtl|(?S9CGjGej(!u$*MViF5S;7Z@=r_9P zxWr{jC4i6SYYI&D`hD1lc&>mRWGIL-TMSqEaNuAU_TBKrsU43n@5N|box5dH120Z% z(UK>%twWFZJa65woq30wfiW~H*ZBKvxs#-&nz=)DrU>3kV`m-$3Z&T-uxBx7!^Gb$ zpjnyirU`Ge#=ZDNC30#^y-Lk<@3q7BoT zB~Ud$4iK~b8nd9N^}5JQ5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PNuf2qD8J`zK3#Ic!VbEIq&YIF$;Pgw)w#W{3B(M>y^z{m zl^z0(GD&H3+@skC*8gBqKc!u&yz&qd3&fx0HJ#PuC41sEl{AAXJ2p&xuH>7NYy(jg z-ZZ+H$D3~oB-`Do|7paT;>cVXR*U8~*CaZ!+a>T#+8dI>(wf_C=VNa1|0P4z=OD)V zQ%`oHdP(_nnma7K!@@f(yu-pfEWE?QJ1o4z!aFRy!@@f(yu-pfEWE?QJ1o4z!aFRy z!@@f({Qr)Hf<%P>xtgIk{iXkXGOV}r561sraJU^{Mc~GPQhr8_inpUcxdig#e?lb( z>f*nBNWkUo;U$S%r`j Kk^22R%6|cGT704a diff --git a/java_tools/configuration_definition/src/com/rusefi/ConfigField.java b/java_tools/configuration_definition/src/com/rusefi/ConfigField.java index b728253c54..bc4c7ea050 100644 --- a/java_tools/configuration_definition/src/com/rusefi/ConfigField.java +++ b/java_tools/configuration_definition/src/com/rusefi/ConfigField.java @@ -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); diff --git a/java_tools/configuration_definition/src/com/rusefi/VariableRegistry.java b/java_tools/configuration_definition/src/com/rusefi/VariableRegistry.java index c942271799..fd711748a2 100644 --- a/java_tools/configuration_definition/src/com/rusefi/VariableRegistry.java +++ b/java_tools/configuration_definition/src/com/rusefi/VariableRegistry.java @@ -24,6 +24,7 @@ public class VariableRegistry extends TreeMap { 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 { 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 { } public String getJavaConstants() { - return javaNumbericDefinitions.toString(); + return javaNumbericDefinitions.toString() + javaStringDefinitions.toString(); } } From 724f99aa75a52e623957daee03cd7ba622223c53 Mon Sep 17 00:00:00 2001 From: rusefi Date: Mon, 3 Apr 2017 21:12:21 -0400 Subject: [PATCH 2/6] #382 using constants in TS project --- .../algo/engine_configuration_generated_structures.h | 4 ++-- firmware/tunerstudio/rusefi.ini | 10 +++++----- firmware/tunerstudio/rusefi.input | 8 ++++---- java_console/models/src/com/rusefi/config/Fields.java | 6 +++++- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/firmware/controllers/algo/engine_configuration_generated_structures.h b/firmware/controllers/algo/engine_configuration_generated_structures.h index 1e995df446..8cede97fd6 100644 --- a/firmware/controllers/algo/engine_configuration_generated_structures.h +++ b/firmware/controllers/algo/engine_configuration_generated_structures.h @@ -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 diff --git a/firmware/tunerstudio/rusefi.ini b/firmware/tunerstudio/rusefi.ini index 126f9cc599..ef22156ebf 100644 --- a/firmware/tunerstudio/rusefi.ini +++ b/firmware/tunerstudio/rusefi.ini @@ -44,7 +44,7 @@ enable2ndByteCanID = false ; see PAGE_0_SIZE in C source code ; 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:10:42 EDT 2017 pageSize = 16376 page = 1 @@ -1320,14 +1320,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,"fuel: injector duty cycle",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 = 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 = wallFuelAmount, "fuel: wall amount", float, "%.3f" diff --git a/firmware/tunerstudio/rusefi.input b/firmware/tunerstudio/rusefi.input index d42f3206d2..f11afc63ca 100644 --- a/firmware/tunerstudio/rusefi.input +++ b/firmware/tunerstudio/rusefi.input @@ -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" diff --git a/java_console/models/src/com/rusefi/config/Fields.java b/java_console/models/src/com/rusefi/config/Fields.java index 6ce4dc4e63..128269d0ae 100644 --- a/java_console/models/src/com/rusefi/config/Fields.java +++ b/java_console/models/src/com/rusefi/config/Fields.java @@ -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:10:42 EDT 2017 public class Fields { public static final int LE_COMMAND_LENGTH = 200; public static final int FSIO_ADC_COUNT = 4; @@ -1026,6 +1026,10 @@ 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 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); From 7a55c9b54aff0f73ebb7fe4022ef632a202752d8 Mon Sep 17 00:00:00 2001 From: rusefi Date: Mon, 3 Apr 2017 21:19:11 -0400 Subject: [PATCH 3/6] #382 using constants in java console --- .../models/src/com/rusefi/core/Sensor.java | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/java_console/models/src/com/rusefi/core/Sensor.java b/java_console/models/src/com/rusefi/core/Sensor.java index 2d639081ac..17d926e303 100644 --- a/java_console/models/src/com/rusefi/core/Sensor.java +++ b/java_console/models/src/com/rusefi/core/Sensor.java @@ -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; @@ -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) { From 94ed4f25b8e0dc5ebeec899d71230bb5edb0f3e7 Mon Sep 17 00:00:00 2001 From: rusefi Date: Mon, 3 Apr 2017 21:27:38 -0400 Subject: [PATCH 4/6] #382 example how to convert one field to use constant --- firmware/controllers/algo/rusefi_generated.h | 1 + firmware/integration/rusefi_config.txt | 4 +++- firmware/tunerstudio/rusefi.ini | 4 ++-- firmware/tunerstudio/rusefi.input | 2 +- java_console/models/src/com/rusefi/config/Fields.java | 3 ++- java_console/models/src/com/rusefi/core/Sensor.java | 2 +- 6 files changed, 10 insertions(+), 6 deletions(-) diff --git a/firmware/controllers/algo/rusefi_generated.h b/firmware/controllers/algo/rusefi_generated.h index 861b70f0e5..b4becedc0a 100644 --- a/firmware/controllers/algo/rusefi_generated.h +++ b/firmware/controllers/algo/rusefi_generated.h @@ -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" diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index 8021afe7ce..a8379a957b 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -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" \ No newline at end of file +#define GAUGE_NAME_DWELL_DUTY "dwell: coil duty cycle" + +#define GAUGE_COIL_DWELL_TIME "dwell: coil charge time" diff --git a/firmware/tunerstudio/rusefi.ini b/firmware/tunerstudio/rusefi.ini index ef22156ebf..b30272fba8 100644 --- a/firmware/tunerstudio/rusefi.ini +++ b/firmware/tunerstudio/rusefi.ini @@ -44,7 +44,7 @@ enable2ndByteCanID = false ; see PAGE_0_SIZE in C source code ; CONFIG_DEFINITION_START -; this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Mon Apr 03 21:10:42 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 page = 1 @@ -1336,7 +1336,7 @@ fileVersion = { 20161225 } entry = iatCorrection, "fuel: IAT corr", 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" ; is there a way to log parameter? entry = debugMode, "debugMode",int,"%d" diff --git a/firmware/tunerstudio/rusefi.input b/firmware/tunerstudio/rusefi.input index f11afc63ca..87e299b760 100644 --- a/firmware/tunerstudio/rusefi.input +++ b/firmware/tunerstudio/rusefi.input @@ -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" diff --git a/java_console/models/src/com/rusefi/config/Fields.java b/java_console/models/src/com/rusefi/config/Fields.java index 128269d0ae..fd0feff94c 100644 --- a/java_console/models/src/com/rusefi/config/Fields.java +++ b/java_console/models/src/com/rusefi/config/Fields.java @@ -1,6 +1,6 @@ package com.rusefi.config; -// this file was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Mon Apr 03 21:10:42 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; @@ -1030,6 +1030,7 @@ public class Fields { 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); diff --git a/java_console/models/src/com/rusefi/core/Sensor.java b/java_console/models/src/com/rusefi/core/Sensor.java index 17d926e303..c67c0568d0 100644 --- a/java_console/models/src/com/rusefi/core/Sensor.java +++ b/java_console/models/src/com/rusefi/core/Sensor.java @@ -96,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), From 899a4610987bde05b8a1ec15fcc2837af1008be4 Mon Sep 17 00:00:00 2001 From: rusefi Date: Tue, 4 Apr 2017 21:21:07 -0400 Subject: [PATCH 5/6] preparing to further git conversion --- java_tools/version2header.jar | Bin 3898 -> 4182 bytes .../src/com/rusefi/Version2Header.java | 18 +++++++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/java_tools/version2header.jar b/java_tools/version2header.jar index 48ab55c27c07362efcca920e40aeeb6b28a5ffef..4149701115948cb3dc1474da14ac222e246ec7c6 100644 GIT binary patch literal 4182 zcmeH~c{r4N8^_01V>GtVSjyJ$j$L%(kdVPNhLJtW(HLTeVa9fBiA;_%jHpy-vLAa* zS*8?|Y}u7lp)4Ver7UCjjyihJx!(Hk{pYl9Uf-lBBTIxS z+{RW7Wr|AB@Gn?H~SCT;e=>|4Qiy~rh8ElWnZ_FU!85pE9UBCCW=(?YT}a5CqL28%2~*JinNmg z6p#YQnvqJJ?#OFxRGt%lQR*j=<{`!dGT5H>zdwwdJuQadqyA$B-(L!1APMW?^-T!; z@{c5@O2J9H001UiCH+sKJ(fuFBKRIM$GW*=iE0?U8;KNaj|e2%J-P&2%xEUN~KXcL_xrs~;SR^y2lQAqv9yc^Pnze%&zFE6NNww zzdZc*a)KE#^cP4rRrdo0DlHh#iRl<`TTVUidbGmN5C=nRZ5sWq?;&O}EC zL%c(i_fSU=n7%kqFiv}5MmP8Ho92!`e4R@?9S81ERe`&59#=3J#bYwe*r|>4lpfdg9 z;l(i13EK*)w1(+D<64&JnqjTLx=DH#>SxP5lL4(JWuEJh2}P;yy;f;XUeyJ-w|B^v z0kF!VL9>wSG%Q+2jTWeP)ju{bu|*@G`=x4_@sau4ZaLugAcciTgAm<8UeBy(mi8LN zL3@om29&G4CUOh|U{0(aH9%|J_Zm!+OdsX%pMO|gP0k$Nm$F~_)a(oV+MPk(ru7^$ z%Rg1FYnH>nJr3%#Dk9#g^)SnGDuw#80oit_NT6AYdcOej2#=YtQ8g4I>TR< zV*`OY^!X!?6kkDAK9_y_snz1f0Ho96r60IA=g5<@jxd6ru zul>*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2header/src/com/rusefi/Version2Header.java b/java_tools/version2header/src/com/rusefi/Version2Header.java index 351ffb27d4..625853d0e8 100644 --- a/java_tools/version2header/src/com/rusefi/Version2Header.java +++ b/java_tools/version2header/src/com/rusefi/Version2Header.java @@ -9,22 +9,30 @@ import java.util.Date; public class Version2Header { private static final String NL = "\n";//System.getProperty("line.separator"); - private static final String COMMAND = "svn info"; + private static final String COMMAND = "svn info "; private static final String VERSION_MARKER = "Last Changed Rev: "; private static final String HEADER_TAG = "VCS_VERSION"; 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.exit(-1); } int versionOffsetValue = Integer.parseInt(args[0]); + String url = args.length == 2 ? args[1] : ""; 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); Process simulatorProcess = null; try { - System.out.println("Executing [" + COMMAND + "]"); - simulatorProcess = Runtime.getRuntime().exec(COMMAND); + System.out.println("Executing [" + command + "]"); + simulatorProcess = Runtime.getRuntime().exec(command); BufferedReader stdout = new BufferedReader(new InputStreamReader(simulatorProcess.getInputStream())); @@ -32,7 +40,7 @@ public class Version2Header { int counter = 0; String line; while ((line = stdout.readLine()) != null) { - System.out.println("from " + COMMAND + ": " + line); + System.out.println("from " + command + ": " + line); counter++; if (line.startsWith(VERSION_MARKER)) { From 14b0ebaac7b98deb0e7f6058504f23b22b099968 Mon Sep 17 00:00:00 2001 From: rusefi Date: Tue, 4 Apr 2017 21:21:48 -0400 Subject: [PATCH 6/6] preparing to further git conversion --- firmware/update_version.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firmware/update_version.bat b/firmware/update_version.bat index f3549d2f4b..feefec9651 100644 --- a/firmware/update_version.bat +++ b/firmware/update_version.bat @@ -1,3 +1,3 @@ rem Let's regemerate 'svnversion.h' rem TODO: handle std err - for example, in case svn needs upgrade -java -jar ../java_tools/version2header.jar 10000 \ No newline at end of file +java -jar ../java_tools/version2header.jar 10000 https://github.com/rusefi/rusefi \ No newline at end of file