Commit 7200c986 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Flatten the model with proper separator

parent bfb195fd
...@@ -16,7 +16,7 @@ Author: Maxime.Perrotin@esa.int ...@@ -16,7 +16,7 @@ Author: Maxime.Perrotin@esa.int
__author__ = "Maxime Perrotin" __author__ = "Maxime Perrotin"
__license__ = "LGPL v3" __license__ = "LGPL v3"
__version__ = "1.0.2" __version__ = "1.0.3"
__url__ = "http://taste.tuxfamily.org" __url__ = "http://taste.tuxfamily.org"
import os import os
...@@ -89,7 +89,8 @@ def parse_input_files(pr_files, ppty_file): ...@@ -89,7 +89,8 @@ def parse_input_files(pr_files, ppty_file):
for each in stop_conditions: for each in stop_conditions:
stmts, string, local_decl = opengeode.AdaGenerator.expression(each) stmts, string, local_decl = opengeode.AdaGenerator.expression(each)
log.info(string) log.info(string)
# For each stop condition create a new Procedure with a boolean return type # Flatten the process to have the proper state names
opengeode.Helper.flatten(process, sep=u'\u00dc')
process.content.inner_procedures = [] process.content.inner_procedures = []
process.procedures = [] process.procedures = []
process.transitions = [] process.transitions = []
...@@ -97,6 +98,7 @@ def parse_input_files(pr_files, ppty_file): ...@@ -97,6 +98,7 @@ def parse_input_files(pr_files, ppty_file):
process.mapping = {state:[] for state in process.mapping.keys()} process.mapping = {state:[] for state in process.mapping.keys()}
process.processName = '{}_stop_conditions'.format(process.processName) process.processName = '{}_stop_conditions'.format(process.processName)
idx = 0 idx = 0
# For each stop condition create a new Procedure with a boolean return type
for each in stop_conditions: for each in stop_conditions:
proc = opengeode.ogAST.Procedure() proc = opengeode.ogAST.Procedure()
proc.return_type = opengeode.ogParser.BOOLEAN proc.return_type = opengeode.ogParser.BOOLEAN
...@@ -123,7 +125,7 @@ def parse_input_files(pr_files, ppty_file): ...@@ -123,7 +125,7 @@ def parse_input_files(pr_files, ppty_file):
opengeode.AdaGenerator.generate(process, simu=True) opengeode.AdaGenerator.generate(process, simu=True)
# gather asn.1 files and modules # gather asn.1 files and modules
asn1_files = ' '.join(ast[0].asn1_filenames) #'dataview-uniq.asn' asn1_files = ' '.join(ast[0].asn1_filenames)
asn1_modules = ' '.join(name.lower().replace('-', '_') + '.o' asn1_modules = ' '.join(name.lower().replace('-', '_') + '.o'
for name in ast[0].asn1Modules) for name in ast[0].asn1Modules)
with open('Makefile.properties', 'w') as Makefile: with open('Makefile.properties', 'w') as Makefile:
......
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