diff --git a/firmware/controllers/algo/auto_generated_enums.cpp b/firmware/controllers/algo/auto_generated_enums.cpp
index 8bd9252f04..be457c3770 100644
--- a/firmware/controllers/algo/auto_generated_enums.cpp
+++ b/firmware/controllers/algo/auto_generated_enums.cpp
@@ -1,6 +1,6 @@
// auto-generated from.\controllers/algo/rusefi_enums.h
// by enum2string.jar tool
-// on Thu Nov 22 18:48:26 EST 2018
+// on Thu Nov 22 20:05:41 EST 2018
// see also gen_config_and_enums.bat
@@ -950,6 +950,8 @@ const char *getPidAutoTune_Peak(PidAutoTune_Peak value){
switch(value) {
case MAXIMUM:
return "MAXIMUM";
+case MINIMUM:
+ return "MINIMUM";
case NOT_A_PEAK:
return "NOT_A_PEAK";
}
diff --git a/java_tools/enum2string.jar b/java_tools/enum2string.jar
index 3fd5a3dede..c9c79f78d9 100644
Binary files a/java_tools/enum2string.jar and b/java_tools/enum2string.jar differ
diff --git a/java_tools/enum_to_string/.idea/libraries/junit.xml b/java_tools/enum_to_string/.idea/libraries/junit.xml
new file mode 100644
index 0000000000..11d7a6d750
--- /dev/null
+++ b/java_tools/enum_to_string/.idea/libraries/junit.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/java_tools/enum_to_string/build.xml b/java_tools/enum_to_string/build.xml
index 36abf41433..df8bac5b35 100644
--- a/java_tools/enum_to_string/build.xml
+++ b/java_tools/enum_to_string/build.xml
@@ -6,7 +6,7 @@
-
+
diff --git a/java_tools/enum_to_string/enum_to_string.iml b/java_tools/enum_to_string/enum_to_string.iml
index d5c0743275..2d6846244d 100644
--- a/java_tools/enum_to_string/enum_to_string.iml
+++ b/java_tools/enum_to_string/enum_to_string.iml
@@ -7,6 +7,6 @@
+
-
-
+
\ No newline at end of file
diff --git a/java_tools/enum_to_string/src/com/rusefi/EnumToString.java b/java_tools/enum_to_string/src/com/rusefi/EnumToString.java
index d2ea69c12d..c43ea2b89f 100644
--- a/java_tools/enum_to_string/src/com/rusefi/EnumToString.java
+++ b/java_tools/enum_to_string/src/com/rusefi/EnumToString.java
@@ -72,7 +72,7 @@ public class EnumToString {
reader = new BufferedReader(new FileReader(inFileName));
String line;
while ((line = reader.readLine()) != null) {
- line = line.replaceAll("\\s+", "");
+ line = removeSpaces(line);
if (line.startsWith("typedefenum{")) {
System.out.println("Entering enum");
@@ -87,7 +87,7 @@ public class EnumToString {
} else {
line = line.replaceAll("//.+", "");
if (isInsideEnum) {
- if (line.matches("[a-zA-Z_$][a-zA-Z\\d_$]*[=a-zA-Z\\d_*]*,?")) {
+ if (isKeyValueLine(line)) {
line = line.replace(",", "");
int index = line.indexOf('=');
if (index != -1)
@@ -100,6 +100,14 @@ public class EnumToString {
}
}
+ static String removeSpaces(String line) {
+ return line.replaceAll("\\s+", "");
+ }
+
+ static boolean isKeyValueLine(String line) {
+ return removeSpaces(line).matches("[a-zA-Z_$][a-zA-Z\\d_$]*[=-a-zA-Z\\d_*]*,?");
+ }
+
private static String makeCode(String enumName) {
StringBuilder sb = new StringBuilder();
sb.append(getMethodSignature(enumName) + "{\r\n");
diff --git a/java_tools/enum_to_string/src/com/rusefi/EnumToStringTest.java b/java_tools/enum_to_string/src/com/rusefi/EnumToStringTest.java
new file mode 100644
index 0000000000..d225258089
--- /dev/null
+++ b/java_tools/enum_to_string/src/com/rusefi/EnumToStringTest.java
@@ -0,0 +1,15 @@
+package com.rusefi;
+
+import org.junit.Test;
+
+import static com.rusefi.EnumToString.isKeyValueLine;
+import static org.junit.Assert.assertTrue;
+
+public class EnumToStringTest {
+ @Test
+ public void testParseLine() {
+ assertTrue(isKeyValueLine("MIN"));
+ assertTrue(isKeyValueLine("MIN = 2,"));
+ assertTrue(isKeyValueLine("MIN = -3,"));
+ }
+}