Commit b0725081 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Merge remote-tracking branch 'origin/feature_buster' into feature_simulation

parents 2acab86c 9dac7def
Pipeline #2452 failed with stage
in 60 minutes and 30 seconds
...@@ -11,7 +11,7 @@ stages: ...@@ -11,7 +11,7 @@ stages:
build: build:
stage: build stage: build
script: script:
- ./configure ; pip3 install --upgrade . ; LANG=C LC_ALL=C PATH=$PATH:/asn1scc make - ./configure ; pip3 install --upgrade . ; pip3 uninstall --yes typing ; LANG=C LC_ALL=C PATH=$PATH:/asn1scc make
# artifacts: # artifacts:
# paths: # paths:
# - 'test/logs/*.err.txt' # - 'test/logs/*.err.txt'
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
import re import re
import os import os
from typing import Union, List # NOQA pylint: disable=unused-import from typing import Union, List, IO, Any # NOQA pylint: disable=unused-import
from ..commonPy import asnParser from ..commonPy import asnParser
from ..commonPy.utility import panic, inform from ..commonPy.utility import panic, inform
...@@ -21,11 +21,11 @@ from ..commonPy.asnParser import AST_Lookup, AST_Leaftypes ...@@ -21,11 +21,11 @@ from ..commonPy.asnParser import AST_Lookup, AST_Leaftypes
from ..commonPy.cleanupNodes import SetOfBadTypenames from ..commonPy.cleanupNodes import SetOfBadTypenames
# The Python file written to # The Python file written to
g_outputFile = None g_outputFile: IO[Any]
# The SETers and GETers files # The SETers and GETers files
g_outputGetSetH = None g_outputGetSetH: IO[Any]
g_outputGetSetC = None g_outputGetSetC: IO[Any]
g_bHasStartupRunOnce = False g_bHasStartupRunOnce = False
......
...@@ -30,7 +30,7 @@ import sys ...@@ -30,7 +30,7 @@ import sys
import re import re
from distutils import spawn from distutils import spawn
from typing import List, Union, Set # NOQA from typing import List, Union, Set, IO, Any # NOQA
from ..commonPy import asnParser from ..commonPy import asnParser
from ..commonPy.utility import panic, inform from ..commonPy.utility import panic, inform
...@@ -44,7 +44,7 @@ from ..commonPy.asnAST import AsnNode # NOQA pylint: disable=unused-import ...@@ -44,7 +44,7 @@ from ..commonPy.asnAST import AsnNode # NOQA pylint: disable=unused-import
from ..commonPy.asnParser import AST_Leaftypes, AST_Lookup from ..commonPy.asnParser import AST_Leaftypes, AST_Lookup
# The file written to # The file written to
g_outputFile = None g_outputFile: IO[Any]
# A map of the ASN.1 types defined so far # A map of the ASN.1 types defined so far
g_definedTypes = set() # type: Set[asnParser.Typename] g_definedTypes = set() # type: Set[asnParser.Typename]
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
# #
import re import re
from typing import Union, Set, List # NOQA pylint: disable=unused-import from typing import Union, Set, List, IO, Any # NOQA pylint: disable=unused-import
from ..commonPy.utility import panic, inform from ..commonPy.utility import panic, inform
from ..commonPy import asnParser from ..commonPy import asnParser
...@@ -37,7 +37,7 @@ from ..commonPy.cleanupNodes import SetOfBadTypenames ...@@ -37,7 +37,7 @@ from ..commonPy.cleanupNodes import SetOfBadTypenames
from ..commonPy.asnParser import AST_Leaftypes, AST_Lookup from ..commonPy.asnParser import AST_Leaftypes, AST_Lookup
# The file written to # The file written to
g_outputFile = None g_outputFile: IO[Any]
# A map of the ASN.1 types defined so far # A map of the ASN.1 types defined so far
g_definedTypes = set() # type: Set[asnParser.Typename] g_definedTypes = set() # type: Set[asnParser.Typename]
......
...@@ -28,7 +28,7 @@ import os ...@@ -28,7 +28,7 @@ import os
import random import random
from xml.dom.minidom import Document, Node # type: ignore # NOQA pylint: disable=unused-import from xml.dom.minidom import Document, Node # type: ignore # NOQA pylint: disable=unused-import
from typing import Union, Set, Dict # NOQA pylint: disable=unused-import from typing import Optional, Union, Set, Dict, IO, Any # NOQA pylint: disable=unused-import
from ..commonPy.utility import inform, panic from ..commonPy.utility import inform, panic
from ..commonPy.asnAST import ( from ..commonPy.asnAST import (
...@@ -47,7 +47,7 @@ g_lookup = { ...@@ -47,7 +47,7 @@ g_lookup = {
} }
# The file written to # The file written to
g_outputFile = None g_outputFile: IO[Any]
# The assigned OIDs # The assigned OIDs
g_oid = {} # type: Dict[str, str] g_oid = {} # type: Dict[str, str]
...@@ -62,7 +62,7 @@ g_currOid = 0x1f00 ...@@ -62,7 +62,7 @@ g_currOid = 0x1f00
g_declaredTypes = set() # type: Set[str] g_declaredTypes = set() # type: Set[str]
# The DOM elements # The DOM elements
g_doc = None g_doc: Document
g_Declarations = None g_Declarations = None
...@@ -142,7 +142,7 @@ def RenderElements(controlString: str) -> None: ...@@ -142,7 +142,7 @@ def RenderElements(controlString: str) -> None:
for elem in controlString.split(","): for elem in controlString.split(","):
if '`' in elem: if '`' in elem:
element = elem.split("`")[0] element = elem.split("`")[0]
under = elem.split("`")[1] under = elem.split("`")[1] # type: Optional[str]
else: else:
element = elem element = elem
under = None under = None
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
# #
import re import re
from typing import Union, Set, List # NOQA pylint: disable=unused-import from typing import Union, Set, List, IO, Any # NOQA pylint: disable=unused-import
from ..commonPy.utility import panic, inform from ..commonPy.utility import panic, inform
from ..commonPy import asnParser from ..commonPy import asnParser
...@@ -35,7 +35,7 @@ from ..commonPy.cleanupNodes import SetOfBadTypenames ...@@ -35,7 +35,7 @@ from ..commonPy.cleanupNodes import SetOfBadTypenames
# The file written to # The file written to
g_outputFile = None g_outputFile: IO[Any]
# A map of the ASN.1 types defined so far # A map of the ASN.1 types defined so far
g_definedTypes = set() # type: Set[str] g_definedTypes = set() # type: Set[str]
......
...@@ -34,11 +34,11 @@ from ..commonPy.cleanupNodes import SetOfBadTypenames ...@@ -34,11 +34,11 @@ from ..commonPy.cleanupNodes import SetOfBadTypenames
from ..commonPy.asnAST import AsnBasicNode, AsnSequenceOrSet, AsnSequenceOrSetOf, AsnEnumerated from ..commonPy.asnAST import AsnBasicNode, AsnSequenceOrSet, AsnSequenceOrSetOf, AsnEnumerated
from ..commonPy.asnParser import AST_Leaftypes from ..commonPy.asnParser import AST_Leaftypes
g_catalogueXML = None # type: IO[Any] g_catalogueXML: IO[Any]
g_innerTypes = set() # type: Set[str] g_innerTypes = set() # type: Set[str]
g_uniqueStringOfASN1files = "" g_uniqueStringOfASN1files = ""
g_outputDir = "." g_outputDir = "."
g_asnFiles = None g_asnFiles: List[str]
def Version() -> None: def Version() -> None:
......
...@@ -35,11 +35,11 @@ from ..commonPy.utility import panic, warn ...@@ -35,11 +35,11 @@ from ..commonPy.utility import panic, warn
from ..commonPy.cleanupNodes import SetOfBadTypenames from ..commonPy.cleanupNodes import SetOfBadTypenames
from ..commonPy.asnParser import AST_Leaftypes from ..commonPy.asnParser import AST_Leaftypes
g_sqlOutput = None # type: IO[Any] g_sqlOutput: IO[Any]
g_innerTypes = set() # type: Set[str] g_innerTypes = set() # type: Set[str]
g_uniqueStringOfASN1files = "" g_uniqueStringOfASN1files = ""
g_outputDir = "." g_outputDir = "."
g_asnFiles = None g_asnFiles: List[str]
# ====== Dummy stubs ===== # ====== Dummy stubs =====
......
...@@ -34,11 +34,11 @@ from ..commonPy.asnParser import g_names, g_leafTypeDict, CleanNameForAST, AST_L ...@@ -34,11 +34,11 @@ from ..commonPy.asnParser import g_names, g_leafTypeDict, CleanNameForAST, AST_L
from ..commonPy.utility import panic, warn from ..commonPy.utility import panic, warn
from ..commonPy.cleanupNodes import SetOfBadTypenames from ..commonPy.cleanupNodes import SetOfBadTypenames
g_sqlalchemyOutput = None # type: IO[Any] g_sqlalchemyOutput: IO[Any]
g_innerTypes = {} # type: Dict[str, int] g_innerTypes = {} # type: Dict[str, int]
g_uniqueStringOfASN1files = "" g_uniqueStringOfASN1files = ""
g_outputDir = "." g_outputDir = "."
g_asnFiles = None # type: Union[str, List[str]] g_asnFiles: Union[str, List[str]]
# ====== Dummy stubs ===== # ====== Dummy stubs =====
......
...@@ -45,7 +45,7 @@ from ..commonPy.asnAST import AsnNode ...@@ -45,7 +45,7 @@ from ..commonPy.asnAST import AsnNode
from ..commonPy.asnParser import AST_Lookup, AST_Leaftypes from ..commonPy.asnParser import AST_Lookup, AST_Leaftypes
isAsynchronous = True isAsynchronous = True
cBackend = None cBackend: c_B_mapper.C_GlueGenerator
def OnStartup(unused_modelingLanguage: str, asnFile: str, outputDir: str, maybeFVname: str, useOSS: bool) -> None: def OnStartup(unused_modelingLanguage: str, asnFile: str, outputDir: str, maybeFVname: str, useOSS: bool) -> None:
......
...@@ -73,11 +73,9 @@ class ASynchronousToolGlueGenerator: ...@@ -73,11 +73,9 @@ class ASynchronousToolGlueGenerator:
def __init__(self) -> None: def __init__(self) -> None:
# The files written to # The files written to
self.C_HeaderFile = None # type: IO[Any]
self.C_SourceFile = None # type: IO[Any]
self.asn_name = "" self.asn_name = ""
self.supportedEncodings = ['native', 'uper', 'acn'] self.supportedEncodings = ['native', 'uper', 'acn']
self.useOSS = None # type: bool self.useOSS = False
self.typesToWorkOn = {} # type: Dict[str, Tuple[AsnNode, AST_Leaftypes, AST_Lookup]] self.typesToWorkOn = {} # type: Dict[str, Tuple[AsnNode, AST_Leaftypes, AST_Lookup]]
def OnStartup(self, modelingLanguage: str, asnFile: str, outputDir: str, maybeFVname: str, useOSS: bool) -> None: def OnStartup(self, modelingLanguage: str, asnFile: str, outputDir: str, maybeFVname: str, useOSS: bool) -> None:
...@@ -89,10 +87,10 @@ class ASynchronousToolGlueGenerator: ...@@ -89,10 +87,10 @@ class ASynchronousToolGlueGenerator:
outputCsourceFilename = self.CleanNameAsToolWants(prefix) + "_ASN1_Types.c" outputCsourceFilename = self.CleanNameAsToolWants(prefix) + "_ASN1_Types.c"
inform(str(self.__class__) + ": Creating file '%s'...", outputCheaderFilename) inform(str(self.__class__) + ": Creating file '%s'...", outputCheaderFilename)
self.C_HeaderFile = open(outputDir + outputCheaderFilename, 'w') self.C_HeaderFile = open(outputDir + outputCheaderFilename, 'w') # pylint: disable=attribute-defined-outside-init
inform(str(self.__class__) + ": Creating file '%s'...", outputCsourceFilename) inform(str(self.__class__) + ": Creating file '%s'...", outputCsourceFilename)
self.C_SourceFile = open(outputDir + outputCsourceFilename, 'w') self.C_SourceFile = open(outputDir + outputCsourceFilename, 'w') # pylint: disable=attribute-defined-outside-init
self.asn_name = os.path.basename(os.path.splitext(asnFile)[0]) self.asn_name = os.path.basename(os.path.splitext(asnFile)[0])
...@@ -118,8 +116,6 @@ class ASynchronousToolGlueGenerator: ...@@ -118,8 +116,6 @@ class ASynchronousToolGlueGenerator:
self.HeadersOnStartup(asnFile, outputDir, maybeFVname) self.HeadersOnStartup(asnFile, outputDir, maybeFVname)
self.typesToWorkOn = {} # type: Dict[str, Tuple[AsnNode, AST_Leaftypes, AST_Lookup]]
def Common(self, nodeTypename: str, node: AsnNode, leafTypeDict: AST_Leaftypes, names: AST_Lookup) -> None: def Common(self, nodeTypename: str, node: AsnNode, leafTypeDict: AST_Leaftypes, names: AST_Lookup) -> None:
# Async backends are different: they work on ASN.1 types, not SP params. # Async backends are different: they work on ASN.1 types, not SP params.
......
...@@ -48,7 +48,6 @@ from ..commonPy.recursiveMapper import RecursiveMapper ...@@ -48,7 +48,6 @@ from ..commonPy.recursiveMapper import RecursiveMapper
from .asynchronousTool import ASynchronousToolGlueGenerator from .asynchronousTool import ASynchronousToolGlueGenerator
isAsynchronous = True isAsynchronous = True
cBackend = None
# noinspection PyListCreation # noinspection PyListCreation
...@@ -429,6 +428,9 @@ class C_GlueGenerator(ASynchronousToolGlueGenerator): ...@@ -429,6 +428,9 @@ class C_GlueGenerator(ASynchronousToolGlueGenerator):
self.C_SourceFile.write("#endif\n\n") self.C_SourceFile.write("#endif\n\n")
cBackend: C_GlueGenerator
def OnStartup(modelingLanguage: str, asnFile: str, outputDir: str, maybeFVname: str, useOSS: bool) -> None: def OnStartup(modelingLanguage: str, asnFile: str, outputDir: str, maybeFVname: str, useOSS: bool) -> None:
global cBackend global cBackend
cBackend = C_GlueGenerator() cBackend = C_GlueGenerator()
......
...@@ -35,20 +35,20 @@ from ..commonPy import asnParser ...@@ -35,20 +35,20 @@ from ..commonPy import asnParser
from ..commonPy.asnParser import AST_Lookup, AST_Leaftypes from ..commonPy.asnParser import AST_Lookup, AST_Leaftypes
from ..commonPy.aadlAST import ApLevelContainer, Param from ..commonPy.aadlAST import ApLevelContainer, Param
g_HeaderFile = None # type: IO[Any] g_HeaderFile: IO[Any]
g_SourceFile = None # type: IO[Any] g_SourceFile: IO[Any]
g_GnuplotFile = None # type: IO[Any] g_GnuplotFile: IO[Any]
g_MyEvents = None g_MyEvents: IO[Any]
g_MyCreation = None g_MyCreation: IO[Any]
g_MyClickPrototypes = None g_MyClickPrototypes: IO[Any]
g_MyAction = None g_MyAction: IO[Any]
g_MyControls = None g_MyControls: IO[Any]
g_MyLoad = None g_MyLoad: IO[Any]
g_MySave = None g_MySave: IO[Any]
g_MyThreadsInc = None g_MyThreadsInc: IO[Any]
g_MyThreadsH = None g_MyThreadsH: IO[Any]
g_MyTelemetryActions = None g_MyTelemetryActions: IO[Any]
g_bStarted = False g_bStarted = False
g_IDs = 20000 g_IDs = 20000
......
...@@ -50,7 +50,7 @@ from .c_B_mapper import C_GlueGenerator ...@@ -50,7 +50,7 @@ from .c_B_mapper import C_GlueGenerator
backend_C = None backend_C = None
backend_uPy = None backend_uPy = None
backends = None backends = [] # type: List[ASynchronousToolGlueGenerator]
# TODO replace most of the typedefs with an include of py/obj.h # TODO replace most of the typedefs with an include of py/obj.h
h_header_str = """ h_header_str = """
...@@ -213,7 +213,7 @@ class MapUPyObjData(RecursiveMapperGeneric[str, str]): ...@@ -213,7 +213,7 @@ class MapUPyObjData(RecursiveMapperGeneric[str, str]):
for child in node._members: for child in node._members:
contained = self.Map(srcVar, destVar, child[1], leafTypeDict, names) contained = self.Map(srcVar, destVar, child[1], leafTypeDict, names)
if contained: if contained:
lines.extend(' ' + l for l in contained[:-1]) lines.extend(' ' + ll for ll in contained[:-1])
lines.append(' %s data_%s;' % (contained[-1], self.CleanName(child[0]))) lines.append(' %s data_%s;' % (contained[-1], self.CleanName(child[0])))
lines.append('}') lines.append('}')
return lines return lines
...@@ -231,7 +231,7 @@ class MapUPyObjData(RecursiveMapperGeneric[str, str]): ...@@ -231,7 +231,7 @@ class MapUPyObjData(RecursiveMapperGeneric[str, str]):
for child in node._members: for child in node._members:
contained = self.Map(srcVar, destVar, child[1], leafTypeDict, names) contained = self.Map(srcVar, destVar, child[1], leafTypeDict, names)
if contained: if contained:
lines.extend(' ' + l for l in contained[:-1]) lines.extend(' ' + ll for ll in contained[:-1])
lines.append(' %s %s;' % (contained[-1], self.CleanName(child[0]))) lines.append(' %s %s;' % (contained[-1], self.CleanName(child[0])))
lines.append(' } data;') lines.append(' } data;')
lines.append('}') lines.append('}')
...@@ -246,7 +246,7 @@ class MapUPyObjData(RecursiveMapperGeneric[str, str]): ...@@ -246,7 +246,7 @@ class MapUPyObjData(RecursiveMapperGeneric[str, str]):
] ]
contained = self.Map(srcVar, destVar, node._containedType, leafTypeDict, names) contained = self.Map(srcVar, destVar, node._containedType, leafTypeDict, names)
if contained: if contained:
lines.extend(' ' + l for l in contained[:-1]) lines.extend(' ' + ll for ll in contained[:-1])
lines.append(' %s data[%u];' % (contained[-1], num_items)) lines.append(' %s data[%u];' % (contained[-1], num_items))
lines.append('}') lines.append('}')
return lines return lines
...@@ -346,8 +346,8 @@ class MapUPyObjEncode(RecursiveMapperGeneric[str, Tuple[str, str]]): ...@@ -346,8 +346,8 @@ class MapUPyObjEncode(RecursiveMapperGeneric[str, Tuple[str, str]]):
]) ])
for it, child in enumerate(node._members): for it, child in enumerate(node._members):
lines.append('%sif ((%s).kind == %s) {' % ('else ' if it else '', srcVar, self.CleanName(child[2]))) lines.append('%sif ((%s).kind == %s) {' % ('else ' if it else '', srcVar, self.CleanName(child[2])))
lines.extend(' ' + l lines.extend(' ' + ll
for l in self.Map( for ll in self.Map(
"(%s).u.%s" % (srcVar, self.CleanName(child[0])), "(%s).u.%s" % (srcVar, self.CleanName(child[0])),
('(%s)->items[0]' % data, '&(%s)->data.%s' % (data, self.CleanName(child[0]))), ('(%s)->items[0]' % data, '&(%s)->data.%s' % (data, self.CleanName(child[0]))),
child[1], child[1],
...@@ -370,8 +370,8 @@ class MapUPyObjEncode(RecursiveMapperGeneric[str, Tuple[str, str]]): ...@@ -370,8 +370,8 @@ class MapUPyObjEncode(RecursiveMapperGeneric[str, Tuple[str, str]]):
'(%s)->list.items = &(%s)->items[0];' % (data, data), '(%s)->list.items = &(%s)->items[0];' % (data, data),
'for (size_t %s = 0; %s < %s; ++%s) {' % (it, it, limit, it), 'for (size_t %s = 0; %s < %s; ++%s) {' % (it, it, limit, it),
] ]
lines.extend(' ' + l lines.extend(' ' + ll
for l in self.Map( for ll in self.Map(
'(%s).arr[%s]' % (srcVar, it), '(%s).arr[%s]' % (srcVar, it),
('(%s)->items[%s]' % (data, it), '&(%s)->data[%s]' % (data, it)), ('(%s)->items[%s]' % (data, it), '&(%s)->data[%s]' % (data, it)),
node._containedType, leafTypeDict, names)) node._containedType, leafTypeDict, names))
...@@ -446,8 +446,8 @@ class MapUPyObjDecode(RecursiveMapperGeneric[str, str]): ...@@ -446,8 +446,8 @@ class MapUPyObjDecode(RecursiveMapperGeneric[str, str]):
lines.append('extern qstr %s[1];' % f) lines.append('extern qstr %s[1];' % f)
for it, child in enumerate(node._members): for it, child in enumerate(node._members):
lines.append('%sif (MP_OBJ_TO_PTR(((mp_obj_tuple_t*)MP_OBJ_TO_PTR(%s))->items[1]) == %s) {' % ('else ' if it else '', srcVar, fields_names[it])) lines.append('%sif (MP_OBJ_TO_PTR(((mp_obj_tuple_t*)MP_OBJ_TO_PTR(%s))->items[1]) == %s) {' % ('else ' if it else '', srcVar, fields_names[it]))
lines.extend(' ' + l lines.extend(' ' + ll
for l in self.Map( for ll in self.Map(
'((mp_obj_tuple_t*)MP_OBJ_TO_PTR(%s))->items[0]' % srcVar, '((mp_obj_tuple_t*)MP_OBJ_TO_PTR(%s))->items[0]' % srcVar,
'(%s).u.%s' % (destVar, self.CleanName(child[0])), '(%s).u.%s' % (destVar, self.CleanName(child[0])),
child[1], child[1],
...@@ -467,8 +467,8 @@ class MapUPyObjDecode(RecursiveMapperGeneric[str, str]): ...@@ -467,8 +467,8 @@ class MapUPyObjDecode(RecursiveMapperGeneric[str, str]):
lines = [ lines = [
'for (size_t %s = 0; %s < %s; ++%s) {' % (it, it, limit, it), 'for (size_t %s = 0; %s < %s; ++%s) {' % (it, it, limit, it),
] ]
lines.extend(' ' + l lines.extend(' ' + ll
for l in self.Map( for ll in self.Map(
'((mp_obj_list_t*)MP_OBJ_TO_PTR(%s))->items[%s]' % (srcVar, it), '((mp_obj_list_t*)MP_OBJ_TO_PTR(%s))->items[%s]' % (srcVar, it),
'%s.arr[%s]' % (destVar, it), '%s.arr[%s]' % (destVar, it),
node._containedType, leafTypeDict, names)) node._containedType, leafTypeDict, names))
...@@ -548,7 +548,7 @@ class MicroPython_GlueGenerator(ASynchronousToolGlueGenerator): ...@@ -548,7 +548,7 @@ class MicroPython_GlueGenerator(ASynchronousToolGlueGenerator):
if dataType == 'void': if dataType == 'void':
lines.append(' (void)pData;') # suppress C compiler warning lines.append(' (void)pData;') # suppress C compiler warning
lines.append(' mp_obj_t o;') lines.append(' mp_obj_t o;')
lines.extend(' ' + l for l in self.MapUPyObjEncode.Map('*pVal', ('o', 'pData'), node, leafTypeDict, names)) lines.extend(' ' + ll for ll in self.MapUPyObjEncode.Map('*pVal', ('o', 'pData'), node, leafTypeDict, names))
lines.append(' return o;') lines.append(' return o;')
lines.append('}') lines.append('}')
self.C_SourceFile.write('\n'.join(lines) + '\n\n') self.C_SourceFile.write('\n'.join(lines) + '\n\n')
...@@ -573,7 +573,7 @@ class MicroPython_GlueGenerator(ASynchronousToolGlueGenerator): ...@@ -573,7 +573,7 @@ class MicroPython_GlueGenerator(ASynchronousToolGlueGenerator):
lines = [] lines = []
lines.append('void mp_obj_decode_asn1Scc%s(mp_obj_t obj, asn1Scc%s *pVal) {' % (tname, tname)) lines.append('void mp_obj_decode_asn1Scc%s(mp_obj_t obj, asn1Scc%s *pVal) {' % (tname, tname))
lines.extend(' ' + l for l in self.MapUPyObjDecode.Map('obj', '(*pVal)', node, leafTypeDict, names)) lines.extend(' ' + ll for ll in self.MapUPyObjDecode.Map('obj', '(*pVal)', node, leafTypeDict, names))
lines.append('}') lines.append('}')
self.C_SourceFile.write('\n'.join(lines) + '\n\n') self.C_SourceFile.write('\n'.join(lines) + '\n\n')
......
...@@ -100,7 +100,6 @@ from ..commonPy.recursiveMapper import RecursiveMapper ...@@ -100,7 +100,6 @@ from ..commonPy.recursiveMapper import RecursiveMapper
from .asynchronousTool import ASynchronousToolGlueGenerator from .asynchronousTool import ASynchronousToolGlueGenerator
isAsynchronous = True isAsynchronous = True
ogBackend = None
# noinspection PyListCreation # noinspection PyListCreation
...@@ -800,6 +799,9 @@ class OG_GlueGenerator(ASynchronousToolGlueGenerator): ...@@ -800,6 +799,9 @@ class OG_GlueGenerator(ASynchronousToolGlueGenerator):
# (self.CleanNameAsToolWants(nodeTypename), self.CleanNameAsToolWants(nodeTypename))) # (self.CleanNameAsToolWants(nodeTypename), self.CleanNameAsToolWants(nodeTypename)))
ogBackend: OG_GlueGenerator
def OnStartup(modelingLanguage: str, asnFile: str, outputDir: str, maybeFVname: str, useOSS: bool) -> None: def OnStartup(modelingLanguage: str, asnFile: str, outputDir: str, maybeFVname: str, useOSS: bool) -> None:
global ogBackend global ogBackend
ogBackend = OG_GlueGenerator() ogBackend = OG_GlueGenerator()
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
import re import re
import os import os
from typing import List from typing import List, IO, Any
from ..commonPy.asnAST import ( from ..commonPy.asnAST import (
AsnInt, AsnBool, AsnReal, AsnEnumerated, AsnInt, AsnBool, AsnReal, AsnEnumerated,
...@@ -14,13 +14,13 @@ from ..commonPy.utility import panic ...@@ -14,13 +14,13 @@ from ..commonPy.utility import panic
from ..commonPy.asnParser import AST_Lookup, AST_Leaftypes from ..commonPy.asnParser import AST_Lookup, AST_Leaftypes
from ..commonPy.aadlAST import ApLevelContainer, Param from ..commonPy.aadlAST import ApLevelContainer, Param
g_PyDataModel = None g_PyDataModel: IO[Any]
g_iter = 1 g_iter = 1
g_IFCount = 0 g_IFCount = 0
g_BackendFile = None g_BackendFile: IO[Any]
g_fromPysideToASN1 = [] # type: List[str] g_fromPysideToASN1 = [] # type: List[str]
g_fromASN1ToPyside = [] # type: List[str] g_fromASN1ToPyside = [] # type: List[str]
g_QUiFile = None g_QUiFile: IO[Any]
g_bStarted = False # type: bool g_bStarted = False # type: bool
g_firstElem = True # type: bool g_firstElem = True # type: bool
g_asnId = "" # type: str g_asnId = "" # type: str
......