diff --git a/java_tools/ConfigDefinition.jar b/java_tools/ConfigDefinition.jar index 5e4e434a22..842de0bdcf 100644 Binary files a/java_tools/ConfigDefinition.jar and b/java_tools/ConfigDefinition.jar differ diff --git a/java_tools/configuration_definition/src/main/java/com/rusefi/output/DataLogConsumer.java b/java_tools/configuration_definition/src/main/java/com/rusefi/output/DataLogConsumer.java index 2036d41908..a43c158463 100644 --- a/java_tools/configuration_definition/src/main/java/com/rusefi/output/DataLogConsumer.java +++ b/java_tools/configuration_definition/src/main/java/com/rusefi/output/DataLogConsumer.java @@ -19,6 +19,9 @@ import static org.abego.treelayout.internal.util.java.lang.string.StringUtil.quo * @see SdCardFieldsConsumer */ public class DataLogConsumer implements ConfigurationConsumer { + // https://github.com/rusefi/web_backend/issues/166 + private static final int MSQ_LENGTH_LIMIT = 34; + public static final String UNUSED = ConfigStructure.UNUSED_ANYTHING_PREFIX; private final String fileName; private final StringBuilder tsWriter = new StringBuilder(); @@ -91,6 +94,8 @@ public class DataLogConsumer implements ConfigurationConsumer { */ comment = prefix + unquote(configField.getName()); } + if (comment.length() > MSQ_LENGTH_LIMIT) + throw new IllegalStateException("[" + comment + "] is too long for log files at " + comment.length()); if (comment.charAt(0) != '"') comment = quote(comment); diff --git a/java_tools/configuration_definition/src/main/java/com/rusefi/output/TsOutput.java b/java_tools/configuration_definition/src/main/java/com/rusefi/output/TsOutput.java index aab3e37c7b..e138158c8a 100644 --- a/java_tools/configuration_definition/src/main/java/com/rusefi/output/TsOutput.java +++ b/java_tools/configuration_definition/src/main/java/com/rusefi/output/TsOutput.java @@ -17,8 +17,6 @@ import static com.rusefi.output.JavaSensorsConsumer.quote; */ @SuppressWarnings({"StringConcatenationInsideStringBufferAppend", "DanglingJavadoc"}) public class TsOutput { - // https://github.com/rusefi/web_backend/issues/166 - private static final int MSQ_LENGTH_LIMIT = 34; private final StringBuilder settingContextHelp = new StringBuilder(); private final boolean isConstantsSection; private final StringBuilder tsHeader = new StringBuilder(); @@ -71,13 +69,6 @@ public class TsOutput { if (configField.getComment() != null && configField.getComment().trim().length() > 0 && cs == null) { String commentContent = configField.getCommentTemplated(); commentContent = ConfigField.unquote(commentContent); - int newLineIndex = commentContent.indexOf("\\n"); - if (newLineIndex != -1) { - // we might have detailed long comment for header javadoc but need a short field name for logs/rusEFI online - commentContent = commentContent.substring(0, newLineIndex); - } - if (!isConstantsSection && commentContent.length() > MSQ_LENGTH_LIMIT) - throw new IllegalStateException("[" + commentContent + "] is too long for rusEFI online at " + commentContent.length()); settingContextHelp.append("\t" + nameWithPrefix + " = " + quote(commentContent) + EOL); } diff --git a/java_tools/configuration_definition/src/test/java/com/rusefi/test/OutputsTest.java b/java_tools/configuration_definition/src/test/java/com/rusefi/test/OutputsTest.java index 2984382207..ac68bc9ccb 100644 --- a/java_tools/configuration_definition/src/test/java/com/rusefi/test/OutputsTest.java +++ b/java_tools/configuration_definition/src/test/java/com/rusefi/test/OutputsTest.java @@ -191,7 +191,7 @@ public class OutputsTest { } @Test - public void testLongIterate() { + public void testLongTooltipsIterate() { ReaderState state = new ReaderState(); String test = "struct total\n" + "\tint[3 iterate] triggerSimulatorPins;Each rusEFI piece can provide synthetic trigger signal for external ECU. Sometimes these wires are routed back into trigger inputs of the same rusEFI board.\\nSee also directSelfStimulation which is different.\n" + @@ -199,9 +199,9 @@ public class OutputsTest { TestTSProjectConsumer tsProjectConsumer = new TestTSProjectConsumer("", state); state.readBufferedReader(test, tsProjectConsumer); assertEquals( - "\ttriggerSimulatorPins1 = \"Each rusEFI piece can provide synthetic trigger signal for external ECU. Sometimes these wires are routed back into trigger inputs of the same rusEFI board.\"\n" + - "\ttriggerSimulatorPins2 = \"Each rusEFI piece can provide synthetic trigger signal for external ECU. Sometimes these wires are routed back into trigger inputs of the same rusEFI board.\"\n" + - "\ttriggerSimulatorPins3 = \"Each rusEFI piece can provide synthetic trigger signal for external ECU. Sometimes these wires are routed back into trigger inputs of the same rusEFI board.\"\n", tsProjectConsumer.getSettingContextHelpForUnitTest()); +"\ttriggerSimulatorPins1 = \"Each rusEFI piece can provide synthetic trigger signal for external ECU. Sometimes these wires are routed back into trigger inputs of the same rusEFI board.\\nSee also directSelfStimulation which is different. 1\"\n" + + "\ttriggerSimulatorPins2 = \"Each rusEFI piece can provide synthetic trigger signal for external ECU. Sometimes these wires are routed back into trigger inputs of the same rusEFI board.\\nSee also directSelfStimulation which is different. 2\"\n" + + "\ttriggerSimulatorPins3 = \"Each rusEFI piece can provide synthetic trigger signal for external ECU. Sometimes these wires are routed back into trigger inputs of the same rusEFI board.\\nSee also directSelfStimulation which is different. 3\"\n", tsProjectConsumer.getSettingContextHelpForUnitTest()); } @Test(expected = IllegalStateException.class)