Epic: Remove FSIO #2928
This commit is contained in:
parent
1e58ab65d1
commit
e3887b35c3
|
@ -1,3 +0,0 @@
|
|||
// this file was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Sun Nov 28 20:30:50 UTC 2021
|
||||
|
||||
// by class com.rusefi.output.FileFsioSettingsConsumer
|
|
@ -1,3 +0,0 @@
|
|||
// this file was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Sun Nov 28 20:30:50 UTC 2021
|
||||
|
||||
// by class com.rusefi.output.FileFsioSettingsConsumer
|
|
@ -1,3 +0,0 @@
|
|||
// this file was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Sun Nov 28 20:30:50 UTC 2021
|
||||
|
||||
// by class com.rusefi.output.FileFsioSettingsConsumer
|
|
@ -1,3 +0,0 @@
|
|||
// this file was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Sun Nov 28 20:30:50 UTC 2021
|
||||
|
||||
// by class com.rusefi.output.FileFsioSettingsConsumer
|
|
@ -62,10 +62,6 @@ java -DSystemOut.name=logs/gen_config_board \
|
|||
-romraider_destination ../java_console/rusefi.xml \
|
||||
-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 \
|
||||
-c_fsio_names controllers/generated/fsio_names.def \
|
||||
-c_fsio_strings controllers/generated/fsio_strings.def \
|
||||
-prepend $PREPEND_FILE
|
||||
|
||||
[ $? -eq 0 ] || { echo "ERROR generating TunerStudio config for ${BOARDNAME}"; exit 1; }
|
||||
|
|
Binary file not shown.
|
@ -38,10 +38,6 @@ public class ConfigDefinition {
|
|||
private static final String KEY_ROMRAIDER_INPUT = "-romraider";
|
||||
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_FSIO_NAMES = "-c_fsio_names";
|
||||
private static final String KEY_C_FSIO_STRING = "-c_fsio_strings";
|
||||
private static final String KEY_C_DEFINES = "-c_defines";
|
||||
/**
|
||||
* @see CHeaderConsumer#withC_Defines
|
||||
|
@ -93,10 +89,6 @@ public class ConfigDefinition {
|
|||
String tsInputFileFolder = null;
|
||||
String destCHeaderFileName = null;
|
||||
String destCDefinesFileName = null;
|
||||
String destCFsioConstantsFileName = null;
|
||||
String destCFsioGettersFileName = null;
|
||||
String namesCFileName = null;
|
||||
String stringsCFileName = null;
|
||||
String javaDestinationFileName = null;
|
||||
String romRaiderDestination = null;
|
||||
// we postpone reading so that in case of cache hit we do less work
|
||||
|
@ -137,18 +129,6 @@ public class ConfigDefinition {
|
|||
case KEY_C_DESTINATION:
|
||||
destCHeaderFileName = args[i + 1];
|
||||
break;
|
||||
case KEY_C_FSIO_GETTERS:
|
||||
destCFsioGettersFileName = args[i + 1];
|
||||
break;
|
||||
case KEY_C_FSIO_STRING:
|
||||
stringsCFileName = args[i + 1];
|
||||
break;
|
||||
case KEY_C_FSIO_NAMES:
|
||||
namesCFileName = args[i + 1];
|
||||
break;
|
||||
case KEY_C_FSIO_CONSTANTS:
|
||||
destCFsioConstantsFileName = args[i + 1];
|
||||
break;
|
||||
case KEY_ZERO_INIT:
|
||||
needZeroInit = Boolean.parseBoolean(args[i + 1]);
|
||||
break;
|
||||
|
@ -306,14 +286,6 @@ public class ConfigDefinition {
|
|||
if (javaDestinationFileName != null) {
|
||||
destinations.add(new FileJavaFieldsConsumer(state, javaDestinationFileName));
|
||||
}
|
||||
|
||||
if (destCFsioConstantsFileName != null || destCFsioGettersFileName != null) {
|
||||
destinations.add(new FileFsioSettingsConsumer(state,
|
||||
destCFsioConstantsFileName,
|
||||
destCFsioGettersFileName,
|
||||
namesCFileName,
|
||||
stringsCFileName));
|
||||
}
|
||||
}
|
||||
|
||||
if (destinations.isEmpty())
|
||||
|
|
|
@ -1,53 +0,0 @@
|
|||
package com.rusefi.output;
|
||||
|
||||
import com.rusefi.ConfigDefinition;
|
||||
import com.rusefi.ReaderState;
|
||||
import com.rusefi.ToolUtil;
|
||||
import com.rusefi.util.LazyFile;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
|
||||
import static com.rusefi.ToolUtil.EOL;
|
||||
|
||||
public class FileFsioSettingsConsumer extends FsioSettingsConsumer {
|
||||
private final LazyFile enumFile;
|
||||
private final LazyFile gettersFile;
|
||||
private final LazyFile namesFile;
|
||||
private final LazyFile stringsFile;
|
||||
|
||||
public FileFsioSettingsConsumer(ReaderState state,
|
||||
String destCFsioConstantsFileName,
|
||||
String destCFsioGettersFileName,
|
||||
String namesCFileName,
|
||||
String stringsCFileName) {
|
||||
super(state);
|
||||
enumFile = new LazyFile(destCFsioConstantsFileName);
|
||||
gettersFile = new LazyFile(destCFsioGettersFileName);
|
||||
namesFile = new LazyFile(namesCFileName);
|
||||
stringsFile = new LazyFile(stringsCFileName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startFile() {
|
||||
for (LazyFile file : Arrays.asList(enumFile, gettersFile, stringsFile, namesFile)) {
|
||||
file.write("// this file " + ConfigDefinition.MESSAGE + ToolUtil.EOL + EOL);
|
||||
file.write("// by " + getClass() + EOL);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endFile() throws IOException {
|
||||
enumFile.write(getEnumDefinition());
|
||||
enumFile.close();
|
||||
|
||||
gettersFile.write(getContent());
|
||||
gettersFile.close();
|
||||
|
||||
namesFile.write(getNames());
|
||||
namesFile.close();
|
||||
|
||||
stringsFile.write(getStrings());
|
||||
stringsFile.close();
|
||||
}
|
||||
}
|
|
@ -1,93 +0,0 @@
|
|||
package com.rusefi.output;
|
||||
|
||||
import com.rusefi.ConfigField;
|
||||
import com.rusefi.ReaderState;
|
||||
|
||||
import java.io.CharArrayWriter;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Some configuration settings are exposed to FSIO
|
||||
* Here we generate relevant FSIO constants and lookup code
|
||||
*/
|
||||
|
||||
public abstract class FsioSettingsConsumer implements ConfigurationConsumer {
|
||||
private final CharArrayWriter content = new CharArrayWriter();
|
||||
private final CharArrayWriter enumDefinition = new CharArrayWriter();
|
||||
private final CharArrayWriter names = new CharArrayWriter();
|
||||
private final CharArrayWriter strings = new CharArrayWriter();
|
||||
private final ReaderState state;
|
||||
|
||||
private int currentIndex = 1000;
|
||||
|
||||
public FsioSettingsConsumer(ReaderState state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content.toString();
|
||||
}
|
||||
|
||||
public String getEnumDefinition() {
|
||||
return enumDefinition.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleEndStruct(ConfigStructure structure) {
|
||||
if (state.stack.isEmpty()) {
|
||||
handleFields(structure.tsFields, "", "");
|
||||
}
|
||||
}
|
||||
|
||||
private void handleFields(List<ConfigField> tsFields, String prefix, String cFieldPrefix) {
|
||||
|
||||
for (int i = 0; i < tsFields.size(); i++) {
|
||||
ConfigField cf = tsFields.get(i);
|
||||
writeOneField(cf, prefix, cFieldPrefix);
|
||||
}
|
||||
}
|
||||
|
||||
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() + "." : "";
|
||||
String cFieldPrefix = cs.withPrefix ? configField.getCFieldName() + "." : "";
|
||||
handleFields(cs.tsFields, prefix + extraPrefix, prefix + cFieldPrefix);
|
||||
return;
|
||||
}
|
||||
|
||||
if (configField.isFsioVisible()) {
|
||||
|
||||
String nameWithPrefix = prefix + configField.getName();
|
||||
|
||||
String nameWithPrefixUnderscore = nameWithPrefix.replaceAll("\\.", "_");
|
||||
String enumName = "FSIO_SETTING_" + nameWithPrefixUnderscore.toUpperCase();
|
||||
enumDefinition.append("\t" +
|
||||
enumName + " = " + currentIndex++ + ",\n");
|
||||
|
||||
|
||||
String cFieldName = cNamePrefix + configField.getCFieldName();
|
||||
|
||||
|
||||
content.append("\tcase " + enumName + ":\n");
|
||||
content.append("\t\treturn engineConfiguration->" + cFieldName + ";\n");
|
||||
|
||||
String rusEfiName = "\"cfg_" + nameWithPrefixUnderscore + "\"";
|
||||
|
||||
strings.append("\tcase " + enumName + ":\n");
|
||||
strings.append("\t\treturn " + rusEfiName + ";\n");
|
||||
|
||||
names.append("static LENameOrdinalPair le" + nameWithPrefixUnderscore + "(" + enumName + ", " + rusEfiName + ");\n");
|
||||
}
|
||||
}
|
||||
|
||||
public String getNames() {
|
||||
return names.toString();
|
||||
}
|
||||
|
||||
|
||||
public String getStrings() {
|
||||
return strings.toString();
|
||||
}
|
||||
|
||||
}
|
|
@ -265,18 +265,7 @@ public class ConfigFieldParserTest {
|
|||
|
||||
JavaFieldsConsumer javaFieldsConsumer = new TestJavaFieldsConsumer(state);
|
||||
|
||||
FsioSettingsConsumer fsioSettingsConsumer = new FsioSettingsConsumer(state) {
|
||||
@Override
|
||||
public void startFile() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endFile() {
|
||||
}
|
||||
};
|
||||
|
||||
state.readBufferedReader(reader, Arrays.asList(javaFieldsConsumer,
|
||||
fsioSettingsConsumer));
|
||||
state.readBufferedReader(reader, Collections.singletonList(javaFieldsConsumer));
|
||||
|
||||
|
||||
assertEquals("\tpublic static final Field OFFSET = Field.create(\"OFFSET\", 0, FieldType.INT16);\n" +
|
||||
|
@ -296,60 +285,6 @@ public class ConfigFieldParserTest {
|
|||
"\tpublic static final Field ETB2_MINVALUE = Field.create(\"ETB2_MINVALUE\", 20, FieldType.INT16);\n" +
|
||||
"\tpublic static final Field ETB2_ALIGNMENTFILL_AT_6 = Field.create(\"ETB2_ALIGNMENTFILL_AT_6\", 22, FieldType.INT8);\n",
|
||||
javaFieldsConsumer.getJavaFieldsWriter());
|
||||
|
||||
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("\tFSIO_SETTING_OFFSET = 1000,\n" +
|
||||
"\tFSIO_SETTING_MINVALUE = 1001,\n" +
|
||||
"\tFSIO_SETTING_ALTERNATORCONTROL_OFFSET = 1002,\n" +
|
||||
"\tFSIO_SETTING_ALTERNATORCONTROL_MINVALUE = 1003,\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());
|
||||
|
||||
assertEquals("static LENameOrdinalPair leoffset(FSIO_SETTING_OFFSET, \"cfg_offset\");\n" +
|
||||
"static LENameOrdinalPair leminValue(FSIO_SETTING_MINVALUE, \"cfg_minValue\");\n" +
|
||||
"static LENameOrdinalPair lealternatorControl_offset(FSIO_SETTING_ALTERNATORCONTROL_OFFSET, \"cfg_alternatorControl_offset\");\n" +
|
||||
"static LENameOrdinalPair lealternatorControl_minValue(FSIO_SETTING_ALTERNATORCONTROL_MINVALUE, \"cfg_alternatorControl_minValue\");\n" +
|
||||
"static LENameOrdinalPair leetb1_offset(FSIO_SETTING_ETB1_OFFSET, \"cfg_etb1_offset\");\n" +
|
||||
"static LENameOrdinalPair leetb1_minValue(FSIO_SETTING_ETB1_MINVALUE, \"cfg_etb1_minValue\");\n" +
|
||||
"static LENameOrdinalPair leetb2_offset(FSIO_SETTING_ETB2_OFFSET, \"cfg_etb2_offset\");\n" +
|
||||
"static LENameOrdinalPair leetb2_minValue(FSIO_SETTING_ETB2_MINVALUE, \"cfg_etb2_minValue\");\n", fsioSettingsConsumer.getNames());
|
||||
|
||||
assertEquals("\tcase FSIO_SETTING_OFFSET:\n" +
|
||||
"\t\treturn \"cfg_offset\";\n" +
|
||||
"\tcase FSIO_SETTING_MINVALUE:\n" +
|
||||
"\t\treturn \"cfg_minValue\";\n" +
|
||||
"\tcase FSIO_SETTING_ALTERNATORCONTROL_OFFSET:\n" +
|
||||
"\t\treturn \"cfg_alternatorControl_offset\";\n" +
|
||||
"\tcase FSIO_SETTING_ALTERNATORCONTROL_MINVALUE:\n" +
|
||||
"\t\treturn \"cfg_alternatorControl_minValue\";\n" +
|
||||
"\tcase FSIO_SETTING_ETB1_OFFSET:\n" +
|
||||
"\t\treturn \"cfg_etb1_offset\";\n" +
|
||||
"\tcase FSIO_SETTING_ETB1_MINVALUE:\n" +
|
||||
"\t\treturn \"cfg_etb1_minValue\";\n" +
|
||||
"\tcase FSIO_SETTING_ETB2_OFFSET:\n" +
|
||||
"\t\treturn \"cfg_etb2_offset\";\n" +
|
||||
"\tcase FSIO_SETTING_ETB2_MINVALUE:\n" +
|
||||
"\t\treturn \"cfg_etb2_minValue\";\n", fsioSettingsConsumer.getStrings());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue