diff --git a/autodoc/autodoc.py b/autodoc/autodoc.py index 8425b06..faa9228 100644 --- a/autodoc/autodoc.py +++ b/autodoc/autodoc.py @@ -224,13 +224,14 @@ def __doc_iogam__(id, obj, edges, thread): if bold or irelcount > 1 or orelcount > 1: fill = "#333" else: - irow = f"" + irow = f" " orow = f"" - fsize = 2.0 + fill = "#666" + fsize = 0.0 node += f'{id}_{counter} [tooltip=" IOGAM::{id} " label="' node += "{ {" + irow + "} | {" + orow + "} }" node += f'", fillcolor="{fill}", color="#666", style=filled,' - node += f' fontcolor="#fff", fontsize={fsize}, height=0];\n' + node += f' fontcolor="#fff", fontsize={fsize}, height=0, width=0];\n' irow = "" orow = "" counter += 1 @@ -238,7 +239,10 @@ def __doc_iogam__(id, obj, edges, thread): def __doc_constgam__(id, obj, edges, thread): - node = "" + node = f' {id} [label="{id[2:]}\n{obj["Class"]} | ' + values = "" + types = "" + if "OutputSignals" in obj: for i, (l, sig) in enumerate(obj["OutputSignals"].items()): datasrc = sig["DataSource"] @@ -252,12 +256,12 @@ def __doc_constgam__(id, obj, edges, thread): ) ) if i != 0: - node += " | " - node += ( - f' {__type_to_str__(mtype)}: {sig["Default"]}' - ) - - node += "" + values += " | " + types += " | " + values += f' {sig["Default"]}' + types += __type_to_str__(mtype) + node += "{{ " + types + " } | {" + values + "}}" + node += '", style=filled, fillcolor="#dff"];' return node, edges @@ -266,13 +270,17 @@ def __doc_gam__(label, obj, edges, thread): cls = obj["Class"] node = f' {id} [label="{label}\n{obj["Class"]} | ' if cls == "ConstantGAM": - sigs, datasources = __doc_constgam__(id, obj, edges, thread) + return __doc_constgam__(id, obj, edges, thread) elif cls == "IOGAM": return __doc_iogam__(id, obj, edges, thread) elif cls == "TriggeredIOGAM": return __doc_triggered_iogam__(id, obj, edges, thread) else: sigs, datasources = __doc_common_gam__(id, obj, edges, thread) + if cls == "MessageGAM": + import pprint + + pprint.pprint(obj["+Events"]) if sigs: node += sigs + '"];' else: @@ -428,16 +436,16 @@ def __process_edges__(edges, datasources): in_type = __type_to_str__(source[2]) out_type = __type_to_str__(target[2]) mtype = in_type if in_type == out_type else f"{in_type} -> {out_type}" - arrows += f'{a} -> {b} [tooltip="{mtype}", labelfloat=false];\n' + arrows += f'{a} -> {b} [tooltip=" {mtype} ", labelfloat=false];\n' return arrows def __doc_state__(label, state, app): mdstate = "" graph = f"digraph {label[1:]}" + "{\n" - graph += "graph [ranksep=2];\n" + graph += "ranksep = 1;\n" + graph += "nodesep = 0.5;\n" graph += "rankdir = LR;\n" - graph += "beautify = true;\n" graph += "node [shape=Mrecord];\n" graph += "\n" arrows = ""