Implementing new features

This commit is contained in:
Martino Ferrari
2026-04-21 17:46:53 +02:00
parent b6cd0994ea
commit 483c4799e0
10 changed files with 6969 additions and 4 deletions
+5 -1
View File
@@ -1,4 +1,5 @@
import logging
import sys
__PATH__ = "."
__CONFIG__ = None
@@ -29,12 +30,15 @@ def type_bytes_count(mtype):
return 1
def signal_byte_size(sig):
def signal_byte_size(parent_id, sig_id, sig):
noe = 1 if "NumberOfElements" not in sig else int(sig["NumberOfElements"])
nod = 1 if "NumberOfDimensions" not in sig else int(sig["NumberOfDimensions"])
nod = nod if nod > 0 else 1
noe = noe if noe > 0 else 1
nos = 1 if "Samples" not in sig else int(sig["Samples"])
if "Type" not in sig:
logging.fatal(f"no type defined for signal {parent_id}.{sig_id}")
sys.exit(1)
bytes = type_bytes_count(sig["Type"])
tot = noe * nod * nos