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