Commit 1333fdcb authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Fix minor issues with statechart configuration

parent f553b25b
...@@ -612,7 +612,7 @@ def create_dot_graph(root_ast, basic=False, scene=None): ...@@ -612,7 +612,7 @@ def create_dot_graph(root_ast, basic=False, scene=None):
else: else:
LOG.info ("Statechart settings read from configuration file") LOG.info ("Statechart settings read from configuration file")
if scene: if scene and scene.views():
# Load and display a table for the user to filter out messages that # Load and display a table for the user to filter out messages that
# are not relevant to display on the statechart - and make it lighter # are not relevant to display on the statechart - and make it lighter
# Repeat for substates, too. # Repeat for substates, too.
......
...@@ -1027,11 +1027,15 @@ class SDL_Scene(QtGui.QGraphicsScene, object): ...@@ -1027,11 +1027,15 @@ class SDL_Scene(QtGui.QGraphicsScene, object):
ast, _, _ = ogParser.parse_pr(string=pr_data) ast, _, _ = ogParser.parse_pr(string=pr_data)
try: try:
process_ast, = ast.processes process_ast, = ast.processes
process_ast.input_signals = \
sdlSymbols.CONTEXT.processes[0].input_signals
except ValueError: except ValueError:
LOG.debug('No statechart to render') LOG.debug('No statechart to render')
return None return None
try:
process_ast.input_signals = \
sdlSymbols.CONTEXT.processes[0].input_signals
except IndexError:
# No process context, eg. when called from cmd line
LOG.debug("Statechart rendering: no CONTEXT.processes[0]")
# Flatten nested states (no, because neato does not support it, # Flatten nested states (no, because neato does not support it,
# dot supports only vertically-aligned states, and fdp does not # dot supports only vertically-aligned states, and fdp does not
# support curved edges and is buggy with pygraphviz anyway) # support curved edges and is buggy with pygraphviz anyway)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment