Skip to content
Snippets Groups Projects
Commit 610abf93 authored by Susanna Weber's avatar Susanna Weber
Browse files

Some more cleaning and commenting

parent f3908fe7
Branches
No related tags found
No related merge requests found
......@@ -367,18 +367,18 @@ def getComponentVarList(searched, list1, component, jsoncomponents):
return list1
def buildComponents(interfacesreturn, variabledict, jsoninterfaces, jsoncomponents, jsonmeasurements, jsonparameters, jsonfunctions, objcomponentsclone, enumnodedict, enumvalues, enumnames):
"""
Iterates recursively through
:param interfacesreturn:
:param variabledict:
:param jsoninterfaces:
:param jsoncomponents:
:param jsonmeasurements:
:param jsonparameters:
:param jsonfunctions:
:param objcomponentsclone:
:param enumnodedict:
def buildComponents(interfacesreturn, jsoninterfaces, jsoncomponents, jsonmeasurements, jsonparameters, jsonfunctions, enumnodedict, enumvalues, enumnames):
"""objcomponentsclone,
Iterates recursively throught the rootcomponent of the interface and its components etc..
With every iteration it collects all variables and functions from each component and their basecomponents,
creates their respective objects and writesthem with the writefunctions from wf.
:param interfacesreturn: a dict in which all created objecttype node names get collect in the Format {uuid : objecttype}
:param jsoninterfaces: a list of all components that get looked at during the one rekursive iteration
:param jsoncomponents: a list of all elements with type component
:param jsonmeasurements: a list of all ements with type measurement
:param jsonparameters: a list with all elements of type parameter
:param jsonfunctions: a list of all elements with type function
:param enumnodedict: a dict with all the enumtypes from the format {uuid : enumtypenodename}
:param enumvalues:
:param enumnames:
:return:
......@@ -408,10 +408,11 @@ def buildComponents(interfacesreturn, variabledict, jsoninterfaces, jsoncomponen
functionobj = getFunctions(objfunctionlist, jsonparameters, jsonmeasurements)
functionvars = getComponentVarList("functions", [], rootobj, jsoncomponents)
wf.writefunction(functionobj, interfacesreturn[str(obj["uuid"])], functionvars.copy())
buildComponents(interfacesreturn, variabledict, objcomponentslist, jsoncomponents, jsonmeasurements, jsonparameters, jsonfunctions, objcomponentsclone, enumnodedict, enumvalues, enumnames)
buildComponents(interfacesreturn, objcomponentslist, jsoncomponents, jsonmeasurements, jsonparameters, jsonfunctions, enumnodedict, enumvalues, enumnames)
return interfacesreturn
def instantiateComponents(typesdict, interfaces, jsoncomponents, instantiatedict, eventsdict, streamsdict, componentlist, headnodeindex, variabledict):
for interface in interfaces:
root = interface
......@@ -497,7 +498,7 @@ def main():
enumnodedict = returnvalenums[0]
enumvalues = returnvalenums[1]
enumnames = returnvalenums[2]
typesdict = buildComponents({}, {}, jsoninterfaces, jsoncomponents, jsonmeasurements, jsonparameters, jsonfunctions, [], enumnodedict, enumvalues, enumnames)
typesdict = buildComponents({}, jsoninterfaces, jsoncomponents, jsonmeasurements, jsonparameters, jsonfunctions, enumnodedict, enumvalues, enumnames)
returnval = instantiate(typesdict, jsoninterfaces, jsoncomponents)
instantiatedict = returnval[0]
eventsdict = returnval[1]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment