@@ 1130-1191 (lines=62) @@ | ||
1127 | ] |
|
1128 | ||
1129 | def __init__(self): |
|
1130 | self._freeze = True |
|
1131 | ||
1132 | def to_binary(self): |
|
1133 | packet = [] |
|
1134 | return b''.join(packet) |
|
1135 | ||
1136 | @staticmethod |
|
1137 | def from_binary(data): |
|
1138 | obj = Union() |
|
1139 | return obj |
|
1140 | ||
1141 | def __str__(self): |
|
1142 | return 'Union(' + + ')' |
|
1143 | ||
1144 | __repr__ = __str__ |
|
1145 | ||
1146 | ||
1147 | class TimeZoneDataType(FrozenClass): |
|
1148 | ''' |
|
1149 | :ivar Offset: |
|
1150 | :vartype Offset: Int16 |
|
1151 | :ivar DaylightSavingInOffset: |
|
1152 | :vartype DaylightSavingInOffset: Boolean |
|
1153 | ''' |
|
1154 | ||
1155 | ua_types = [ |
|
1156 | ('Offset', 'Int16'), |
|
1157 | ('DaylightSavingInOffset', 'Boolean'), |
|
1158 | ] |
|
1159 | ||
1160 | def __init__(self): |
|
1161 | self.Offset = 0 |
|
1162 | self.DaylightSavingInOffset = True |
|
1163 | self._freeze = True |
|
1164 | ||
1165 | def to_binary(self): |
|
1166 | packet = [] |
|
1167 | packet.append(uabin.Primitives.Int16.pack(self.Offset)) |
|
1168 | packet.append(uabin.Primitives.Boolean.pack(self.DaylightSavingInOffset)) |
|
1169 | return b''.join(packet) |
|
1170 | ||
1171 | @staticmethod |
|
1172 | def from_binary(data): |
|
1173 | obj = TimeZoneDataType() |
|
1174 | self.Offset = uabin.Primitives.Int16.unpack(data) |
|
1175 | self.DaylightSavingInOffset = uabin.Primitives.Boolean.unpack(data) |
|
1176 | return obj |
|
1177 | ||
1178 | def __str__(self): |
|
1179 | return 'TimeZoneDataType(' + 'Offset:' + str(self.Offset) + ', ' + \ |
|
1180 | 'DaylightSavingInOffset:' + str(self.DaylightSavingInOffset) + ')' |
|
1181 | ||
1182 | __repr__ = __str__ |
|
1183 | ||
1184 | ||
1185 | class ApplicationDescription(FrozenClass): |
|
1186 | ''' |
|
1187 | Describes an application and how to find it. |
|
1188 | ||
1189 | :ivar ApplicationUri: |
|
1190 | :vartype ApplicationUri: String |
|
1191 | :ivar ProductUri: |
|
1192 | :vartype ProductUri: String |
|
1193 | :ivar ApplicationName: |
|
1194 | :vartype ApplicationName: LocalizedText |
|
@@ 15025-15084 (lines=60) @@ | ||
15022 | extension_object_classes[nid] = DataTypeAttributes |
|
15023 | extension_object_ids['DataTypeAttributes'] = nid |
|
15024 | nid = FourByteNodeId(ObjectIds.ViewAttributes_Encoding_DefaultBinary) |
|
15025 | extension_object_classes[nid] = ViewAttributes |
|
15026 | extension_object_ids['ViewAttributes'] = nid |
|
15027 | nid = FourByteNodeId(ObjectIds.AddNodesItem_Encoding_DefaultBinary) |
|
15028 | extension_object_classes[nid] = AddNodesItem |
|
15029 | extension_object_ids['AddNodesItem'] = nid |
|
15030 | nid = FourByteNodeId(ObjectIds.AddNodesResult_Encoding_DefaultBinary) |
|
15031 | extension_object_classes[nid] = AddNodesResult |
|
15032 | extension_object_ids['AddNodesResult'] = nid |
|
15033 | nid = FourByteNodeId(ObjectIds.AddNodesRequest_Encoding_DefaultBinary) |
|
15034 | extension_object_classes[nid] = AddNodesRequest |
|
15035 | extension_object_ids['AddNodesRequest'] = nid |
|
15036 | nid = FourByteNodeId(ObjectIds.AddNodesResponse_Encoding_DefaultBinary) |
|
15037 | extension_object_classes[nid] = AddNodesResponse |
|
15038 | extension_object_ids['AddNodesResponse'] = nid |
|
15039 | nid = FourByteNodeId(ObjectIds.AddReferencesItem_Encoding_DefaultBinary) |
|
15040 | extension_object_classes[nid] = AddReferencesItem |
|
15041 | extension_object_ids['AddReferencesItem'] = nid |
|
15042 | nid = FourByteNodeId(ObjectIds.AddReferencesRequest_Encoding_DefaultBinary) |
|
15043 | extension_object_classes[nid] = AddReferencesRequest |
|
15044 | extension_object_ids['AddReferencesRequest'] = nid |
|
15045 | nid = FourByteNodeId(ObjectIds.AddReferencesResponse_Encoding_DefaultBinary) |
|
15046 | extension_object_classes[nid] = AddReferencesResponse |
|
15047 | extension_object_ids['AddReferencesResponse'] = nid |
|
15048 | nid = FourByteNodeId(ObjectIds.DeleteNodesItem_Encoding_DefaultBinary) |
|
15049 | extension_object_classes[nid] = DeleteNodesItem |
|
15050 | extension_object_ids['DeleteNodesItem'] = nid |
|
15051 | nid = FourByteNodeId(ObjectIds.DeleteNodesRequest_Encoding_DefaultBinary) |
|
15052 | extension_object_classes[nid] = DeleteNodesRequest |
|
15053 | extension_object_ids['DeleteNodesRequest'] = nid |
|
15054 | nid = FourByteNodeId(ObjectIds.DeleteNodesResponse_Encoding_DefaultBinary) |
|
15055 | extension_object_classes[nid] = DeleteNodesResponse |
|
15056 | extension_object_ids['DeleteNodesResponse'] = nid |
|
15057 | nid = FourByteNodeId(ObjectIds.DeleteReferencesItem_Encoding_DefaultBinary) |
|
15058 | extension_object_classes[nid] = DeleteReferencesItem |
|
15059 | extension_object_ids['DeleteReferencesItem'] = nid |
|
15060 | nid = FourByteNodeId(ObjectIds.DeleteReferencesRequest_Encoding_DefaultBinary) |
|
15061 | extension_object_classes[nid] = DeleteReferencesRequest |
|
15062 | extension_object_ids['DeleteReferencesRequest'] = nid |
|
15063 | nid = FourByteNodeId(ObjectIds.DeleteReferencesResponse_Encoding_DefaultBinary) |
|
15064 | extension_object_classes[nid] = DeleteReferencesResponse |
|
15065 | extension_object_ids['DeleteReferencesResponse'] = nid |
|
15066 | nid = FourByteNodeId(ObjectIds.ViewDescription_Encoding_DefaultBinary) |
|
15067 | extension_object_classes[nid] = ViewDescription |
|
15068 | extension_object_ids['ViewDescription'] = nid |
|
15069 | nid = FourByteNodeId(ObjectIds.BrowseDescription_Encoding_DefaultBinary) |
|
15070 | extension_object_classes[nid] = BrowseDescription |
|
15071 | extension_object_ids['BrowseDescription'] = nid |
|
15072 | nid = FourByteNodeId(ObjectIds.ReferenceDescription_Encoding_DefaultBinary) |
|
15073 | extension_object_classes[nid] = ReferenceDescription |
|
15074 | extension_object_ids['ReferenceDescription'] = nid |
|
15075 | nid = FourByteNodeId(ObjectIds.BrowseResult_Encoding_DefaultBinary) |
|
15076 | extension_object_classes[nid] = BrowseResult |
|
15077 | extension_object_ids['BrowseResult'] = nid |
|
15078 | nid = FourByteNodeId(ObjectIds.BrowseRequest_Encoding_DefaultBinary) |
|
15079 | extension_object_classes[nid] = BrowseRequest |
|
15080 | extension_object_ids['BrowseRequest'] = nid |
|
15081 | nid = FourByteNodeId(ObjectIds.BrowseResponse_Encoding_DefaultBinary) |
|
15082 | extension_object_classes[nid] = BrowseResponse |
|
15083 | extension_object_ids['BrowseResponse'] = nid |
|
15084 | nid = FourByteNodeId(ObjectIds.BrowseNextRequest_Encoding_DefaultBinary) |
|
15085 | extension_object_classes[nid] = BrowseNextRequest |
|
15086 | extension_object_ids['BrowseNextRequest'] = nid |
|
15087 | nid = FourByteNodeId(ObjectIds.BrowseNextResponse_Encoding_DefaultBinary) |
|
@@ 4151-4210 (lines=60) @@ | ||
4148 | obj.DisplayName = LocalizedText.from_binary(data) |
|
4149 | obj.Description = LocalizedText.from_binary(data) |
|
4150 | self.WriteMask = uabin.Primitives.UInt32.unpack(data) |
|
4151 | self.UserWriteMask = uabin.Primitives.UInt32.unpack(data) |
|
4152 | obj.Value = Variant.from_binary(data) |
|
4153 | obj.DataType = NodeId.from_binary(data) |
|
4154 | self.ValueRank = uabin.Primitives.Int32.unpack(data) |
|
4155 | obj.ArrayDimensions = uabin.Primitives.UInt32.unpack_array(data) |
|
4156 | self.AccessLevel = uabin.Primitives.Byte.unpack(data) |
|
4157 | self.UserAccessLevel = uabin.Primitives.Byte.unpack(data) |
|
4158 | self.MinimumSamplingInterval = uabin.Primitives.Double.unpack(data) |
|
4159 | self.Historizing = uabin.Primitives.Boolean.unpack(data) |
|
4160 | return obj |
|
4161 | ||
4162 | def __str__(self): |
|
4163 | return 'VariableAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \ |
|
4164 | 'DisplayName:' + str(self.DisplayName) + ', ' + \ |
|
4165 | 'Description:' + str(self.Description) + ', ' + \ |
|
4166 | 'WriteMask:' + str(self.WriteMask) + ', ' + \ |
|
4167 | 'UserWriteMask:' + str(self.UserWriteMask) + ', ' + \ |
|
4168 | 'Value:' + str(self.Value) + ', ' + \ |
|
4169 | 'DataType:' + str(self.DataType) + ', ' + \ |
|
4170 | 'ValueRank:' + str(self.ValueRank) + ', ' + \ |
|
4171 | 'ArrayDimensions:' + str(self.ArrayDimensions) + ', ' + \ |
|
4172 | 'AccessLevel:' + str(self.AccessLevel) + ', ' + \ |
|
4173 | 'UserAccessLevel:' + str(self.UserAccessLevel) + ', ' + \ |
|
4174 | 'MinimumSamplingInterval:' + str(self.MinimumSamplingInterval) + ', ' + \ |
|
4175 | 'Historizing:' + str(self.Historizing) + ')' |
|
4176 | ||
4177 | __repr__ = __str__ |
|
4178 | ||
4179 | ||
4180 | class MethodAttributes(FrozenClass): |
|
4181 | ''' |
|
4182 | The attributes for a method node. |
|
4183 | ||
4184 | :ivar SpecifiedAttributes: |
|
4185 | :vartype SpecifiedAttributes: UInt32 |
|
4186 | :ivar DisplayName: |
|
4187 | :vartype DisplayName: LocalizedText |
|
4188 | :ivar Description: |
|
4189 | :vartype Description: LocalizedText |
|
4190 | :ivar WriteMask: |
|
4191 | :vartype WriteMask: UInt32 |
|
4192 | :ivar UserWriteMask: |
|
4193 | :vartype UserWriteMask: UInt32 |
|
4194 | :ivar Executable: |
|
4195 | :vartype Executable: Boolean |
|
4196 | :ivar UserExecutable: |
|
4197 | :vartype UserExecutable: Boolean |
|
4198 | ''' |
|
4199 | ||
4200 | ua_types = [ |
|
4201 | ('SpecifiedAttributes', 'UInt32'), |
|
4202 | ('DisplayName', 'LocalizedText'), |
|
4203 | ('Description', 'LocalizedText'), |
|
4204 | ('WriteMask', 'UInt32'), |
|
4205 | ('UserWriteMask', 'UInt32'), |
|
4206 | ('Executable', 'Boolean'), |
|
4207 | ('UserExecutable', 'Boolean'), |
|
4208 | ] |
|
4209 | ||
4210 | def __init__(self): |
|
4211 | self.SpecifiedAttributes = 0 |
|
4212 | self.DisplayName = LocalizedText() |
|
4213 | self.Description = LocalizedText() |
|
@@ 7731-7788 (lines=58) @@ | ||
7728 | def __str__(self): |
|
7729 | return 'ParsingResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \ |
|
7730 | 'DataStatusCodes:' + str(self.DataStatusCodes) + ', ' + \ |
|
7731 | 'DataDiagnosticInfos:' + str(self.DataDiagnosticInfos) + ')' |
|
7732 | ||
7733 | __repr__ = __str__ |
|
7734 | ||
7735 | ||
7736 | class QueryFirstParameters(FrozenClass): |
|
7737 | ''' |
|
7738 | :ivar View: |
|
7739 | :vartype View: ViewDescription |
|
7740 | :ivar NodeTypes: |
|
7741 | :vartype NodeTypes: NodeTypeDescription |
|
7742 | :ivar Filter: |
|
7743 | :vartype Filter: ContentFilter |
|
7744 | :ivar MaxDataSetsToReturn: |
|
7745 | :vartype MaxDataSetsToReturn: UInt32 |
|
7746 | :ivar MaxReferencesToReturn: |
|
7747 | :vartype MaxReferencesToReturn: UInt32 |
|
7748 | ''' |
|
7749 | ||
7750 | ua_types = [ |
|
7751 | ('View', 'ViewDescription'), |
|
7752 | ('NodeTypes', 'ListOfNodeTypeDescription'), |
|
7753 | ('Filter', 'ContentFilter'), |
|
7754 | ('MaxDataSetsToReturn', 'UInt32'), |
|
7755 | ('MaxReferencesToReturn', 'UInt32'), |
|
7756 | ] |
|
7757 | ||
7758 | def __init__(self): |
|
7759 | self.View = ViewDescription() |
|
7760 | self.NodeTypes = [] |
|
7761 | self.Filter = ContentFilter() |
|
7762 | self.MaxDataSetsToReturn = 0 |
|
7763 | self.MaxReferencesToReturn = 0 |
|
7764 | self._freeze = True |
|
7765 | ||
7766 | def to_binary(self): |
|
7767 | packet = [] |
|
7768 | packet.append(self.View.to_binary()) |
|
7769 | packet.append(uabin.Primitives.Int32.pack(len(self.NodeTypes))) |
|
7770 | for fieldname in self.NodeTypes: |
|
7771 | packet.append(fieldname.to_binary()) |
|
7772 | packet.append(self.Filter.to_binary()) |
|
7773 | packet.append(uabin.Primitives.UInt32.pack(self.MaxDataSetsToReturn)) |
|
7774 | packet.append(uabin.Primitives.UInt32.pack(self.MaxReferencesToReturn)) |
|
7775 | return b''.join(packet) |
|
7776 | ||
7777 | @staticmethod |
|
7778 | def from_binary(data): |
|
7779 | obj = QueryFirstParameters() |
|
7780 | obj.View = ViewDescription.from_binary(data) |
|
7781 | length = uabin.Primitives.Int32.unpack(data) |
|
7782 | array = [] |
|
7783 | if length != -1: |
|
7784 | for _ in range(0, length): |
|
7785 | array.append(NodeTypeDescription.from_binary(data)) |
|
7786 | obj.NodeTypes = array |
|
7787 | obj.Filter = ContentFilter.from_binary(data) |
|
7788 | self.MaxDataSetsToReturn = uabin.Primitives.UInt32.unpack(data) |
|
7789 | self.MaxReferencesToReturn = uabin.Primitives.UInt32.unpack(data) |
|
7790 | return obj |
|
7791 |