diff --git a/java_tools/ConfigDefinition.jar b/java_tools/ConfigDefinition.jar index 0b04b6d394..b6a7ba28ec 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/GetConfigValueConsumer.java b/java_tools/configuration_definition/src/main/java/com/rusefi/output/GetConfigValueConsumer.java index cc623c30bc..98b5091051 100644 --- a/java_tools/configuration_definition/src/main/java/com/rusefi/output/GetConfigValueConsumer.java +++ b/java_tools/configuration_definition/src/main/java/com/rusefi/output/GetConfigValueConsumer.java @@ -29,7 +29,9 @@ import static com.rusefi.output.GetOutputValueConsumer.wrapSwitchStatement; public class GetConfigValueConsumer implements ConfigurationConsumer { private static final String CONFIG_ENGINE_CONFIGURATION = "config->engineConfiguration."; private static final String ENGINE_CONFIGURATION = "engineConfiguration."; - static final String FILE_HEADER = "#include \"pch.h\"\n" + + static final String FILE_HEADER = + "// generated by " + GetConfigValueConsumer.class.getSimpleName() + ".java\n" + + "#include \"pch.h\"\n" + "#include \"value_lookup.h\"\n"; private static final String GET_METHOD_HEADER = diff --git a/java_tools/configuration_definition/src/main/java/com/rusefi/output/GetOutputValueConsumer.java b/java_tools/configuration_definition/src/main/java/com/rusefi/output/GetOutputValueConsumer.java index 3f1a6f96af..f3ddfb0142 100644 --- a/java_tools/configuration_definition/src/main/java/com/rusefi/output/GetOutputValueConsumer.java +++ b/java_tools/configuration_definition/src/main/java/com/rusefi/output/GetOutputValueConsumer.java @@ -104,6 +104,7 @@ public class GetOutputValueConsumer implements ConfigurationConsumer { int hash = HashUtil.hash(pair.getUserName()); if (hashConflicts.get(hash).get() == 1) { + switchBody.append("// " + pair.getUserName() + "\n"); switchBody.append(before); switchBody.append("\t\tcase " + hash + ":\n"); switchBody.append("\t" + returnLine); diff --git a/java_tools/configuration_definition/src/test/java/com/rusefi/test/GetConfigValueConsumerTest.java b/java_tools/configuration_definition/src/test/java/com/rusefi/test/GetConfigValueConsumerTest.java index be4e951f1c..94b88333ff 100644 --- a/java_tools/configuration_definition/src/test/java/com/rusefi/test/GetConfigValueConsumerTest.java +++ b/java_tools/configuration_definition/src/test/java/com/rusefi/test/GetConfigValueConsumerTest.java @@ -59,13 +59,16 @@ public class GetConfigValueConsumerTest { "\t}\n" + "\t}\n", getConfigValueConsumer.getSetterBody()); - assertEquals("#include \"pch.h\"\n" + + assertEquals("// generated by GetConfigValueConsumer.java\n" + + "#include \"pch.h\"\n" + "#include \"value_lookup.h\"\n" + "float getConfigValueByName(const char *name) {\n" + "\tint hash = djb2lowerCase(name);\n" + "\tswitch(hash) {\n" + + "// iat.config.tempC_1\n" + "\t\tcase -672272162:\n" + "\t\t\treturn config->iat.config.tempC_1;\n" + + "// iat.adcChannel\n" + "\t\tcase -1237776078:\n" + "\t\t\treturn config->iat.adcChannel;\n" + "\t}\n" + @@ -91,8 +94,10 @@ public class GetConfigValueConsumerTest { assertEquals("float getConfigValueByName(const char *name) {\n" + "\tint hash = djb2lowerCase(name);\n" + "\tswitch(hash) {\n" + + "// iat.config.tempC_1\n" + "\t\tcase -672272162:\n" + "\t\t\treturn config->iat.config.tempC_1;\n" + + "// iat.adcChannel\n" + "\t\tcase -1237776078:\n" + "\t\t\treturn config->iat.adcChannel;\n" + "\t}\n" + @@ -155,37 +160,52 @@ public class GetConfigValueConsumerTest { GetConfigValueConsumer getConfigValueConsumer = new GetConfigValueConsumer(); state.readBufferedReader(test, getConfigValueConsumer); - assertEquals("#include \"pch.h\"\n" + + assertEquals("// generated by GetConfigValueConsumer.java\n" + + "#include \"pch.h\"\n" + "#include \"value_lookup.h\"\n" + "float getConfigValueByName(const char *name) {\n" + "\tint hash = djb2lowerCase(name);\n" + "\tswitch(hash) {\n" + + "// clt.config.tempC_1\n" + "\t\tcase -1832527325:\n" + "\t\t\treturn config->clt.config.tempC_1;\n" + + "// clt.config.map.sensor.highValue\n" + "\t\tcase 1819278123:\n" + "\t\t\treturn config->clt.config.map.sensor.highValue;\n" + + "// clt.config.map.sensor.hwChannel\n" + "\t\tcase 581685574:\n" + "\t\t\treturn config->clt.config.map.sensor.hwChannel;\n" + + "// clt.config.injector.flow\n" + "\t\tcase 382574846:\n" + "\t\t\treturn config->clt.config.injector.flow;\n" + + "// clt.config.bias_resistor\n" + "\t\tcase -653172717:\n" + "\t\t\treturn config->clt.config.bias_resistor;\n" + + "// clt.adcChannel\n" + "\t\tcase -1144186889:\n" + "\t\t\treturn config->clt.adcChannel;\n" + + "// issue_294_31\n" + "\t\tcase -1571463185:\n" + "\t\t\treturn config->issue_294_31;\n" + + "// baseFuel\n" + "\t\tcase 727098956:\n" + "\t\t\treturn config->baseFuel;\n" + + "// afr_type\n" + "\t\tcase -1120008897:\n" + "\t\t\treturn config->afr_type;\n" + + "// speedToRpmRatio\n" + "\t\tcase -685727673:\n" + "\t\t\treturn config->speedToRpmRatio;\n" + + "// afr_typet\n" + "\t\tcase 1694412179:\n" + "\t\t\treturn config->afr_typet;\n" + + "// vehicleSpeedKph\n" + "\t\tcase -1925174695:\n" + "\t\t\treturn config->vehicleSpeedKph;\n" + + "// isForcedInduction\n" + "\t\tcase -617915487:\n" + "\t\t\treturn config->isForcedInduction;\n" + + "// enableFan1WithAc\n" + "\t\tcase -298185774:\n" + "\t\t\treturn config->enableFan1WithAc;\n" + "\t}\n" + 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 329af27cae..87ae93b3ae 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 @@ -150,19 +150,23 @@ public class OutputsTest { outputValueConsumer.conditional = "EFI_BOOST_CONTROL"; state.readBufferedReader(test, (outputValueConsumer)); assertEquals( - "#include \"pch.h\"\n" + + "// generated by GetConfigValueConsumer.java\n" + + "#include \"pch.h\"\n" + "#include \"value_lookup.h\"\n" + "float getOutputValueByName(const char *name) {\n" + "\tint hash = djb2lowerCase(name);\n" + "\tswitch(hash) {\n" + + "// issue_294_31\n" + "#if EFI_BOOST_CONTROL\n" + "\t\tcase -1571463185:\n" + "\t\t\treturn engine->outputChannels.issue_294_31;\n" + "#endif\n" + + "// enableFan1WithAc\n" + "#if EFI_BOOST_CONTROL\n" + "\t\tcase -298185774:\n" + "\t\t\treturn engine->outputChannels.enableFan1WithAc;\n" + "#endif\n" + + "// hwChannel\n" + "#if EFI_BOOST_CONTROL\n" + "\t\tcase -709106787:\n" + "\t\t\treturn engine->outputChannels.hwChannel;\n" +