4 Commits

Author SHA1 Message Date
Martino Ferrari 83048054a2 using long color codes only 2026-04-22 11:21:08 +02:00
Martino Ferrari 13c3647f74 using long color codes only 2026-04-22 10:52:23 +02:00
Martino Ferrari 87381ee328 using long color codes only 2026-04-22 10:48:02 +02:00
Martino Ferrari 7266540371 minor fix 2026-04-21 17:56:20 +02:00
2 changed files with 19 additions and 13 deletions
+6
View File
@@ -35,7 +35,10 @@ def signal_byte_size(sig):
nod = nod if nod > 0 else 1 nod = nod if nod > 0 else 1
noe = noe if noe > 0 else 1 noe = noe if noe > 0 else 1
nos = 1 if "Samples" not in sig else int(sig["Samples"]) nos = 1 if "Samples" not in sig else int(sig["Samples"])
if "Type" in sig:
bytes = type_bytes_count(sig["Type"]) bytes = type_bytes_count(sig["Type"])
else:
bytes = type_bytes_count(signal_type(sig)[0])
tot = noe * nod * nos tot = noe * nod * nos
if "Ranges" in sig: if "Ranges" in sig:
@@ -47,7 +50,10 @@ def signal_byte_size(sig):
def signal_type(sig): def signal_type(sig):
if "Type" in sig:
type_name = sig["Type"] type_name = sig["Type"]
else:
type_name = "uint32"
noe = int(sig["NumberOfElements"]) if "NumberOfElements" in sig else 1 noe = int(sig["NumberOfElements"]) if "NumberOfElements" in sig else 1
nod = int(sig["NumberOfDimensions"]) if "NumberOfDimensions" in sig else 1 nod = int(sig["NumberOfDimensions"]) if "NumberOfDimensions" in sig else 1
nod = nod if nod > 0 else 1 nod = nod if nod > 0 else 1
+11 -11
View File
@@ -154,14 +154,14 @@ def __doc_iogam__(id, obj, edges, thread):
) )
) )
orows.append(orow) orows.append(orow)
fill = "#eee" fill = "#eeeeee"
fcolor = "#000" fcolor = "#000000"
total = max(len(orows), len(irows)) total = max(len(orows), len(irows))
if bold or total > 1: if bold or total > 1:
fill = "#eee" fill = "#eeeeee"
bold = True bold = True
else: else:
fill = "#eee" fill = "#eeeeee"
inode = f"{id}_{counter} [shape=plaintext," inode = f"{id}_{counter} [shape=plaintext,"
inode += f'tooltip=" IOGAM::{id} ", label=<' inode += f'tooltip=" IOGAM::{id} ", label=<'
@@ -321,7 +321,7 @@ def __doc_mathgam__(id, obj, edges, thread):
node = __gam__(id, label, obj["Class"]) node = __gam__(id, label, obj["Class"])
node += ( node += (
"<tr><td colspan='2' align='left' balign='left' bgcolor='#fef'><font face='mono' point-size='9'>" "<tr><td colspan='2' align='left' balign='left' bgcolor='#ffeeff'><font face='mono' point-size='9'>"
+ __sanitize__(obj["Expression"]) + __sanitize__(obj["Expression"])
+ "</font></td></tr><hr/> " + "</font></td></tr><hr/> "
) )
@@ -413,12 +413,12 @@ def __process_gamds__(name, cls, signals, edges):
"</td></tr>" "</td></tr>"
) )
if node: if node:
label = f"""<table border="0" cellpadding="4" cellborder="1" cellspacing="0" bgcolor="#eee"> label = f"""<table border="0" cellpadding="4" cellborder="1" cellspacing="0" bgcolor="#eeeeee">
<tr><td><b>{name}</b><br/>{cls}</td></tr> <tr><td><b>{name}</b><br/>{cls}</td></tr>
{node} {node}
</table> </table>
""" """
node = f'{name} [shape=plaintext, label=<{label}>, color="#0af"];\n' node = f'{name} [shape=plaintext, label=<{label}>, color="#00aaff"];\n'
return node, edges return node, edges
@@ -470,7 +470,7 @@ def __process_ds__(name, obj, edges):
sig_type = sigs[sig_name] sig_type = sigs[sig_name]
node += f"{sig_name} ({doc.type_to_string(sig_type)})" node += f"{sig_name} ({doc.type_to_string(sig_type)})"
node += "</td></tr>\n" node += "</td></tr>\n"
node += '</table>>, color="#0af"];\n' node += '</table>>, color="#00aaff"];\n'
if not multi_thread and node: if not multi_thread and node:
node = f"subgraph cluster_{thread}" + "{\n" + node + "};\n" node = f"subgraph cluster_{thread}" + "{\n" + node + "};\n"
return node, edges return node, edges
@@ -561,7 +561,7 @@ def __simple_gam__(label, obj):
id = f"fn{doc.format_name(label)}" id = f"fn{doc.format_name(label)}"
style = "style=rounded" style = "style=rounded"
if cls == "IOGAM": if cls == "IOGAM":
style = 'style="rounded,filled", fillcolor="#eee"' style = 'style="rounded,filled", fillcolor="#eeeeee"'
elif cls == "MessageGAM": elif cls == "MessageGAM":
style = 'style="rounded,filled", fillcolor=lightyellow' style = 'style="rounded,filled", fillcolor=lightyellow'
if "InputSignals" in obj: if "InputSignals" in obj:
@@ -593,10 +593,10 @@ def __simple_ds__(label, obj, edges):
multi_thread = True multi_thread = True
fillcolor = "lightblue" fillcolor = "lightblue"
bordercolor = "#0af" bordercolor = "#00aaff"
style = "penwidth=2" style = "penwidth=2"
if cls == "GAMDataSource": if cls == "GAMDataSource":
fillcolor = "#eee" fillcolor = "#eeeeee"
node = f"{id}[label=<<B>{label}</B><BR/>{cls}>, " node = f"{id}[label=<<B>{label}</B><BR/>{cls}>, "
node += f'{style}, fillcolor="{fillcolor}", color="{bordercolor}"]\n' node += f'{style}, fillcolor="{fillcolor}", color="{bordercolor}"]\n'
if thread and not multi_thread: if thread and not multi_thread: