Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SOIL2OPC UA Translator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
WZL-IQS-Public
Sensor Interfacing Language (SOIL)
SOIL2OPC UA Translator
Commits
610abf93
Commit
610abf93
authored
1 year ago
by
Susanna Weber
Browse files
Options
Downloads
Patches
Plain Diff
Some more cleaning and commenting
parent
f3908fe7
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
newmodeljsonparse.py
+15
-14
15 additions, 14 deletions
newmodeljsonparse.py
with
15 additions
and
14 deletions
newmodeljsonparse.py
+
15
−
14
View file @
610abf93
...
...
@@ -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
i
n
ter
facesreturn:
:param variabledict:
:param
json
interfaces
:
:param json
components:
:param json
measurements:
:param json
parameters:
:param json
functions:
:param
objcomponentsclone:
:param enumnodedict:
def
buildComponents
(
interfacesreturn
,
jsoninterfaces
,
jsoncomponents
,
jsonmeasurements
,
jsonparameters
,
jsonfunctions
,
enumnodedict
,
enumvalues
,
enumnames
):
"""
objcomponentsclone,
Iterates recursively through
t the rootcomponent of the interface and its components etc..
With every
iter
ation it collects all variables and functions from each component and their basecomponents,
creates their respective objects and writesthem with the writefunctions from wf.
:param interfaces
return: a dict in which all created objecttype node names get collect in the Format {uuid : objecttype}
:param json
interfaces: a list of all components that get looked at during the one rekursive iteration
:param json
components: a list of all elements with type component
:param json
measurements: a list of all ements with type measurement
:param json
parameters: 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
]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment