diff --git a/java_console/inifile/inifile.iml b/java_console/inifile/inifile.iml
index b36efa57ff..82bca70afb 100644
--- a/java_console/inifile/inifile.iml
+++ b/java_console/inifile/inifile.iml
@@ -10,5 +10,6 @@
+
\ No newline at end of file
diff --git a/java_tools/configuration_definition/.idea/libraries/annotations.xml b/java_tools/configuration_definition/.idea/libraries/annotations.xml
new file mode 100644
index 0000000000..8554e96464
--- /dev/null
+++ b/java_tools/configuration_definition/.idea/libraries/annotations.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/java_tools/configuration_definition/.idea/modules.xml b/java_tools/configuration_definition/.idea/modules.xml
index 2fcba563b6..f6f0ab6e91 100644
--- a/java_tools/configuration_definition/.idea/modules.xml
+++ b/java_tools/configuration_definition/.idea/modules.xml
@@ -2,9 +2,12 @@
+
+
+
\ No newline at end of file
diff --git a/java_tools/configuration_definition/configuration_definition.iml b/java_tools/configuration_definition/configuration_definition.iml
index 50563a96f6..68712908ed 100644
--- a/java_tools/configuration_definition/configuration_definition.iml
+++ b/java_tools/configuration_definition/configuration_definition.iml
@@ -8,5 +8,7 @@
+
+
\ No newline at end of file
diff --git a/java_tools/configuration_definition/src/com/rusefi/output/TSProjectConsumer.java b/java_tools/configuration_definition/src/com/rusefi/output/TSProjectConsumer.java
index 958f78e0d9..3115265a83 100644
--- a/java_tools/configuration_definition/src/com/rusefi/output/TSProjectConsumer.java
+++ b/java_tools/configuration_definition/src/com/rusefi/output/TSProjectConsumer.java
@@ -1,5 +1,6 @@
package com.rusefi.output;
+import com.opensr5.ini.RawIniFile;
import com.rusefi.*;
import com.rusefi.util.LazyFile;
import com.rusefi.util.Output;
@@ -60,6 +61,9 @@ public class TSProjectConsumer implements ConfigurationConsumer {
if (configField.getState().tsCustomLine.containsKey(configField.getType())) {
String bits = configField.getState().tsCustomLine.get(configField.getType());
+
+ RawIniFile.Line line = new RawIniFile.Line(bits);
+
tsHeader.write("\t" + addTabsUpTo(nameWithPrefix, LENGTH));
int size = configField.getState().tsCustomSize.get(configField.getType());
// tsHeader.headerWrite("\t" + size + ",");
diff --git a/java_tools/configuration_definition/src/com/rusefi/test/ConfigFieldParserTest.java b/java_tools/configuration_definition/src/com/rusefi/test/ConfigFieldParserTest.java
index bd0c939b76..2b0566366f 100644
--- a/java_tools/configuration_definition/src/com/rusefi/test/ConfigFieldParserTest.java
+++ b/java_tools/configuration_definition/src/com/rusefi/test/ConfigFieldParserTest.java
@@ -4,13 +4,13 @@ import com.rusefi.ConfigField;
import com.rusefi.ReaderState;
import com.rusefi.TypesHelper;
import com.rusefi.VariableRegistry;
+import com.rusefi.output.ConfigurationConsumer;
import com.rusefi.output.FsioSettingsConsumer;
import com.rusefi.output.JavaFieldsConsumer;
+import com.rusefi.output.TSProjectConsumer;
import org.junit.Test;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.StringReader;
+import java.io.*;
import java.util.Arrays;
import java.util.Collections;
@@ -34,6 +34,23 @@ public class ConfigFieldParserTest {
}
}
+ @Test
+ public void testCustomEnum() throws IOException {
+ String test = "struct pid_s\n" +
+ "#define ego_sensor_e_enum \"BPSX\", \"Innovate\", \"14Point7\"\n" +
+ "custom ego_sensor_e 4 bits, S32, @OFFSET@, [0:2], @@ego_sensor_e_enum@@\n" +
+ "ego_sensor_e afr_type;\n" +
+ "end_struct\n";
+ ReaderState state = new ReaderState();
+ BufferedReader reader = new BufferedReader(new StringReader(test));
+
+ CharArrayWriter writer = new CharArrayWriter();
+ TestTSProjectConsumer javaFieldsConsumer = new TestTSProjectConsumer(writer, "", state);
+ state.readBufferedReader(reader, Arrays.asList(javaFieldsConsumer));
+ assertEquals("\tafr_type\t\t\t\t\t = bits, S32, 0, [0:2], \"BPSX\", \"Innovate\", \"14Point7\"\n" +
+ "; total TS size = 4\n", new String(writer.toCharArray()));
+ }
+
@Test
public void alignFourByteTypes() throws IOException {
// we expect padding before each 4 byte field
diff --git a/java_tools/configuration_definition/src/com/rusefi/test/TestTSProjectConsumer.java b/java_tools/configuration_definition/src/com/rusefi/test/TestTSProjectConsumer.java
new file mode 100644
index 0000000000..40b97cb9da
--- /dev/null
+++ b/java_tools/configuration_definition/src/com/rusefi/test/TestTSProjectConsumer.java
@@ -0,0 +1,16 @@
+package com.rusefi.test;
+
+import com.rusefi.ReaderState;
+import com.rusefi.output.TSProjectConsumer;
+
+import java.io.CharArrayWriter;
+
+public class TestTSProjectConsumer extends TSProjectConsumer {
+ public TestTSProjectConsumer(CharArrayWriter writer, String s, ReaderState state) {
+ super(writer, s, state);
+ }
+
+ @Override
+ public void endFile() {
+ }
+}