@@ 3657-3727 (lines=71) @@ | ||
3654 | __repr__ = __str__ |
|
3655 | ||
3656 | ||
3657 | class ActivateSessionParameters(FrozenClass): |
|
3658 | ''' |
|
3659 | :ivar ClientSignature: |
|
3660 | :vartype ClientSignature: SignatureData |
|
3661 | :ivar ClientSoftwareCertificates: |
|
3662 | :vartype ClientSoftwareCertificates: SignedSoftwareCertificate |
|
3663 | :ivar LocaleIds: |
|
3664 | :vartype LocaleIds: String |
|
3665 | :ivar UserIdentityToken: |
|
3666 | :vartype UserIdentityToken: ExtensionObject |
|
3667 | :ivar UserTokenSignature: |
|
3668 | :vartype UserTokenSignature: SignatureData |
|
3669 | ''' |
|
3670 | ||
3671 | ua_types = { |
|
3672 | 'ClientSignature': 'SignatureData', |
|
3673 | 'ClientSoftwareCertificates': 'SignedSoftwareCertificate', |
|
3674 | 'LocaleIds': 'String', |
|
3675 | 'UserIdentityToken': 'ExtensionObject', |
|
3676 | 'UserTokenSignature': 'SignatureData', |
|
3677 | } |
|
3678 | ||
3679 | def __init__(self, binary=None): |
|
3680 | if binary is not None: |
|
3681 | self._binary_init(binary) |
|
3682 | self._freeze = True |
|
3683 | return |
|
3684 | self.ClientSignature = SignatureData() |
|
3685 | self.ClientSoftwareCertificates = [] |
|
3686 | self.LocaleIds = [] |
|
3687 | self.UserIdentityToken = None |
|
3688 | self.UserTokenSignature = SignatureData() |
|
3689 | self._freeze = True |
|
3690 | ||
3691 | def to_binary(self): |
|
3692 | packet = [] |
|
3693 | packet.append(self.ClientSignature.to_binary()) |
|
3694 | packet.append(uabin.Primitives.Int32.pack(len(self.ClientSoftwareCertificates))) |
|
3695 | for fieldname in self.ClientSoftwareCertificates: |
|
3696 | packet.append(fieldname.to_binary()) |
|
3697 | packet.append(uabin.Primitives.Int32.pack(len(self.LocaleIds))) |
|
3698 | for fieldname in self.LocaleIds: |
|
3699 | packet.append(uabin.Primitives.String.pack(fieldname)) |
|
3700 | packet.append(extensionobject_to_binary(self.UserIdentityToken)) |
|
3701 | packet.append(self.UserTokenSignature.to_binary()) |
|
3702 | return b''.join(packet) |
|
3703 | ||
3704 | @staticmethod |
|
3705 | def from_binary(data): |
|
3706 | return ActivateSessionParameters(data) |
|
3707 | ||
3708 | def _binary_init(self, data): |
|
3709 | self.ClientSignature = SignatureData.from_binary(data) |
|
3710 | length = uabin.Primitives.Int32.unpack(data) |
|
3711 | array = [] |
|
3712 | if length != -1: |
|
3713 | for _ in range(0, length): |
|
3714 | array.append(SignedSoftwareCertificate.from_binary(data)) |
|
3715 | self.ClientSoftwareCertificates = array |
|
3716 | self.LocaleIds = uabin.Primitives.String.unpack_array(data) |
|
3717 | self.UserIdentityToken = extensionobject_from_binary(data) |
|
3718 | self.UserTokenSignature = SignatureData.from_binary(data) |
|
3719 | ||
3720 | def __str__(self): |
|
3721 | return 'ActivateSessionParameters(' + 'ClientSignature:' + str(self.ClientSignature) + ', ' + \ |
|
3722 | 'ClientSoftwareCertificates:' + str(self.ClientSoftwareCertificates) + ', ' + \ |
|
3723 | 'LocaleIds:' + str(self.LocaleIds) + ', ' + \ |
|
3724 | 'UserIdentityToken:' + str(self.UserIdentityToken) + ', ' + \ |
|
3725 | 'UserTokenSignature:' + str(self.UserTokenSignature) + ')' |
|
3726 | ||
3727 | __repr__ = __str__ |
|
3728 | ||
3729 | ||
3730 | class ActivateSessionRequest(FrozenClass): |
|
@@ 8284-8352 (lines=69) @@ | ||
8281 | ||
8282 | def to_binary(self): |
|
8283 | packet = [] |
|
8284 | packet.append(self.StatusCode.to_binary()) |
|
8285 | packet.append(uabin.Primitives.Int32.pack(len(self.DataStatusCodes))) |
|
8286 | for fieldname in self.DataStatusCodes: |
|
8287 | packet.append(fieldname.to_binary()) |
|
8288 | packet.append(uabin.Primitives.Int32.pack(len(self.DataDiagnosticInfos))) |
|
8289 | for fieldname in self.DataDiagnosticInfos: |
|
8290 | packet.append(fieldname.to_binary()) |
|
8291 | return b''.join(packet) |
|
8292 | ||
8293 | @staticmethod |
|
8294 | def from_binary(data): |
|
8295 | return ParsingResult(data) |
|
8296 | ||
8297 | def _binary_init(self, data): |
|
8298 | self.StatusCode = StatusCode.from_binary(data) |
|
8299 | length = uabin.Primitives.Int32.unpack(data) |
|
8300 | array = [] |
|
8301 | if length != -1: |
|
8302 | for _ in range(0, length): |
|
8303 | array.append(StatusCode.from_binary(data)) |
|
8304 | self.DataStatusCodes = array |
|
8305 | length = uabin.Primitives.Int32.unpack(data) |
|
8306 | array = [] |
|
8307 | if length != -1: |
|
8308 | for _ in range(0, length): |
|
8309 | array.append(DiagnosticInfo.from_binary(data)) |
|
8310 | self.DataDiagnosticInfos = array |
|
8311 | ||
8312 | def __str__(self): |
|
8313 | return 'ParsingResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \ |
|
8314 | 'DataStatusCodes:' + str(self.DataStatusCodes) + ', ' + \ |
|
8315 | 'DataDiagnosticInfos:' + str(self.DataDiagnosticInfos) + ')' |
|
8316 | ||
8317 | __repr__ = __str__ |
|
8318 | ||
8319 | ||
8320 | class QueryFirstParameters(FrozenClass): |
|
8321 | ''' |
|
8322 | :ivar View: |
|
8323 | :vartype View: ViewDescription |
|
8324 | :ivar NodeTypes: |
|
8325 | :vartype NodeTypes: NodeTypeDescription |
|
8326 | :ivar Filter: |
|
8327 | :vartype Filter: ContentFilter |
|
8328 | :ivar MaxDataSetsToReturn: |
|
8329 | :vartype MaxDataSetsToReturn: UInt32 |
|
8330 | :ivar MaxReferencesToReturn: |
|
8331 | :vartype MaxReferencesToReturn: UInt32 |
|
8332 | ''' |
|
8333 | ||
8334 | ua_types = { |
|
8335 | 'View': 'ViewDescription', |
|
8336 | 'NodeTypes': 'NodeTypeDescription', |
|
8337 | 'Filter': 'ContentFilter', |
|
8338 | 'MaxDataSetsToReturn': 'UInt32', |
|
8339 | 'MaxReferencesToReturn': 'UInt32', |
|
8340 | } |
|
8341 | ||
8342 | def __init__(self, binary=None): |
|
8343 | if binary is not None: |
|
8344 | self._binary_init(binary) |
|
8345 | self._freeze = True |
|
8346 | return |
|
8347 | self.View = ViewDescription() |
|
8348 | self.NodeTypes = [] |
|
8349 | self.Filter = ContentFilter() |
|
8350 | self.MaxDataSetsToReturn = 0 |
|
8351 | self.MaxReferencesToReturn = 0 |
|
8352 | self._freeze = True |
|
8353 | ||
8354 | def to_binary(self): |
|
8355 | packet = [] |
|
@@ 9227-9295 (lines=69) @@ | ||
9224 | self._freeze = True |
|
9225 | return |
|
9226 | self.IsReadModified = True |
|
9227 | self.StartTime = datetime.utcnow() |
|
9228 | self.EndTime = datetime.utcnow() |
|
9229 | self.NumValuesPerNode = 0 |
|
9230 | self.ReturnBounds = True |
|
9231 | self._freeze = True |
|
9232 | ||
9233 | def to_binary(self): |
|
9234 | packet = [] |
|
9235 | packet.append(uabin.Primitives.Boolean.pack(self.IsReadModified)) |
|
9236 | packet.append(uabin.Primitives.DateTime.pack(self.StartTime)) |
|
9237 | packet.append(uabin.Primitives.DateTime.pack(self.EndTime)) |
|
9238 | packet.append(uabin.Primitives.UInt32.pack(self.NumValuesPerNode)) |
|
9239 | packet.append(uabin.Primitives.Boolean.pack(self.ReturnBounds)) |
|
9240 | return b''.join(packet) |
|
9241 | ||
9242 | @staticmethod |
|
9243 | def from_binary(data): |
|
9244 | return ReadRawModifiedDetails(data) |
|
9245 | ||
9246 | def _binary_init(self, data): |
|
9247 | self.IsReadModified = uabin.Primitives.Boolean.unpack(data) |
|
9248 | self.StartTime = uabin.Primitives.DateTime.unpack(data) |
|
9249 | self.EndTime = uabin.Primitives.DateTime.unpack(data) |
|
9250 | self.NumValuesPerNode = uabin.Primitives.UInt32.unpack(data) |
|
9251 | self.ReturnBounds = uabin.Primitives.Boolean.unpack(data) |
|
9252 | ||
9253 | def __str__(self): |
|
9254 | return 'ReadRawModifiedDetails(' + 'IsReadModified:' + str(self.IsReadModified) + ', ' + \ |
|
9255 | 'StartTime:' + str(self.StartTime) + ', ' + \ |
|
9256 | 'EndTime:' + str(self.EndTime) + ', ' + \ |
|
9257 | 'NumValuesPerNode:' + str(self.NumValuesPerNode) + ', ' + \ |
|
9258 | 'ReturnBounds:' + str(self.ReturnBounds) + ')' |
|
9259 | ||
9260 | __repr__ = __str__ |
|
9261 | ||
9262 | ||
9263 | class ReadProcessedDetails(FrozenClass): |
|
9264 | ''' |
|
9265 | :ivar StartTime: |
|
9266 | :vartype StartTime: DateTime |
|
9267 | :ivar EndTime: |
|
9268 | :vartype EndTime: DateTime |
|
9269 | :ivar ProcessingInterval: |
|
9270 | :vartype ProcessingInterval: Double |
|
9271 | :ivar AggregateType: |
|
9272 | :vartype AggregateType: NodeId |
|
9273 | :ivar AggregateConfiguration: |
|
9274 | :vartype AggregateConfiguration: AggregateConfiguration |
|
9275 | ''' |
|
9276 | ||
9277 | ua_types = { |
|
9278 | 'StartTime': 'DateTime', |
|
9279 | 'EndTime': 'DateTime', |
|
9280 | 'ProcessingInterval': 'Double', |
|
9281 | 'AggregateType': 'NodeId', |
|
9282 | 'AggregateConfiguration': 'AggregateConfiguration', |
|
9283 | } |
|
9284 | ||
9285 | def __init__(self, binary=None): |
|
9286 | if binary is not None: |
|
9287 | self._binary_init(binary) |
|
9288 | self._freeze = True |
|
9289 | return |
|
9290 | self.StartTime = datetime.utcnow() |
|
9291 | self.EndTime = datetime.utcnow() |
|
9292 | self.ProcessingInterval = 0 |
|
9293 | self.AggregateType = [] |
|
9294 | self.AggregateConfiguration = AggregateConfiguration() |
|
9295 | self._freeze = True |
|
9296 | ||
9297 | def to_binary(self): |
|
9298 | packet = [] |