mirror of https://github.com/rusefi/rusefi.git
Epic: Remove FSIO #2928
This commit is contained in:
parent
b30866ad29
commit
65e391d5ff
|
@ -25,7 +25,7 @@ import org.jetbrains.annotations.Nullable;
|
|||
*/
|
||||
public class ConfigFieldImpl implements ConfigField {
|
||||
private static final Logging log = getLogging(ConfigFieldImpl.class);
|
||||
public static final ConfigFieldImpl VOID = new ConfigFieldImpl(null, "", null, null, null, new int[0], null, false, false, false, null, null);
|
||||
public static final ConfigFieldImpl VOID = new ConfigFieldImpl(null, "", null, null, null, new int[0], null, false, false, null, null);
|
||||
|
||||
private static final String typePattern = "([\\w\\d_]+)(\\[([\\w\\d]+)(\\sx\\s([\\w\\d]+))?(\\s([\\w\\d]+))?\\])?";
|
||||
|
||||
|
@ -49,7 +49,6 @@ public class ConfigFieldImpl implements ConfigField {
|
|||
private final String tsInfo;
|
||||
private final boolean isIterate;
|
||||
private final ReaderStateImpl state;
|
||||
private final boolean fsioVisible;
|
||||
private final boolean hasAutoscale;
|
||||
private final String trueName;
|
||||
private final String falseName;
|
||||
|
@ -68,11 +67,9 @@ public class ConfigFieldImpl implements ConfigField {
|
|||
int[] arraySizes,
|
||||
@Nullable String tsInfo,
|
||||
boolean isIterate,
|
||||
boolean fsioVisible,
|
||||
boolean hasAutoscale,
|
||||
String trueName,
|
||||
String falseName) {
|
||||
this.fsioVisible = fsioVisible;
|
||||
this.hasAutoscale = hasAutoscale;
|
||||
this.trueName = trueName == null ? "true" : trueName;
|
||||
this.falseName = falseName == null ? "false" : falseName;
|
||||
|
@ -172,8 +169,6 @@ public class ConfigFieldImpl implements ConfigField {
|
|||
String[] nameTokens = nameString.split("\\s");
|
||||
String name = nameTokens[nameTokens.length - 1];
|
||||
|
||||
boolean isFsioVisible = Arrays.stream(nameTokens).anyMatch(s -> s.equalsIgnoreCase("fsio_visible"));
|
||||
|
||||
boolean hasAutoscale = false;
|
||||
for (String autoscaler : nameTokens) {
|
||||
if (autoscaler.equals("autoscale")) {
|
||||
|
@ -206,7 +201,7 @@ public class ConfigFieldImpl implements ConfigField {
|
|||
|
||||
|
||||
ConfigFieldImpl field = new ConfigFieldImpl(state, name, comment, arraySizeAsText, type, arraySizes,
|
||||
tsInfo, isIterate, isFsioVisible, hasAutoscale, null, null);
|
||||
tsInfo, isIterate, hasAutoscale, null, null);
|
||||
if (log.debugEnabled())
|
||||
log.debug("type " + type);
|
||||
if (log.debugEnabled())
|
||||
|
@ -314,11 +309,6 @@ public class ConfigFieldImpl implements ConfigField {
|
|||
return tsInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFsioVisible() {
|
||||
return fsioVisible;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String autoscaleSpec() {
|
||||
Pair<Integer, Integer> pair = autoscaleSpecPair();
|
||||
|
|
|
@ -85,7 +85,7 @@ public class ReaderStateImpl implements ReaderState {
|
|||
String trueName = bitNameParts.length > 1 ? bitNameParts[1].replaceAll("\"", "") : null;
|
||||
String falseName = bitNameParts.length > 2 ? bitNameParts[2].replaceAll("\"", "") : null;
|
||||
|
||||
ConfigFieldImpl bitField = new ConfigFieldImpl(state, bitNameParts[0], comment, null, BOOLEAN_T, new int[0], null, false, false, false, trueName, falseName);
|
||||
ConfigFieldImpl bitField = new ConfigFieldImpl(state, bitNameParts[0], comment, null, BOOLEAN_T, new int[0], null, false, false, trueName, falseName);
|
||||
if (state.stack.isEmpty())
|
||||
throw new IllegalStateException("Parent structure expected");
|
||||
ConfigStructureImpl structure = state.stack.peek();
|
||||
|
@ -299,7 +299,7 @@ public class ReaderStateImpl implements ReaderState {
|
|||
if (cf == null) {
|
||||
if (ConfigFieldImpl.isPreprocessorDirective(line)) {
|
||||
cf = new ConfigFieldImpl(state, "", line, null,
|
||||
ConfigFieldImpl.DIRECTIVE_T, new int[0], null, false, false, false,
|
||||
ConfigFieldImpl.DIRECTIVE_T, new int[0], null, false, false,
|
||||
null, null);
|
||||
} else {
|
||||
throw new IllegalStateException("Cannot parse line [" + line + "]");
|
||||
|
@ -328,7 +328,7 @@ public class ReaderStateImpl implements ReaderState {
|
|||
for (int i = 1; i <= cf.getArraySizes()[0]; i++) {
|
||||
String commentWithIndex = getCommentWithIndex(cf, i);
|
||||
ConfigFieldImpl element = new ConfigFieldImpl(state, cf.getName() + i, commentWithIndex, null,
|
||||
cf.getType(), new int[0], cf.getTsInfo(), false, false, cf.isHasAutoscale(), null, null);
|
||||
cf.getType(), new int[0], cf.getTsInfo(), false, cf.isHasAutoscale(), null, null);
|
||||
element.setFromIterate(cf.getName(), i);
|
||||
structure.addTs(element);
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ public class ConfigStructureImpl implements ConfigStructure {
|
|||
}
|
||||
ConfigFieldImpl fill = new ConfigFieldImpl(state, ALIGNMENT_FILL_AT + totalSize, "need 4 byte alignment",
|
||||
"" + fillSize,
|
||||
TypesHelper.UINT8_T, fillSizeArray, "\"units\", 1, 0, -20, 100, 0", false, false, false, null, null);
|
||||
TypesHelper.UINT8_T, fillSizeArray, "\"units\", 1, 0, -20, 100, 0", false, false, null, null);
|
||||
addBoth(fill);
|
||||
}
|
||||
totalSize += fillSize;
|
||||
|
@ -114,7 +114,7 @@ public class ConfigStructureImpl implements ConfigStructure {
|
|||
return;
|
||||
int sizeAtStartOfPadding = cFields.size();
|
||||
while (readingBitState.get() < 32) {
|
||||
ConfigFieldImpl bitField = new ConfigFieldImpl(readerState, UNUSED_BIT_PREFIX + sizeAtStartOfPadding + "_" + readingBitState.get(), "", null, BOOLEAN_T, new int[0], null, false, false, false, null, null);
|
||||
ConfigFieldImpl bitField = new ConfigFieldImpl(readerState, UNUSED_BIT_PREFIX + sizeAtStartOfPadding + "_" + readingBitState.get(), "", null, BOOLEAN_T, new int[0], null, false, false, null, null);
|
||||
addBitField(bitField);
|
||||
}
|
||||
readingBitState.reset();
|
||||
|
|
|
@ -295,9 +295,9 @@ public class ConfigFieldParserTest {
|
|||
public void testFsioVisible() {
|
||||
{
|
||||
ReaderStateImpl state = new ReaderStateImpl();
|
||||
ConfigFieldImpl cf = ConfigFieldImpl.parse(state, "int fsio_visible field");
|
||||
ConfigFieldImpl cf = ConfigFieldImpl.parse(state, "int field");
|
||||
assertEquals(cf.getType(), "int");
|
||||
assertTrue(cf.isFsioVisible());
|
||||
|
||||
assertEquals("Name", cf.getName(), "field");
|
||||
}
|
||||
|
||||
|
|
|
@ -89,12 +89,6 @@ public interface ConfigField {
|
|||
public String getTsInfo() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFsioVisible() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String autoscaleSpec() {
|
||||
return null;
|
||||
|
@ -189,9 +183,6 @@ public interface ConfigField {
|
|||
ReaderState getState();
|
||||
|
||||
String getTsInfo();
|
||||
|
||||
boolean isFsioVisible();
|
||||
|
||||
String autoscaleSpec();
|
||||
|
||||
double autoscaleSpecNumber();
|
||||
|
|
Loading…
Reference in New Issue