This commit is contained in:
rusefi 2020-07-14 21:34:59 -04:00
parent cb0cecde07
commit dee2cc0a68
5 changed files with 7 additions and 3 deletions

View File

@ -44,7 +44,6 @@
! all the sub-structures are going to be nested within the primary structure, that's
! needed to get a proper TunerStudio file
struct persistent_config_s
struct_no_prefix engine_configuration_s

Binary file not shown.

View File

@ -25,7 +25,7 @@ public class ConfigStructure {
public final List<ConfigField> cFields = new ArrayList<>();
public final List<ConfigField> tsFields = new ArrayList<>();
public int totalSize;
private int totalSize;
public final BitState readingBitState = new BitState();
@ -97,4 +97,8 @@ public class ConfigStructure {
}
readingBitState.reset();
}
public int getTotalSize() {
return totalSize;
}
}

View File

@ -21,7 +21,7 @@ public class TypesHelper {
if (type == null)
return 0;
if (state != null && state.structures.containsKey(type))
return state.structures.get(type).totalSize;
return state.structures.get(type).getTotalSize();
if (state != null && state.tsCustomSize.containsKey(type))
return state.tsCustomSize.get(type);
Integer primitiveSize = getPrimitiveSize(type);

View File

@ -210,6 +210,7 @@ public class TSProjectConsumer implements ConfigurationConsumer {
@Override
public void handleEndStruct(ConfigStructure structure) throws IOException {
VariableRegistry.INSTANCE.register(structure.name + "_size", structure.getTotalSize());
if (state.stack.isEmpty()) {
totalTsSize = writeTunerStudio(structure, "", tsWriter, 0);
tsWriter.write("; total TS size = " + totalTsSize + EOL);