Commit 41b04177 authored by Gino Tosti's avatar Gino Tosti
Browse files

finalized server xml model

parent 03706a40
......@@ -104,10 +104,10 @@ if __name__ == "__main__":
server.import_xml("$Model")
root = server.get_root_node()
obj=root.get_children()[0].get_children()
get=obj[2].get_children()
obj=root.get_children()[0].get_children()[1].get_children()
get=obj[0].get_children()
checkData(get)
set1= obj[3].get_children()
set1= obj[1].get_children()
checkData(set1)
# starting Server
......
......@@ -4,7 +4,7 @@
* Date: $Date
* Description: $Description !-->
#set $ns=$ns
#set $ns=$str(int($ns)-1)
#set $rr=$int($ns)
<NamespaceUris>
#for $i in $range(0,$rr-1)
......@@ -67,9 +67,10 @@
<Description>The folder of the Assembly Monitoring Variables</Description>
<References>
<Reference ReferenceType="Organizes" IsForward="false">ns=${ns};i=1</Reference>
<Reference ReferenceType="HasTypeDefinition">ns=${ns};i=1</Reference>
<Reference ReferenceType="HasTypeDefinition">i=61</Reference>
#for $idx in $range(0,$x["NRows"])
<Reference ReferenceType="HasProperty">$x['OPC_UA node'][$idx]</Reference>
#set $ss=$x['OPC_UA node'][$idx].split(";")
<Reference ReferenceType="HasProperty">ns=${ns};$ss[1]</Reference>
#end for
</References>
</UAObject>
......@@ -78,9 +79,10 @@
<Description>The folder of the Assembly Setting Variables</Description>
<References>
<Reference ReferenceType="Organizes" IsForward="false">ns=${ns};i=1</Reference>
<Reference ReferenceType="HasTypeDefinition">ns=${ns};i=1</Reference>
<Reference ReferenceType="HasTypeDefinition">i=61</Reference>
#for $idx in $range(0,$y["NRows"])
<Reference ReferenceType="HasProperty">$y['OPC_UA node'][$idx]</Reference>
#set $ss=$y['OPC_UA node'][$idx].split(";")
<Reference ReferenceType="HasProperty">ns=${ns};$ss[1]</Reference>
#end for
</References>
</UAObject>
......@@ -89,10 +91,11 @@
<Description>The folder of the Assembly Setting Variables</Description>
<References>
<Reference ReferenceType="Organizes" IsForward="false">ns=${ns};i=1</Reference>
<Reference ReferenceType="HasTypeDefinition">ns=${ns};i=1</Reference>
<Reference ReferenceType="HasTypeDefinition">i=61</Reference>
#for $idx in $range(0,$m["NRows"])
#if not $m['OPC_UA node'][$idx] in T
<Reference ReferenceType="HasProperty">$m['OPC_UA node'][$idx]</Reference>
#set $ss=$m['OPC_UA node'][$idx].split(";")
<Reference ReferenceType="HasProperty">ns=${ns};$ss[1]</Reference>
#silent T.append($m['OPC_UA node'][$idx])
#end if
#end for
......@@ -103,10 +106,11 @@
<Description>The folder of the Assembly Monitoring Variables</Description>
<References>
<Reference ReferenceType="Organizes" IsForward="false">ns=${ns};i=1</Reference>
<Reference ReferenceType="HasTypeDefinition">ns=${ns};i=1</Reference>
<Reference ReferenceType="HasTypeDefinition">i=61</Reference>
#for $idx in $range(0,$c["NRows"])
#if not $c['OPC_UA node'][$idx] in T
<Reference ReferenceType="HasProperty">$c['OPC_UA node'][$idx]</Reference>
#set $ss=$c['OPC_UA node'][$idx].split(";")
<Reference ReferenceType="HasProperty">ns=${ns};$ss[1]</Reference>
#silent T.append($c['OPC_UA node'][$idx])
#end if
#end for
......@@ -116,6 +120,7 @@
#for $idx in $range(0,$x["NRows"])
#silent L.append($x["Short name"][$idx])
#if not $x['OPC_UA node'][$idx] in N
#set $ss=$x['OPC_UA node'][$idx].split(";")
#if ($x["OPC UA Data type"][$idx]).upper()[-1]==']' ## test for arrays
#set $sp=($x["OPC UA Data type"][$idx].upper()).split("[")
#set $type=$sp[0].capitalize()
......@@ -123,7 +128,7 @@
#set $type=$type.replace("i","I")
#end if
#set $dim=$sp[1].replace("]","")
<UAVariable ArrayDimensions="$dim" NodeId="$x['OPC_UA node'][$idx]" BrowseName="${ns}:$x['Name of command'][$idx]" DataType="$type" ParentNodeId="ns=${ns};i=2" ValueRank="1">
<UAVariable ArrayDimensions="$dim" NodeId="ns=${ns};$ss[1]" BrowseName="${ns}:$x['Name of command'][$idx]" DataType="$type" ParentNodeId="ns=${ns};i=2" ValueRank="1">
<DisplayName>$x['Name of command'][$idx]</DisplayName>
<Description>$x['Description'][$idx]</Description>
<References>
......@@ -136,7 +141,7 @@
#if $type[0]=="U"
#set $type=$type.replace("i","I")
#end if
<UAVariable NodeId="$x['OPC_UA node'][$idx]" BrowseName="${ns}:$x['Name of command'][$idx]" DataType="$type" ParentNodeId="ns=${ns};i=2">
<UAVariable NodeId="ns=${ns};$ss[1]" BrowseName="${ns}:$x['Name of command'][$idx]" DataType="$type" ParentNodeId="ns=${ns};i=2">
<DisplayName>$x['Name of command'][$idx]</DisplayName>
<Description>$x['Description'][$idx]</Description>
<References>
......@@ -163,6 +168,7 @@
#for $idx in $range(0,$y["NRows"])
#silent L.append($y["Short name"][$idx])
#if not $y['OPC_UA node'][$idx] in N
#set $ss=$y['OPC_UA node'][$idx].split(";")
#if ($y["OPC UA Data type"][$idx]).upper()[-1]==']' ## test for arrays
#set $sp=($y["OPC UA Data type"][$idx].upper()).split("[")
#set $type=$sp[0].capitalize()
......@@ -170,7 +176,8 @@
#set $type=$type.replace("i","I")
#end if
#set $dim=$sp[1].replace("]","")
<UAVariable ArrayDimensions="$dim" NodeId="$y['OPC_UA node'][$idx]" BrowseName="${ns}:$y['Name of command'][$idx]" DataType="$type" ParentNodeId="ns=${ns};i=3" UserAccessLevel="3" AccessLevel="3" ValueRank="1">
<UAVariable ArrayDimensions="$dim" NodeId="ns=${ns};$ss[1]" BrowseName="${ns}:$y['Name of command'][$idx]" DataType="$type" ParentNodeId="ns=${ns};i=3" UserAccessLevel="3" AccessLevel="3" ValueRank="1">
<DisplayName>$y['Name of command'][$idx]</DisplayName>
<Description>$y['Description'][$idx]</Description>
<References>
......@@ -184,7 +191,7 @@
#set $type=$type.replace("i","I")
#end if
<UAVariable NodeId="$y['OPC_UA node'][$idx]" BrowseName="${ns}:$y['Name of command'][$idx]" DataType="$type" ParentNodeId="ns=${ns};i=3" UserAccessLevel="3" AccessLevel="3">
<UAVariable NodeId="ns=${ns};$ss[1]" BrowseName="${ns}:$y['Name of command'][$idx]" DataType="$type" ParentNodeId="ns=${ns};i=3" UserAccessLevel="3" AccessLevel="3">
<DisplayName>$y['Name of command'][$idx]</DisplayName>
<Description>$y['Description'][$idx]</Description>
<References>
......@@ -209,12 +216,13 @@
#for $idx in $range(0,$m["NRows"])
#set $name=($m["OPC_UA node"][$idx].split(";")[1]).split("=")[1].replace(".","_")
#if not $name in L
#set $ss=$m['OPC_UA node'][$idx].split(";")
#if not $m['OPC_UA node'][$idx] in N
#set $type=$m["OPC UA Data type"][$idx].capitalize()
#if $type[0]=="U"
#set $type=$type.replace("i","I")
#end if
<UAVariable NodeId="$m['OPC_UA node'][$idx]" BrowseName="${ns}:$name" DataType="$type" ParentNodeId="ns=${ns};i=4" UserAccessLevel="3" AccessLevel="3">
<UAVariable NodeId="ns=${ns};$ss[1]" BrowseName="${ns}:$name" DataType="$type" ParentNodeId="ns=${ns};i=4" UserAccessLevel="3" AccessLevel="3">
<DisplayName>$name</DisplayName>
<Description>$m['Description'][$idx]</Description>
<References>
......@@ -233,12 +241,13 @@
#for $idx in $range(0,$c["NRows"])
#set $name=($c["OPC_UA node"][$idx].split(";")[1]).split("=")[1].replace(".","_")
#if not $name in L
#set $ss=$c['OPC_UA node'][$idx].split(";")
#if not $c['OPC_UA node'][$idx] in N
#set $type=$c["OPC UA Data type"][$idx].capitalize()
#if $type[0]=="U"
#set $type=$type.replace("i","I")
#end if
<UAVariable NodeId="$c['OPC_UA node'][$idx]" BrowseName="${ns}:$c['Name of command'][$idx]" DataType="$type" ParentNodeId="ns=${ns};i=5" UserAccessLevel="3" AccessLevel="3">
<UAVariable NodeId="ns=${ns};$ss[1]" BrowseName="${ns}:$c['Name of command'][$idx]" DataType="$type" ParentNodeId="ns=${ns};i=5" UserAccessLevel="3" AccessLevel="3">
<DisplayName>$c['Name of command'][$idx]</DisplayName>
<Description>$c['Description'][$idx]</Description>
<References>
......
Supports Markdown
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