From 448d99a2c802b45cffcbfe146a2e2fe9aa9776f2 Mon Sep 17 00:00:00 2001 From: rusefi Date: Tue, 10 Sep 2019 23:49:21 -0400 Subject: [PATCH] Delayed A/C compressor switch #922 --- firmware/controllers/core/fsio_impl.cpp | 1 + .../generated/fsio_enums_generated.def | 44 +++++++------- .../controllers/generated/fsio_getters.def | 45 ++++++++++++++ firmware/gen_config.bat | 1 + .../configuration_definition/.gitignore | 1 + .../src/com/rusefi/ConfigDefinition.java | 8 ++- .../src/com/rusefi/ConfigField.java | 23 +++++++- .../src/com/rusefi/ConfigStructure.java | 2 +- .../src/com/rusefi/ReaderState.java | 4 +- .../output/FileFsioSettingsConsumer.java | 10 +++- .../rusefi/output/FsioSettingsConsumer.java | 24 +++++--- .../rusefi/test/ConfigFieldParserTest.java | 58 ++++++++++++------- 12 files changed, 162 insertions(+), 59 deletions(-) create mode 100644 firmware/controllers/generated/fsio_getters.def diff --git a/firmware/controllers/core/fsio_impl.cpp b/firmware/controllers/core/fsio_impl.cpp index d04df4e821..1b91858413 100644 --- a/firmware/controllers/core/fsio_impl.cpp +++ b/firmware/controllers/core/fsio_impl.cpp @@ -149,6 +149,7 @@ float getEngineValue(le_action_e action DECLARE_ENGINE_PARAMETER_SUFFIX) { return engine->isInShutdownMode(); case LE_METHOD_VBATT: return getVBatt(PASS_ENGINE_PARAMETER_SIGNATURE); +#include "fsio_getters.def" default: warning(CUSTOM_FSIO_UNEXPECTED, "FSIO unexpected %d", action); return NAN; diff --git a/firmware/controllers/generated/fsio_enums_generated.def b/firmware/controllers/generated/fsio_enums_generated.def index 84edd54920..b3d0bce3cd 100644 --- a/firmware/controllers/generated/fsio_enums_generated.def +++ b/firmware/controllers/generated/fsio_enums_generated.def @@ -1,24 +1,24 @@ -// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Tue Sep 10 22:45:42 EDT 2019 +// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Tue Sep 10 23:14:54 EDT 2019 // by class com.rusefi.output.FileFsioSettingsConsumer -FSIO_SETTING_FANONTEMPERATURE = 1000, -FSIO_SETTING_FANOFFTEMPERATURE = 1001, -FSIO_SETTING_ALTERNATORCONTROL_OFFSET = 1002, -FSIO_SETTING_ALTERNATORCONTROL_MINVALUE = 1003, -FSIO_SETTING_ETB_OFFSET = 1004, -FSIO_SETTING_ETB_MINVALUE = 1005, -FSIO_SETTING_IDLERPMPID_OFFSET = 1006, -FSIO_SETTING_IDLERPMPID_MINVALUE = 1007, -FSIO_SETTING_STARTUPFUELPUMPDURATION = 1008, -FSIO_SETTING_FUELCLOSEDLOOPPID_OFFSET = 1009, -FSIO_SETTING_FUELCLOSEDLOOPPID_MINVALUE = 1010, -FSIO_SETTING_AUXPID1_OFFSET = 1011, -FSIO_SETTING_AUXPID1_MINVALUE = 1012, -FSIO_SETTING_AUXPID2_OFFSET = 1013, -FSIO_SETTING_AUXPID2_MINVALUE = 1014, -FSIO_SETTING_AUXPID3_OFFSET = 1015, -FSIO_SETTING_AUXPID3_MINVALUE = 1016, -FSIO_SETTING_AUXPID4_OFFSET = 1017, -FSIO_SETTING_AUXPID4_MINVALUE = 1018, -FSIO_SETTING_IDLETIMINGPID_OFFSET = 1019, -FSIO_SETTING_IDLETIMINGPID_MINVALUE = 1020, + FSIO_SETTING_FANONTEMPERATURE = 1000, + FSIO_SETTING_FANOFFTEMPERATURE = 1001, + FSIO_SETTING_ALTERNATORCONTROL_OFFSET = 1002, + FSIO_SETTING_ALTERNATORCONTROL_MINVALUE = 1003, + FSIO_SETTING_ETB_OFFSET = 1004, + FSIO_SETTING_ETB_MINVALUE = 1005, + FSIO_SETTING_IDLERPMPID_OFFSET = 1006, + FSIO_SETTING_IDLERPMPID_MINVALUE = 1007, + FSIO_SETTING_STARTUPFUELPUMPDURATION = 1008, + FSIO_SETTING_FUELCLOSEDLOOPPID_OFFSET = 1009, + FSIO_SETTING_FUELCLOSEDLOOPPID_MINVALUE = 1010, + FSIO_SETTING_AUXPID1_OFFSET = 1011, + FSIO_SETTING_AUXPID1_MINVALUE = 1012, + FSIO_SETTING_AUXPID2_OFFSET = 1013, + FSIO_SETTING_AUXPID2_MINVALUE = 1014, + FSIO_SETTING_AUXPID3_OFFSET = 1015, + FSIO_SETTING_AUXPID3_MINVALUE = 1016, + FSIO_SETTING_AUXPID4_OFFSET = 1017, + FSIO_SETTING_AUXPID4_MINVALUE = 1018, + FSIO_SETTING_IDLETIMINGPID_OFFSET = 1019, + FSIO_SETTING_IDLETIMINGPID_MINVALUE = 1020, diff --git a/firmware/controllers/generated/fsio_getters.def b/firmware/controllers/generated/fsio_getters.def new file mode 100644 index 0000000000..c84bcb41ed --- /dev/null +++ b/firmware/controllers/generated/fsio_getters.def @@ -0,0 +1,45 @@ +// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Tue Sep 10 23:40:30 EDT 2019 + +// by class com.rusefi.output.FileFsioSettingsConsumer + case FSIO_SETTING_FANONTEMPERATURE: + return engineConfiguration->fanOnTemperature; + case FSIO_SETTING_FANOFFTEMPERATURE: + return engineConfiguration->fanOffTemperature; + case FSIO_SETTING_ALTERNATORCONTROL_OFFSET: + return engineConfiguration->alternatorControl.offset; + case FSIO_SETTING_ALTERNATORCONTROL_MINVALUE: + return engineConfiguration->alternatorControl.minValue; + case FSIO_SETTING_ETB_OFFSET: + return engineConfiguration->etb.offset; + case FSIO_SETTING_ETB_MINVALUE: + return engineConfiguration->etb.minValue; + case FSIO_SETTING_IDLERPMPID_OFFSET: + return engineConfiguration->idleRpmPid.offset; + case FSIO_SETTING_IDLERPMPID_MINVALUE: + return engineConfiguration->idleRpmPid.minValue; + case FSIO_SETTING_STARTUPFUELPUMPDURATION: + return engineConfiguration->startUpFuelPumpDuration; + case FSIO_SETTING_FUELCLOSEDLOOPPID_OFFSET: + return engineConfiguration->fuelClosedLoopPid.offset; + case FSIO_SETTING_FUELCLOSEDLOOPPID_MINVALUE: + return engineConfiguration->fuelClosedLoopPid.minValue; + case FSIO_SETTING_AUXPID1_OFFSET: + return engineConfiguration->auxPid[0].offset; + case FSIO_SETTING_AUXPID1_MINVALUE: + return engineConfiguration->auxPid[0].minValue; + case FSIO_SETTING_AUXPID2_OFFSET: + return engineConfiguration->auxPid[1].offset; + case FSIO_SETTING_AUXPID2_MINVALUE: + return engineConfiguration->auxPid[1].minValue; + case FSIO_SETTING_AUXPID3_OFFSET: + return engineConfiguration->auxPid[2].offset; + case FSIO_SETTING_AUXPID3_MINVALUE: + return engineConfiguration->auxPid[2].minValue; + case FSIO_SETTING_AUXPID4_OFFSET: + return engineConfiguration->auxPid[3].offset; + case FSIO_SETTING_AUXPID4_MINVALUE: + return engineConfiguration->auxPid[3].minValue; + case FSIO_SETTING_IDLETIMINGPID_OFFSET: + return engineConfiguration->idleTimingPid.offset; + case FSIO_SETTING_IDLETIMINGPID_MINVALUE: + return engineConfiguration->idleTimingPid.minValue; diff --git a/firmware/gen_config.bat b/firmware/gen_config.bat index 54b3856818..d7980a60b3 100644 --- a/firmware/gen_config.bat +++ b/firmware/gen_config.bat @@ -21,6 +21,7 @@ java -DSystemOut.name=gen_config ^ -c_defines controllers\generated\rusefi_generated.h ^ -c_destination controllers\generated\engine_configuration_generated_structures.h ^ -c_fsio_constants controllers\generated\fsio_enums_generated.def ^ + -c_fsio_getters controllers\generated\fsio_getters.def ^ -java_destination ../java_console/models/src/com/rusefi/config/generated/Fields.java ^ -romraider_destination ../java_console/rusefi.xml ^ -skip build/config.gen diff --git a/java_tools/configuration_definition/.gitignore b/java_tools/configuration_definition/.gitignore index 89f9ac04aa..2d0e807897 100644 --- a/java_tools/configuration_definition/.gitignore +++ b/java_tools/configuration_definition/.gitignore @@ -1 +1,2 @@ out/ +rusefi_tool.log diff --git a/java_tools/configuration_definition/src/com/rusefi/ConfigDefinition.java b/java_tools/configuration_definition/src/com/rusefi/ConfigDefinition.java index 032f67ce8c..c66966d079 100644 --- a/java_tools/configuration_definition/src/com/rusefi/ConfigDefinition.java +++ b/java_tools/configuration_definition/src/com/rusefi/ConfigDefinition.java @@ -29,6 +29,7 @@ public class ConfigDefinition { public static final String KEY_TS_DESTINATION = "-ts_destination"; private static final String KEY_C_DESTINATION = "-c_destination"; private static final String KEY_C_FSIO_CONSTANTS = "-c_fsio_constants"; + private static final String KEY_C_FSIO_GETTERS = "-c_fsio_getters"; private static final String KEY_C_DEFINES = "-c_defines"; private static final String KEY_WITH_C_DEFINES = "-with_c_defines"; private static final String KEY_JAVA_DESTINATION = "-java_destination"; @@ -66,6 +67,7 @@ public class ConfigDefinition { String destCHeaderFileName = null; String destCDefinesFileName = null; String destCFsioConstantsFileName = null; + String destCFsioGettersFileName = null; String javaDestinationFileName = null; String romRaiderDestination = null; List prependFiles = new ArrayList<>(); @@ -81,6 +83,8 @@ public class ConfigDefinition { tsPath = args[i + 1]; } else if (key.equals(KEY_C_DESTINATION)) { destCHeaderFileName = args[i + 1]; + } else if (key.equals(KEY_C_FSIO_GETTERS)) { + destCFsioGettersFileName = args[i + 1]; } else if (key.equals(KEY_C_FSIO_CONSTANTS)) { destCFsioConstantsFileName = args[i + 1]; } else if (key.equals(KEY_ZERO_INIT)) { @@ -136,8 +140,8 @@ public class ConfigDefinition { destinations.add(new FileJavaFieldsConsumer(state, javaDestinationFileName)); } - if (destCFsioConstantsFileName != null) { - destinations.add(new FileFsioSettingsConsumer(state, destCFsioConstantsFileName)); + if (destCFsioConstantsFileName != null || destCFsioGettersFileName != null) { + destinations.add(new FileFsioSettingsConsumer(state, destCFsioConstantsFileName, destCFsioGettersFileName)); } if (destinations.isEmpty()) diff --git a/java_tools/configuration_definition/src/com/rusefi/ConfigField.java b/java_tools/configuration_definition/src/com/rusefi/ConfigField.java index 1aa1029d48..cc3a1787c4 100644 --- a/java_tools/configuration_definition/src/com/rusefi/ConfigField.java +++ b/java_tools/configuration_definition/src/com/rusefi/ConfigField.java @@ -13,7 +13,7 @@ import java.util.regex.Pattern; * 1/15/15 */ public class ConfigField { - public static final ConfigField VOID = new ConfigField(null, "", null, null, null, 1, null, false, false); + public static final ConfigField VOID = new ConfigField(null, "", null, null, null, 1, null, false, false, null, -1); private static final String typePattern = "([\\w\\d_]+)(\\[([\\w\\d]+)(\\s([\\w\\d]+))?\\])?"; private static final String namePattern = "[[\\w\\d\\s_]]+"; @@ -36,6 +36,8 @@ public class ConfigField { private final boolean isIterate; private final ReaderState state; private boolean fsioVisible; + private final String individualName; + private final int indexWithinArray; public ConfigField(ReaderState state, String name, @@ -45,8 +47,10 @@ public class ConfigField { int arraySize, String tsInfo, boolean isIterate, - boolean fsioVisible) { + boolean fsioVisible, String individualName, int indexWithinArray) { this.fsioVisible = fsioVisible; + this.individualName = individualName; + this.indexWithinArray = indexWithinArray; Objects.requireNonNull(name, comment + " " + type); assertNoWhitespaces(name); this.name = name; @@ -65,6 +69,19 @@ public class ConfigField { this.isIterate = isIterate; } + public String getCFieldName() { + return getIndividualName() == null ? getName() : getIndividualName() + "[" + + (getIndexWithinArray() - 1) + "]"; + } + + public String getIndividualName() { + return individualName; + } + + public int getIndexWithinArray() { + return indexWithinArray; + } + public boolean isBit() { return BOOLEAN_T.equalsIgnoreCase(type); } @@ -110,7 +127,7 @@ public class ConfigField { ConfigField field = new ConfigField(state, name, comment, arraySizeAsText, type, arraySize, - tsInfo, isIterate, isFsioVisible); + tsInfo, isIterate, isFsioVisible, null, -1); SystemOut.println("type " + type); SystemOut.println("name " + name); SystemOut.println("comment " + comment); diff --git a/java_tools/configuration_definition/src/com/rusefi/ConfigStructure.java b/java_tools/configuration_definition/src/com/rusefi/ConfigStructure.java index e515b05396..fd5e192f2f 100644 --- a/java_tools/configuration_definition/src/com/rusefi/ConfigStructure.java +++ b/java_tools/configuration_definition/src/com/rusefi/ConfigStructure.java @@ -59,7 +59,7 @@ public class ConfigStructure { if (fillSize != 0) { ConfigField fill = new ConfigField(state, "alignmentFill", "need 4 byte alignment", "" + fillSize, - TypesHelper.UINT8_T, fillSize, null, false, false); + TypesHelper.UINT8_T, fillSize, null, false, false, null, -1); addBoth(fill); } totalSize += fillSize; diff --git a/java_tools/configuration_definition/src/com/rusefi/ReaderState.java b/java_tools/configuration_definition/src/com/rusefi/ReaderState.java index 11d936f519..3062add732 100644 --- a/java_tools/configuration_definition/src/com/rusefi/ReaderState.java +++ b/java_tools/configuration_definition/src/com/rusefi/ReaderState.java @@ -45,7 +45,7 @@ public class ReaderState { comment = line.substring(index + 1); } - ConfigField bitField = new ConfigField(state, bitName, comment, null, BOOLEAN_T, 0, null, false, false); + ConfigField bitField = new ConfigField(state, bitName, comment, null, BOOLEAN_T, 0, null, false, false, null, -1); state.stack.peek().addBoth(bitField); } @@ -189,7 +189,7 @@ public class ReaderState { structure.addC(cf); for (int i = 1; i <= cf.getArraySize(); i++) { ConfigField element = new ConfigField(state, cf.getName() + i, cf.getComment(), null, - cf.getType(), 1, cf.getTsInfo(), false, false); + cf.getType(), 1, cf.getTsInfo(), false, false, cf.getName(), i); structure.addTs(element); } } else { diff --git a/java_tools/configuration_definition/src/com/rusefi/output/FileFsioSettingsConsumer.java b/java_tools/configuration_definition/src/com/rusefi/output/FileFsioSettingsConsumer.java index 2b48e65153..5c46c74701 100644 --- a/java_tools/configuration_definition/src/com/rusefi/output/FileFsioSettingsConsumer.java +++ b/java_tools/configuration_definition/src/com/rusefi/output/FileFsioSettingsConsumer.java @@ -10,21 +10,29 @@ import static com.rusefi.ConfigDefinition.EOL; public class FileFsioSettingsConsumer extends FsioSettingsConsumer { private final LazyFile enumFile; + private final LazyFile gettersFile; - public FileFsioSettingsConsumer(ReaderState state, String destCFsioConstantsFileName) { + public FileFsioSettingsConsumer(ReaderState state, String destCFsioConstantsFileName, String destCFsioGettersFileName) { super(state); enumFile = new LazyFile(destCFsioConstantsFileName); + gettersFile = new LazyFile(destCFsioGettersFileName); } @Override public void startFile() { enumFile.write("// this file " + ConfigDefinition.MESSAGE + ConfigDefinition.EOL + EOL); enumFile.write("// by " + getClass() + EOL); + + gettersFile.write("// this file " + ConfigDefinition.MESSAGE + ConfigDefinition.EOL + EOL); + gettersFile.write("// by " + getClass() + EOL); } @Override public void endFile() throws IOException { enumFile.write(enumDefinition.toString()); enumFile.close(); + + gettersFile.write(getContent()); + gettersFile.close(); } } diff --git a/java_tools/configuration_definition/src/com/rusefi/output/FsioSettingsConsumer.java b/java_tools/configuration_definition/src/com/rusefi/output/FsioSettingsConsumer.java index c6e2525c0c..965da0e458 100644 --- a/java_tools/configuration_definition/src/com/rusefi/output/FsioSettingsConsumer.java +++ b/java_tools/configuration_definition/src/com/rusefi/output/FsioSettingsConsumer.java @@ -34,23 +34,24 @@ public abstract class FsioSettingsConsumer implements ConfigurationConsumer { @Override public void handleEndStruct(ConfigStructure structure) { if (state.stack.isEmpty()) { - handleFields(structure.tsFields, ""); + handleFields(structure.tsFields, "", ""); } } - private void handleFields(List tsFields, String prefix) { + private void handleFields(List tsFields, String prefix, String cFieldPrefix) { for (int i = 0; i < tsFields.size(); i++) { ConfigField cf = tsFields.get(i); - writeOneField(cf, prefix); + writeOneField(cf, prefix, cFieldPrefix); } } - private void writeOneField(ConfigField configField, String prefix) { + private void writeOneField(ConfigField configField, String prefix, String cNamePrefix) { ConfigStructure cs = configField.getState().structures.get(configField.getType()); if (cs != null) { - String extraPrefix = cs.withPrefix ? configField.getName() + "_" : ""; - handleFields(cs.tsFields, prefix + extraPrefix); + String extraPrefix = cs.withPrefix ? configField.getName() + "." : ""; + String cFieldPrefix = cs.withPrefix ? configField.getCFieldName() + "." : ""; + handleFields(cs.tsFields, prefix + extraPrefix, prefix + cFieldPrefix); return; } @@ -58,10 +59,17 @@ public abstract class FsioSettingsConsumer implements ConfigurationConsumer { String nameWithPrefix = prefix + configField.getName(); - enumDefinition.append("\tFSIO_SETTING_" + nameWithPrefix.toUpperCase() + " = " + currentIndex++ + ",\n"); + String enumName = "FSIO_SETTING_" + nameWithPrefix.replaceAll("\\.", "_").toUpperCase(); + enumDefinition.append("\t" + + enumName + " = " + currentIndex++ + ",\n"); - content.append(nameWithPrefix + "\n"); + String cFieldName = cNamePrefix + configField.getCFieldName(); + + + content.append("\tcase " + enumName + ":\n"); + content.append("\t\treturn engineConfiguration->" + cFieldName + ";\n"); } } + } 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 f2f153b8b0..ad3fec5345 100644 --- a/java_tools/configuration_definition/src/com/rusefi/test/ConfigFieldParserTest.java +++ b/java_tools/configuration_definition/src/com/rusefi/test/ConfigFieldParserTest.java @@ -52,7 +52,8 @@ public class ConfigFieldParserTest { "end_struct\n" + "struct_no_prefix engine_configuration_s\n" + "\tpid_s alternatorControl;\n" + - "\tpid_s etb;\n" + + "#define ETB_COUNT 2\n" + + "\tpid_s[ETB_COUNT iterate] etb;\n" + "end_struct\n" + "" + ""; @@ -83,30 +84,47 @@ public class ConfigFieldParserTest { state.readBufferedReader(reader, Arrays.asList(javaFieldsConsumer, fsioSettingsConsumer)); - assertEquals(javaFieldsConsumer.getJavaFieldsWriter(), "\tpublic static final Field OFFSET = Field.create(\"OFFSET\", 0, FieldType.INT16);\n" + - "\tpublic static final Field PERIODMS = Field.create(\"PERIODMS\", 2, FieldType.INT16);\n" + - "\tpublic static final Field MINVALUE = Field.create(\"MINVALUE\", 4, FieldType.INT16);\n" + - "\tpublic static final Field ALTERNATORCONTROL_OFFSET = Field.create(\"ALTERNATORCONTROL_OFFSET\", 0, FieldType.INT16);\n" + - "\tpublic static final Field ALTERNATORCONTROL_PERIODMS = Field.create(\"ALTERNATORCONTROL_PERIODMS\", 2, FieldType.INT16);\n" + - "\tpublic static final Field ALTERNATORCONTROL_MINVALUE = Field.create(\"ALTERNATORCONTROL_MINVALUE\", 4, FieldType.INT16);\n" + - "\tpublic static final Field ETB_OFFSET = Field.create(\"ETB_OFFSET\", 8, FieldType.INT16);\n" + - "\tpublic static final Field ETB_PERIODMS = Field.create(\"ETB_PERIODMS\", 10, FieldType.INT16);\n" + - "\tpublic static final Field ETB_MINVALUE = Field.create(\"ETB_MINVALUE\", 12, FieldType.INT16);\n"); + assertEquals("\tpublic static final Field OFFSET = Field.create(\"OFFSET\", 0, FieldType.INT16);\n" + + "\tpublic static final Field PERIODMS = Field.create(\"PERIODMS\", 2, FieldType.INT16);\n" + + "\tpublic static final Field MINVALUE = Field.create(\"MINVALUE\", 4, FieldType.INT16);\n" + + "\tpublic static final Field ALTERNATORCONTROL_OFFSET = Field.create(\"ALTERNATORCONTROL_OFFSET\", 0, FieldType.INT16);\n" + + "\tpublic static final Field ALTERNATORCONTROL_PERIODMS = Field.create(\"ALTERNATORCONTROL_PERIODMS\", 2, FieldType.INT16);\n" + + "\tpublic static final Field ALTERNATORCONTROL_MINVALUE = Field.create(\"ALTERNATORCONTROL_MINVALUE\", 4, FieldType.INT16);\n" + + "\tpublic static final Field ETB1_OFFSET = Field.create(\"ETB1_OFFSET\", 8, FieldType.INT16);\n" + + "\tpublic static final Field ETB1_PERIODMS = Field.create(\"ETB1_PERIODMS\", 10, FieldType.INT16);\n" + + "\tpublic static final Field ETB1_MINVALUE = Field.create(\"ETB1_MINVALUE\", 12, FieldType.INT16);\n" + + "\tpublic static final Field ETB2_OFFSET = Field.create(\"ETB2_OFFSET\", 16, FieldType.INT16);\n" + + "\tpublic static final Field ETB2_PERIODMS = Field.create(\"ETB2_PERIODMS\", 18, FieldType.INT16);\n" + + "\tpublic static final Field ETB2_MINVALUE = Field.create(\"ETB2_MINVALUE\", 20, FieldType.INT16);\n", + javaFieldsConsumer.getJavaFieldsWriter()); - assertEquals(fsioSettingsConsumer.getContent(), "offset\n" + - "minValue\n" + - "alternatorControl_offset\n" + - "alternatorControl_minValue\n" + - "etb_offset\n" + - "etb_minValue\n"); + assertEquals("\tcase FSIO_SETTING_OFFSET:\n" + + "\t\treturn engineConfiguration->offset;\n" + + "\tcase FSIO_SETTING_MINVALUE:\n" + + "\t\treturn engineConfiguration->minValue;\n" + + "\tcase FSIO_SETTING_ALTERNATORCONTROL_OFFSET:\n" + + "\t\treturn engineConfiguration->alternatorControl.offset;\n" + + "\tcase FSIO_SETTING_ALTERNATORCONTROL_MINVALUE:\n" + + "\t\treturn engineConfiguration->alternatorControl.minValue;\n" + + "\tcase FSIO_SETTING_ETB1_OFFSET:\n" + + "\t\treturn engineConfiguration->etb[0].offset;\n" + + "\tcase FSIO_SETTING_ETB1_MINVALUE:\n" + + "\t\treturn engineConfiguration->etb[0].minValue;\n" + + "\tcase FSIO_SETTING_ETB2_OFFSET:\n" + + "\t\treturn engineConfiguration->etb[1].offset;\n" + + "\tcase FSIO_SETTING_ETB2_MINVALUE:\n" + + "\t\treturn engineConfiguration->etb[1].minValue;\n", + fsioSettingsConsumer.getContent()); - assertEquals(fsioSettingsConsumer.getEnumDefinition(), - "\tFSIO_SETTING_OFFSET = 1000,\n" + + assertEquals("\tFSIO_SETTING_OFFSET = 1000,\n" + "\tFSIO_SETTING_MINVALUE = 1001,\n" + "\tFSIO_SETTING_ALTERNATORCONTROL_OFFSET = 1002,\n" + "\tFSIO_SETTING_ALTERNATORCONTROL_MINVALUE = 1003,\n" + - "\tFSIO_SETTING_ETB_OFFSET = 1004,\n" + - "\tFSIO_SETTING_ETB_MINVALUE = 1005,\n"); + "\tFSIO_SETTING_ETB1_OFFSET = 1004,\n" + + "\tFSIO_SETTING_ETB1_MINVALUE = 1005,\n" + + "\tFSIO_SETTING_ETB2_OFFSET = 1006,\n" + + "\tFSIO_SETTING_ETB2_MINVALUE = 1007,\n", + fsioSettingsConsumer.getEnumDefinition()); } }