@@ 113-130 (lines=18) @@ | ||
110 | else: |
|
111 | attrs.Value = ua.Variant(obj.value, getattr(ua.VariantType, obj.valuetype)) |
|
112 | if obj.rank: |
|
113 | attrs.ValueRank = obj.rank |
|
114 | if obj.accesslevel: |
|
115 | attrs.AccessLevel = obj.accesslevel |
|
116 | if obj.useraccesslevel: |
|
117 | attrs.UserAccessLevel = obj.useraccesslevel |
|
118 | if obj.minsample: |
|
119 | attrs.MinimumSamplingInterval = obj.minsample |
|
120 | if obj.dimensions: |
|
121 | attrs.ArrayDimensions = obj.dimensions |
|
122 | node.NodeAttributes = attrs |
|
123 | self.server.add_nodes([node]) |
|
124 | self._add_refs(obj) |
|
125 | ||
126 | def add_variable_type(self, obj): |
|
127 | node = self._get_node(obj) |
|
128 | attrs = ua.VariableTypeAttributes() |
|
129 | if obj.desc: |
|
130 | attrs.Description = ua.LocalizedText(obj.desc) |
|
131 | attrs.DisplayName = ua.LocalizedText(obj.displayname) |
|
132 | attrs.DataType = self.to_nodeid(obj.datatype) |
|
133 | if obj.value and len(obj.value) == 1: |
|
@@ 132-148 (lines=17) @@ | ||
129 | if obj.desc: |
|
130 | attrs.Description = ua.LocalizedText(obj.desc) |
|
131 | attrs.DisplayName = ua.LocalizedText(obj.displayname) |
|
132 | attrs.DataType = self.to_nodeid(obj.datatype) |
|
133 | if obj.value and len(obj.value) == 1: |
|
134 | attrs.Value = obj.value[0] |
|
135 | if obj.rank: |
|
136 | attrs.ValueRank = obj.rank |
|
137 | if obj.abstract: |
|
138 | attrs.IsAbstract = obj.abstract |
|
139 | if obj.dimensions: |
|
140 | attrs.ArrayDimensions = obj.dimensions |
|
141 | node.NodeAttributes = attrs |
|
142 | self.server.add_nodes([node]) |
|
143 | self._add_refs(obj) |
|
144 | ||
145 | def add_method(self, obj): |
|
146 | node = self._get_node(obj) |
|
147 | attrs = ua.MethodAttributes() |
|
148 | if obj.desc: |
|
149 | attrs.Description = ua.LocalizedText(obj.desc) |
|
150 | attrs.DisplayName = ua.LocalizedText(obj.displayname) |
|
151 | if obj.accesslevel: |