Commit 8fd4701a authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Fix bugs with statechart rendering

- timers were missing
- tab activation was buggy when clicked from a nested diagram
parent 4091b36d
......@@ -135,6 +135,10 @@ The background pattern was downloaded from www.subtlepatterns.com
Changelog
=========
2.0.9 (06/2018)
- Add timers in statecharts
- Fix statechart list of signals when tab is activated from a sub-diagram
2.0.8 (05/2018)
- Minor bugfix
......
......@@ -582,7 +582,10 @@ def create_dot_graph(root_ast, basic=False, scene=None, view=None):
diamond = 0
input_signals = {sig['name'].lower() for sig in root_ast.input_signals}
# XXX misses the timers
# Add timers, in the statechart they are like other signals
for each in root_ast.timers:
input_signals.add (each)
# valid_inputs: list of messages to be displayed in the statecharts
# user can remove them from the file to make cleaner diagrams
......
......@@ -141,7 +141,7 @@ except ImportError:
__all__ = ['opengeode', 'SDL_Scene', 'SDL_View', 'parse']
__version__ = '2.0.8'
__version__ = '2.0.9'
if hasattr(sys, 'frozen'):
# Detect if we are running on Windows (py2exe-generated)
......@@ -1050,8 +1050,13 @@ class SDL_Scene(QtGui.QGraphicsScene, object):
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]")
try:
process_ast.input_signals = \
view.context_history[0].processes[0].input_signals
except (AttributeError, 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,
# dot supports only vertically-aligned states, and fdp does not
# support curved edges and is buggy with pygraphviz anyway)
......@@ -2257,7 +2262,7 @@ class SDL_View(QtGui.QGraphicsView, object):
self.messages_window.addItem(
'Code generation failed:' + str(err))
LOG.debug(str(traceback.format_exc()))
def generate_qgen_ada(self):
''' Generate Ada code using QGen '''
# If the current scene is a nested one, move to the top parent
......@@ -2291,7 +2296,7 @@ class SDL_View(QtGui.QGraphicsView, object):
'Code generation with QGen failed!')
else:
self.messages_window.addItem('Done')
def generate_qgen_c(self):
''' Generate C code using QGen '''
# If the current scene is a nested one, move to the top parent
......
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