diff --git a/java_tools/ConfigDefinition.jar b/java_tools/ConfigDefinition.jar index 387cea0f97..7fbb9d69a0 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 88b27495d3..8f1e41ed3c 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 @@ -42,7 +42,14 @@ public class GetConfigValueConsumer implements ConfigurationConsumer { ; static final String GET_METHOD_FOOTER = "\treturn EFI_ERROR_CODE;\n" + "}\n"; - private static final String SET_METHOD_HEADER = "void setConfigValueByName(const char *name, float value) {\n"; + private static final String SET_METHOD_HEADER = "void setConfigValueByName(const char *name, float value) {\n" + + "\t{\n" + + "\t\tplain_get_float_s * known = findFloat(name);\n" + + "\t\tif (known != nullptr) {\n" + + "\t\t\t*(float*)hackEngineConfigurationPointer(known->value) = value;\n" + + "\t\t}\n" + + "\t}\n" + + "\n"; private static final String SET_METHOD_FOOTER = "}\n"; private final StringBuilder getterBody = new StringBuilder(); private final StringBuilder setterBody = new StringBuilder(); @@ -97,9 +104,6 @@ public class GetConfigValueConsumer implements ConfigurationConsumer { if (TypesHelper.isFloat(cf.getType())) { allFloatAddresses.append("\t{" + quote(userName) + ", &engineConfiguration->" + userName + "},\n"); - setterBody.append(getCompareName(userName)); - String str = getAssignment(cf, javaName, ""); - setterBody.append(str); } else { getterBody.append(getCompareName(userName)); getterBody.append("\t\treturn " + javaName + cf.getName() + ";\n"); 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 895cf0a455..ecb07e6655 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 @@ -58,12 +58,7 @@ public class GetConfigValueConsumerTest { GetConfigValueConsumer getConfigValueConsumer = new GetConfigValueConsumer(null); state.readBufferedReader(test, getConfigValueConsumer); - assertEquals("\tif (strEqualCaseInsensitive(name, \"iat.config.tempC_1\"))\n" + - "\t{\n" + - "\t\tconfig->iat.config.tempC_1 = value;\n" + - "\t\treturn;\n" + - "\t}\n" + - "\tif (strEqualCaseInsensitive(name, \"iat.adcChannel\"))\n" + + assertEquals("\tif (strEqualCaseInsensitive(name, \"iat.adcChannel\"))\n" + "\t{\n" + "\t\tconfig->iat.adcChannel = (int)value;\n" + "\t\treturn;\n" +