Commit 52396ed5 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Ada backend fix related to continuous signals

parent 71cfe9b6
...@@ -142,6 +142,10 @@ The background pattern was downloaded from www.subtlepatterns.com ...@@ -142,6 +142,10 @@ The background pattern was downloaded from www.subtlepatterns.com
Changelog Changelog
========= =========
1.5.8 (09/2016)
- Bugfix - Ada backend failed when there were continuous signals in
nested states but none at root level (missing end if)
- Load fix when there is no dataview
1.5.7 (09/2016) 1.5.7 (09/2016)
- Bugfix - Update completion list of process symbol - Bugfix - Update completion list of process symbol
- Sort ASN.1 types in data dictionary - Sort ASN.1 types in data dictionary
......
...@@ -821,7 +821,6 @@ package {process_name} is'''.format(process_name=process_name, ...@@ -821,7 +821,6 @@ package {process_name} is'''.format(process_name=process_name,
# - Check current state(s) # - Check current state(s)
# - For each continuous signal generate code (test+transition) # - For each continuous signal generate code (test+transition)
# XXX add to C backend # XXX add to C backend
# Check Queue: TODO implement when simu=True
if process.cs_mapping and not simu: if process.cs_mapping and not simu:
taste_template.append('-- Process continuous signals') taste_template.append('-- Process continuous signals')
taste_template.append('if {}.initDone then'.format(LPREFIX)) taste_template.append('if {}.initDone then'.format(LPREFIX))
...@@ -853,11 +852,14 @@ package {process_name} is'''.format(process_name=process_name, ...@@ -853,11 +852,14 @@ package {process_name} is'''.format(process_name=process_name,
done = [] done = []
sep = 'if ' sep = 'if '
last = '' last = ''
# flag indicating there are CS in nested states but not at root
need_final_endif = False
for cs, agg in product(process.cs_mapping.viewitems(), for cs, agg in product(process.cs_mapping.viewitems(),
aggregates.viewitems()): aggregates.viewitems()):
(statename, cs_item), (agg_name, substates) = cs, agg (statename, cs_item), (agg_name, substates) = cs, agg
for each in substates: for each in substates:
if statename in each.mapping.viewkeys(): if statename in each.mapping.viewkeys():
need_final_endif = True
taste_template.append(u'{first}if not msgPending and ' taste_template.append(u'{first}if not msgPending and '
u'trId = -1 and ' u'trId = -1 and '
u'{ctxt}.state = {s1} and ' u'{ctxt}.state = {s1} and '
...@@ -882,10 +884,11 @@ package {process_name} is'''.format(process_name=process_name, ...@@ -882,10 +884,11 @@ package {process_name} is'''.format(process_name=process_name,
sep='elsif ' sep='elsif '
taste_template.extend(code) taste_template.extend(code)
done.append(statename) done.append(statename)
taste_template.append(u'end if; -- inner') # inner if taste_template.append(u'end if;') # inner if
sep = 'if ' sep = 'if '
break break
for statename in process.cs_mapping.viewkeys() - done: for statename in process.cs_mapping.viewkeys() - done:
need_final_endif = False
cs_item = process.cs_mapping[statename] cs_item = process.cs_mapping[statename]
taste_template.append(u'{first}if not msgPending and ' taste_template.append(u'{first}if not msgPending and '
u'trId = -1 and {}.state = {} then' u'trId = -1 and {}.state = {} then'
...@@ -908,6 +911,9 @@ package {process_name} is'''.format(process_name=process_name, ...@@ -908,6 +911,9 @@ package {process_name} is'''.format(process_name=process_name,
taste_template.append(u'end if;') # current state taste_template.append(u'end if;') # current state
sep = 'if ' sep = 'if '
if need_final_endif:
taste_template.append(u'end if;')
taste_template.append('end loop;') taste_template.append('end loop;')
taste_template.append('{ctxt}.initDone := True;'.format(ctxt=LPREFIX)) taste_template.append('{ctxt}.initDone := True;'.format(ctxt=LPREFIX))
taste_template.append('end runTransition;') taste_template.append('end runTransition;')
......
...@@ -138,7 +138,7 @@ except ImportError: ...@@ -138,7 +138,7 @@ except ImportError:
__all__ = ['opengeode', 'SDL_Scene', 'SDL_View', 'parse'] __all__ = ['opengeode', 'SDL_Scene', 'SDL_View', 'parse']
__version__ = '1.5.7' __version__ = '1.5.8'
if hasattr(sys, 'frozen'): if hasattr(sys, 'frozen'):
# Detect if we are running on Windows (py2exe-generated) # Detect if we are running on Windows (py2exe-generated)
...@@ -2321,7 +2321,11 @@ class OG_MainWindow(QtGui.QMainWindow, object): ...@@ -2321,7 +2321,11 @@ class OG_MainWindow(QtGui.QMainWindow, object):
def set_asn1_view(self, ast): def set_asn1_view(self, ast):
''' Display the ASN.1 types in the dedicated scene ''' ''' Display the ASN.1 types in the dedicated scene '''
# Update the dock widget with ASN.1 files content # Update the dock widget with ASN.1 files content
html_file = open(ast.DV.html, 'r') try:
html_file = open(ast.DV.html, 'r')
except AttributeError:
LOG.debug('set_asn1_view: No ASN.1 file specified')
return
html_content = html_file.read() html_content = html_file.read()
self.asn1_browser.setHtml(html_content) self.asn1_browser.setHtml(html_content)
......
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