util: Add ini string as tooltip info in dot output
This patch adds the config ini string as a tooltip that can be displayed in most browsers rendering the resulting svg. Certain characters are modified for HTML output. Tested on chrome and firefox.
This commit is contained in:
parent
fad36b35c6
commit
3b90f52b61
|
@ -129,10 +129,22 @@ def dot_add_edge(simNode, callgraph, full_port_name, peerPort):
|
||||||
callgraph.add_edge(pydot.Edge(full_port_name, peer_port_name))
|
callgraph.add_edge(pydot.Edge(full_port_name, peer_port_name))
|
||||||
|
|
||||||
def dot_create_cluster(simNode, full_path, label):
|
def dot_create_cluster(simNode, full_path, label):
|
||||||
|
# get the parameter values of the node and use them as a tooltip
|
||||||
|
ini_strings = []
|
||||||
|
for param in sorted(simNode._params.keys()):
|
||||||
|
value = simNode._values.get(param)
|
||||||
|
if value != None:
|
||||||
|
# parameter name = value in HTML friendly format
|
||||||
|
ini_strings.append(str(param) + "=" +
|
||||||
|
simNode._values[param].ini_str())
|
||||||
|
# join all the parameters with an HTML newline
|
||||||
|
tooltip = " ".join(ini_strings)
|
||||||
|
|
||||||
return pydot.Cluster( \
|
return pydot.Cluster( \
|
||||||
full_path, \
|
full_path, \
|
||||||
shape = "Mrecord", \
|
shape = "Mrecord", \
|
||||||
label = label, \
|
label = label, \
|
||||||
|
tooltip = "\"" + tooltip + "\"", \
|
||||||
style = "\"rounded, filled\"", \
|
style = "\"rounded, filled\"", \
|
||||||
color = "#000000", \
|
color = "#000000", \
|
||||||
fillcolor = dot_gen_colour(simNode), \
|
fillcolor = dot_gen_colour(simNode), \
|
||||||
|
|
Loading…
Reference in a new issue