Fan indicators not working on latest fw #7318
step one: prefix better than suffix only:uaefi
This commit is contained in:
parent
b703228518
commit
58e81ceaf9
|
@ -44,14 +44,12 @@ public class DataLogConsumer implements ConfigurationConsumer {
|
|||
for (int i = 0; i < outputNames.length; i++) {
|
||||
String temporaryLineComment = needComment(i) ? ";" : "";
|
||||
|
||||
String variableNameSuffix = outputNames.length > 1 ? Integer.toString(i) : "";
|
||||
|
||||
|
||||
String outputNamePrefix = outputNames.length > 1 ? outputNames[i] : "";
|
||||
|
||||
PerFieldWithStructuresIterator.Strategy strategy = new PerFieldWithStructuresIterator.Strategy() {
|
||||
@Override
|
||||
public String process(ReaderState state, ConfigField configField, String variableNamePrefixForEmptyComment, int currentPosition, PerFieldWithStructuresIterator perFieldWithStructuresIterator) {
|
||||
return handle(configField, variableNamePrefixForEmptyComment, temporaryLineComment, variableNameSuffix);
|
||||
return handle(configField, variableNamePrefixForEmptyComment, temporaryLineComment, "", outputNamePrefix);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -81,7 +79,7 @@ public class DataLogConsumer implements ConfigurationConsumer {
|
|||
}
|
||||
}
|
||||
|
||||
private String handle(ConfigField configField, String variableNamePrefixForEmptyComment, String temporaryLineComment, String variableNameSuffix) {
|
||||
private String handle(ConfigField configField, String variableNamePrefixForEmptyComment, String temporaryLineComment, String variableNameSuffix, String outputNamePrefix) {
|
||||
if (configField.getName().contains(UNUSED))
|
||||
return "";
|
||||
|
||||
|
@ -100,7 +98,7 @@ public class DataLogConsumer implements ConfigurationConsumer {
|
|||
typeString = "int, \"%d\"";
|
||||
}
|
||||
|
||||
String comment = getHumanGaugeName(variableNamePrefixForEmptyComment, configField, variableNameSuffix);
|
||||
String comment = getHumanGaugeName(outputNamePrefix, variableNamePrefixForEmptyComment, configField, variableNameSuffix);
|
||||
|
||||
if (comments.contains(comment))
|
||||
throw new IllegalStateException(comment + " already present in the outputs! " + configField);
|
||||
|
@ -113,7 +111,7 @@ public class DataLogConsumer implements ConfigurationConsumer {
|
|||
* More detailed technical explanation should be placed in consecutive lines
|
||||
*/
|
||||
@NotNull
|
||||
public static String getHumanGaugeName(String variableNamePrefixForEmptyComment, ConfigField configField, String variableNameSuffix) {
|
||||
public static String getHumanGaugeName(String outputNamePrefix, String variableNamePrefixForEmptyComment, ConfigField configField, String variableNameSuffix) {
|
||||
String comment = configField.getCommentTemplated();
|
||||
comment = getFirstLine(comment);
|
||||
|
||||
|
@ -123,7 +121,7 @@ public class DataLogConsumer implements ConfigurationConsumer {
|
|||
*/
|
||||
comment = variableNamePrefixForEmptyComment + unquote(configField.getName());
|
||||
}
|
||||
comment = comment + variableNameSuffix;
|
||||
comment = outputNamePrefix + comment + variableNameSuffix;
|
||||
if (comment.length() > MSQ_LENGTH_LIMIT)
|
||||
throw new IllegalStateException("[" + comment + "] is too long for log files at " + comment.length() + " limit " + MSQ_LENGTH_LIMIT);
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ public class GaugeConsumer implements ConfigurationConsumer {
|
|||
}
|
||||
|
||||
private String handle(ConfigField configField, String prefix, String variableNameSuffix) {
|
||||
String comment = getHumanGaugeName("", configField, variableNameSuffix);
|
||||
String comment = getHumanGaugeName("", "", configField, variableNameSuffix);
|
||||
comment = ConfigFieldImpl.unquote(comment);
|
||||
if (!prefix.isEmpty()) {
|
||||
comment = prefix + " " + comment;
|
||||
|
|
|
@ -72,7 +72,7 @@ public class SdCardFieldsContent {
|
|||
}
|
||||
|
||||
private static String getLine(ConfigField configField, String prefix, String namePrefix, String name, String expression, Boolean isPtr, String conditional, int currentPosition, PerFieldWithStructuresIterator perFieldWithStructuresIterator, int structureStartingTsPosition) {
|
||||
String humanName = DataLogConsumer.getHumanGaugeName(prefix, configField, namePrefix);
|
||||
String humanName = DataLogConsumer.getHumanGaugeName("", prefix, configField, namePrefix);
|
||||
|
||||
String categoryStr = configField.getCategory();
|
||||
|
||||
|
|
|
@ -84,14 +84,14 @@ public class LiveDataProcessorTest {
|
|||
"lua_torqueReductionState = bits, U32, 32, [3:3]\n" +
|
||||
"; total TS size = 36\n", liveDataProcessor.getOutputsSectionFileName());
|
||||
|
||||
captor.assertOutput("entry = tempC0, \"WBO: Temperature0\", int, \"%d\"\n" +
|
||||
"entry = bitName10, \"bitName10\", int, \"%d\"\n" +
|
||||
"entry = bitName20, \"bitName20\", int, \"%d\"\n" +
|
||||
"entry = esr0, \"WBO: ESR0\", int, \"%d\"\n" +
|
||||
"entry = tempC1, \"WBO: Temperature1\", int, \"%d\"\n" +
|
||||
"entry = bitName11, \"bitName11\", int, \"%d\"\n" +
|
||||
"entry = bitName21, \"bitName21\", int, \"%d\"\n" +
|
||||
"entry = esr1, \"WBO: ESR1\", int, \"%d\"\n" +
|
||||
captor.assertOutput("entry = tempC, \"wb1WBO: Temperature\", int, \"%d\"\n" +
|
||||
"entry = bitName1, \"wb1bitName1\", int, \"%d\"\n" +
|
||||
"entry = bitName2, \"wb1bitName2\", int, \"%d\"\n" +
|
||||
"entry = esr, \"wb1WBO: ESR\", int, \"%d\"\n" +
|
||||
"entry = tempC, \"wb2WBO: Temperature\", int, \"%d\"\n" +
|
||||
"entry = bitName1, \"wb2bitName1\", int, \"%d\"\n" +
|
||||
"entry = bitName2, \"wb2bitName2\", int, \"%d\"\n" +
|
||||
"entry = esr, \"wb2WBO: ESR\", int, \"%d\"\n" +
|
||||
"entry = oootempC, \"Temperature\", int, \"%d\"\n" +
|
||||
"entry = oooesr, \"ESR\", int, \"%d\"\n" +
|
||||
"entry = lua_fuelMult, \"Lua: Fuel mult\", float, \"%.3f\"\n" +
|
||||
|
|
Loading…
Reference in New Issue