reducing unusedBit clutter

This commit is contained in:
rusefillc 2022-11-02 21:49:14 -04:00
parent 781acc6440
commit 5c8cf7fd10
4 changed files with 9 additions and 67 deletions

Binary file not shown.

View File

@ -73,13 +73,15 @@ public class TsOutput {
}
if (configField.isBit()) {
tsHeader.append(nameWithPrefix + " = bits, U32,");
tsHeader.append(" " + tsPosition + ", [");
tsHeader.append(bitIndex + ":" + bitIndex);
tsHeader.append("]");
if (isConstantsSection)
tsHeader.append(", \"" + configField.getFalseName() + "\", \"" + configField.getTrueName() + "\"");
tsHeader.append(EOL);
if (!configField.getName().startsWith(ConfigStructure.UNUSED_BIT_PREFIX)) {
tsHeader.append(nameWithPrefix + " = bits, U32,");
tsHeader.append(" " + tsPosition + ", [");
tsHeader.append(bitIndex + ":" + bitIndex);
tsHeader.append("]");
if (isConstantsSection)
tsHeader.append(", \"" + configField.getFalseName() + "\", \"" + configField.getTrueName() + "\"");
tsHeader.append(EOL);
}
tsPosition += configField.getSize(next);
return tsPosition;

View File

@ -717,36 +717,6 @@ public class ConfigFieldParserTest {
"pid_afr_typet = scalar, F32, 4, \"\", 1, 0, 0, 100, 0\n" +
"pid_isForcedInduction = bits, U32, 8, [0:0], \"false\", \"true\"\n" +
"pid_enableFan1WithAc = bits, U32, 8, [1:1], \"false\", \"true\"\n" +
"pid_unusedBit_4_2 = bits, U32, 8, [2:2], \"false\", \"true\"\n" +
"pid_unusedBit_4_3 = bits, U32, 8, [3:3], \"false\", \"true\"\n" +
"pid_unusedBit_4_4 = bits, U32, 8, [4:4], \"false\", \"true\"\n" +
"pid_unusedBit_4_5 = bits, U32, 8, [5:5], \"false\", \"true\"\n" +
"pid_unusedBit_4_6 = bits, U32, 8, [6:6], \"false\", \"true\"\n" +
"pid_unusedBit_4_7 = bits, U32, 8, [7:7], \"false\", \"true\"\n" +
"pid_unusedBit_4_8 = bits, U32, 8, [8:8], \"false\", \"true\"\n" +
"pid_unusedBit_4_9 = bits, U32, 8, [9:9], \"false\", \"true\"\n" +
"pid_unusedBit_4_10 = bits, U32, 8, [10:10], \"false\", \"true\"\n" +
"pid_unusedBit_4_11 = bits, U32, 8, [11:11], \"false\", \"true\"\n" +
"pid_unusedBit_4_12 = bits, U32, 8, [12:12], \"false\", \"true\"\n" +
"pid_unusedBit_4_13 = bits, U32, 8, [13:13], \"false\", \"true\"\n" +
"pid_unusedBit_4_14 = bits, U32, 8, [14:14], \"false\", \"true\"\n" +
"pid_unusedBit_4_15 = bits, U32, 8, [15:15], \"false\", \"true\"\n" +
"pid_unusedBit_4_16 = bits, U32, 8, [16:16], \"false\", \"true\"\n" +
"pid_unusedBit_4_17 = bits, U32, 8, [17:17], \"false\", \"true\"\n" +
"pid_unusedBit_4_18 = bits, U32, 8, [18:18], \"false\", \"true\"\n" +
"pid_unusedBit_4_19 = bits, U32, 8, [19:19], \"false\", \"true\"\n" +
"pid_unusedBit_4_20 = bits, U32, 8, [20:20], \"false\", \"true\"\n" +
"pid_unusedBit_4_21 = bits, U32, 8, [21:21], \"false\", \"true\"\n" +
"pid_unusedBit_4_22 = bits, U32, 8, [22:22], \"false\", \"true\"\n" +
"pid_unusedBit_4_23 = bits, U32, 8, [23:23], \"false\", \"true\"\n" +
"pid_unusedBit_4_24 = bits, U32, 8, [24:24], \"false\", \"true\"\n" +
"pid_unusedBit_4_25 = bits, U32, 8, [25:25], \"false\", \"true\"\n" +
"pid_unusedBit_4_26 = bits, U32, 8, [26:26], \"false\", \"true\"\n" +
"pid_unusedBit_4_27 = bits, U32, 8, [27:27], \"false\", \"true\"\n" +
"pid_unusedBit_4_28 = bits, U32, 8, [28:28], \"false\", \"true\"\n" +
"pid_unusedBit_4_29 = bits, U32, 8, [29:29], \"false\", \"true\"\n" +
"pid_unusedBit_4_30 = bits, U32, 8, [30:30], \"false\", \"true\"\n" +
"pid_unusedBit_4_31 = bits, U32, 8, [31:31], \"false\", \"true\"\n" +
"; total TS size = 12\n", tsProjectConsumer.getContent());
assertEquals(
"\tpid_afr_type = \"PID dTime\"\n" +

View File

@ -42,36 +42,6 @@ public class OutputsTest {
"afr_typet = scalar, U08, 4, \"ms\", 1, 0\n" +
"isForcedInduction = bits, U32, 8, [0:0]\n" +
"enableFan1WithAc = bits, U32, 8, [1:1]\n" +
"unusedBit_5_2 = bits, U32, 8, [2:2]\n" +
"unusedBit_5_3 = bits, U32, 8, [3:3]\n" +
"unusedBit_5_4 = bits, U32, 8, [4:4]\n" +
"unusedBit_5_5 = bits, U32, 8, [5:5]\n" +
"unusedBit_5_6 = bits, U32, 8, [6:6]\n" +
"unusedBit_5_7 = bits, U32, 8, [7:7]\n" +
"unusedBit_5_8 = bits, U32, 8, [8:8]\n" +
"unusedBit_5_9 = bits, U32, 8, [9:9]\n" +
"unusedBit_5_10 = bits, U32, 8, [10:10]\n" +
"unusedBit_5_11 = bits, U32, 8, [11:11]\n" +
"unusedBit_5_12 = bits, U32, 8, [12:12]\n" +
"unusedBit_5_13 = bits, U32, 8, [13:13]\n" +
"unusedBit_5_14 = bits, U32, 8, [14:14]\n" +
"unusedBit_5_15 = bits, U32, 8, [15:15]\n" +
"unusedBit_5_16 = bits, U32, 8, [16:16]\n" +
"unusedBit_5_17 = bits, U32, 8, [17:17]\n" +
"unusedBit_5_18 = bits, U32, 8, [18:18]\n" +
"unusedBit_5_19 = bits, U32, 8, [19:19]\n" +
"unusedBit_5_20 = bits, U32, 8, [20:20]\n" +
"unusedBit_5_21 = bits, U32, 8, [21:21]\n" +
"unusedBit_5_22 = bits, U32, 8, [22:22]\n" +
"unusedBit_5_23 = bits, U32, 8, [23:23]\n" +
"unusedBit_5_24 = bits, U32, 8, [24:24]\n" +
"unusedBit_5_25 = bits, U32, 8, [25:25]\n" +
"unusedBit_5_26 = bits, U32, 8, [26:26]\n" +
"unusedBit_5_27 = bits, U32, 8, [27:27]\n" +
"unusedBit_5_28 = bits, U32, 8, [28:28]\n" +
"unusedBit_5_29 = bits, U32, 8, [29:29]\n" +
"unusedBit_5_30 = bits, U32, 8, [30:30]\n" +
"unusedBit_5_31 = bits, U32, 8, [31:31]\n" +
"m_requested_pump = scalar, F32, 12, \"\", 1, 0\n" +
"tCharge = scalar, F32, 16, \"\", 1, 0\n" +
"; total TS size = 20\n";