From 8f627887b73b2c7b03999e3e87c24f9cd773a0ab Mon Sep 17 00:00:00 2001 From: rusefi Date: Sat, 10 Jun 2023 20:12:45 -0400 Subject: [PATCH] only:minor header fix --- .../com/rusefi/output/GetConfigValueConsumer.java | 14 +++++++------- .../com/rusefi/output/GetOutputValueConsumer.java | 4 +--- 2 files changed, 8 insertions(+), 10 deletions(-) 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 98b5091051..8a0bb3fd9e 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 @@ -1,10 +1,8 @@ package com.rusefi.output; import com.rusefi.ConfigField; -import com.rusefi.ConfigFieldImpl; import com.rusefi.ReaderState; import com.rusefi.TypesHelper; -import com.rusefi.core.Tuple; import com.rusefi.output.variables.VariableRecord; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -29,10 +27,12 @@ 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 = - "// generated by " + GetConfigValueConsumer.class.getSimpleName() + ".java\n" + - "#include \"pch.h\"\n" + - "#include \"value_lookup.h\"\n"; + + public static String getHeader(Class clazz) { + return "// generated by " + clazz.getSimpleName() + ".java\n" + + "#include \"pch.h\"\n" + + "#include \"value_lookup.h\"\n"; + } private static final String GET_METHOD_HEADER = "float getConfigValueByName(const char *name) {\n"; @@ -118,7 +118,7 @@ public class GetConfigValueConsumer implements ConfigurationConsumer { } public String getHeaderAndGetter() { - return FILE_HEADER + + return GetConfigValueConsumer.getHeader(getClass()) + getCompleteGetterBody(); } 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 f3ddfb0142..e0a420787e 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 @@ -3,7 +3,6 @@ package com.rusefi.output; import com.rusefi.ConfigField; import com.rusefi.ReaderState; import com.rusefi.TypesHelper; -import com.rusefi.core.Pair; import com.rusefi.output.variables.VariableRecord; import org.jetbrains.annotations.NotNull; @@ -15,7 +14,6 @@ import java.util.concurrent.atomic.AtomicInteger; import static com.rusefi.output.ConfigStructureImpl.ALIGNMENT_FILL_AT; import static com.rusefi.output.DataLogConsumer.UNUSED; -import static com.rusefi.output.GetConfigValueConsumer.FILE_HEADER; import static com.rusefi.output.GetConfigValueConsumer.getCompareName; /** @@ -75,7 +73,7 @@ public class GetOutputValueConsumer implements ConfigurationConsumer { String fullSwitch = wrapSwitchStatement(switchBody); - return FILE_HEADER + + return GetConfigValueConsumer.getHeader(getClass()) + "float getOutputValueByName(const char *name) {\n" + fullSwitch + getterBody + GetConfigValueConsumer.GET_METHOD_FOOTER;