Skip to content

Commit

Permalink
Merge pull request #376 from EvgSkv/ti2023
Browse files Browse the repository at this point in the history
Add iteration info in the graphviz display.
  • Loading branch information
EvgSkv authored Sep 12, 2024
2 parents b995bf4 + be35ec5 commit 3740559
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions common/concertina_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,15 +247,26 @@ def ActionShape(self, a):
return 'box'

def AsGraphViz(self):
def NodeText(node):
if node in self.action_iteration:
maybe_iteration_info = ' %d / %d' % (
self.action_iterations_complete[node],
self.iteration_repetitions[self.action_iteration[node]]
)
if node in self.action_stopped:
maybe_iteration_info += ' / stop.'
else:
maybe_iteration_info = ''
return node + maybe_iteration_info
g = graphviz.Digraph('Concertina')
for a in self.all_actions:
color = self.ActionColor(a)
shape = self.ActionShape(a)
styles = ['filled']

g.node(a, shape=shape, fillcolor=color, style='filled,rounded', color='gray34')
g.node(NodeText(a), shape=shape, fillcolor=color, style='filled,rounded', color='gray34')
for prerequisite in self.action[a]['requires']:
g.edge(prerequisite, a)
g.edge(NodeText(prerequisite), NodeText(a))

return g

Expand Down

0 comments on commit 3740559

Please sign in to comment.