Commit c8e5ef10 authored by Alexander Schrode's avatar Alexander Schrode Committed by oroulet

add codesys syntax

parent 8923eaca
...@@ -136,6 +136,14 @@ class StructGenerator(object): ...@@ -136,6 +136,14 @@ class StructGenerator(object):
root = obj.getroot() root = obj.getroot()
self._make_model(root) self._make_model(root)
def _is_array_field(name):
if name.startswith("NoOf"):
return True
if name.startswith("__") and name.endswith("Length"):
# Codesys syntax
return True
return False
def _make_model(self, root): def _make_model(self, root):
enums = {} enums = {}
for child in root: for child in root:
...@@ -159,7 +167,7 @@ class StructGenerator(object): ...@@ -159,7 +167,7 @@ class StructGenerator(object):
if xmlfield.tag.endswith("Field"): if xmlfield.tag.endswith("Field"):
name = xmlfield.get("Name") name = xmlfield.get("Name")
_clean_name = clean_name(name) _clean_name = clean_name(name)
if name.startswith("NoOf"): if self._is_array_field(name):
array = True array = True
continue continue
_type = xmlfield.get("TypeName") _type = xmlfield.get("TypeName")
......
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