@@ 11726-11780 (lines=55) @@ | ||
11723 | def to_binary(self): |
|
11724 | packet = [] |
|
11725 | packet.append(uabin.Primitives.UInt32.pack(self.ClientHandle)) |
|
11726 | packet.append(uabin.Primitives.Double.pack(self.SamplingInterval)) |
|
11727 | packet.append(extensionobject_to_binary(self.Filter)) |
|
11728 | packet.append(uabin.Primitives.UInt32.pack(self.QueueSize)) |
|
11729 | packet.append(uabin.Primitives.Boolean.pack(self.DiscardOldest)) |
|
11730 | return b''.join(packet) |
|
11731 | ||
11732 | @staticmethod |
|
11733 | def from_binary(data): |
|
11734 | return MonitoringParameters(data) |
|
11735 | ||
11736 | def _binary_init(self, data): |
|
11737 | self.ClientHandle = uabin.Primitives.UInt32.unpack(data) |
|
11738 | self.SamplingInterval = uabin.Primitives.Double.unpack(data) |
|
11739 | self.Filter = extensionobject_from_binary(data) |
|
11740 | self.QueueSize = uabin.Primitives.UInt32.unpack(data) |
|
11741 | self.DiscardOldest = uabin.Primitives.Boolean.unpack(data) |
|
11742 | ||
11743 | def __str__(self): |
|
11744 | return 'MonitoringParameters(' + 'ClientHandle:' + str(self.ClientHandle) + ', ' + \ |
|
11745 | 'SamplingInterval:' + str(self.SamplingInterval) + ', ' + \ |
|
11746 | 'Filter:' + str(self.Filter) + ', ' + \ |
|
11747 | 'QueueSize:' + str(self.QueueSize) + ', ' + \ |
|
11748 | 'DiscardOldest:' + str(self.DiscardOldest) + ')' |
|
11749 | ||
11750 | __repr__ = __str__ |
|
11751 | ||
11752 | ||
11753 | class MonitoredItemCreateRequest(FrozenClass): |
|
11754 | ''' |
|
11755 | :ivar ItemToMonitor: |
|
11756 | :vartype ItemToMonitor: ReadValueId |
|
11757 | :ivar MonitoringMode: |
|
11758 | :vartype MonitoringMode: MonitoringMode |
|
11759 | :ivar RequestedParameters: |
|
11760 | :vartype RequestedParameters: MonitoringParameters |
|
11761 | ''' |
|
11762 | ||
11763 | ua_types = ( |
|
11764 | ||
11765 | ('ItemToMonitor', 'ReadValueId'), |
|
11766 | ('MonitoringMode', 'MonitoringMode'), |
|
11767 | ('RequestedParameters', 'MonitoringParameters'), |
|
11768 | ) |
|
11769 | ||
11770 | def __init__(self, binary=None): |
|
11771 | if binary is not None: |
|
11772 | self._binary_init(binary) |
|
11773 | self._freeze = True |
|
11774 | return |
|
11775 | self.ItemToMonitor = ReadValueId() |
|
11776 | self.MonitoringMode = MonitoringMode(0) |
|
11777 | self.RequestedParameters = MonitoringParameters() |
|
11778 | self._freeze = True |
|
11779 | ||
11780 | def to_binary(self): |
|
11781 | packet = [] |
|
11782 | packet.append(self.ItemToMonitor.to_binary()) |
|
11783 | packet.append(uabin.Primitives.UInt32.pack(self.MonitoringMode.value)) |
|
@@ 11448-11502 (lines=55) @@ | ||
11445 | self.UseServerCapabilitiesDefaults = True |
|
11446 | self.TreatUncertainAsBad = True |
|
11447 | self.PercentDataBad = 0 |
|
11448 | self.PercentDataGood = 0 |
|
11449 | self.UseSlopedExtrapolation = True |
|
11450 | self._freeze = True |
|
11451 | ||
11452 | def to_binary(self): |
|
11453 | packet = [] |
|
11454 | packet.append(uabin.Primitives.Boolean.pack(self.UseServerCapabilitiesDefaults)) |
|
11455 | packet.append(uabin.Primitives.Boolean.pack(self.TreatUncertainAsBad)) |
|
11456 | packet.append(uabin.Primitives.Byte.pack(self.PercentDataBad)) |
|
11457 | packet.append(uabin.Primitives.Byte.pack(self.PercentDataGood)) |
|
11458 | packet.append(uabin.Primitives.Boolean.pack(self.UseSlopedExtrapolation)) |
|
11459 | return b''.join(packet) |
|
11460 | ||
11461 | @staticmethod |
|
11462 | def from_binary(data): |
|
11463 | return AggregateConfiguration(data) |
|
11464 | ||
11465 | def _binary_init(self, data): |
|
11466 | self.UseServerCapabilitiesDefaults = uabin.Primitives.Boolean.unpack(data) |
|
11467 | self.TreatUncertainAsBad = uabin.Primitives.Boolean.unpack(data) |
|
11468 | self.PercentDataBad = uabin.Primitives.Byte.unpack(data) |
|
11469 | self.PercentDataGood = uabin.Primitives.Byte.unpack(data) |
|
11470 | self.UseSlopedExtrapolation = uabin.Primitives.Boolean.unpack(data) |
|
11471 | ||
11472 | def __str__(self): |
|
11473 | return 'AggregateConfiguration(' + 'UseServerCapabilitiesDefaults:' + str(self.UseServerCapabilitiesDefaults) + ', ' + \ |
|
11474 | 'TreatUncertainAsBad:' + str(self.TreatUncertainAsBad) + ', ' + \ |
|
11475 | 'PercentDataBad:' + str(self.PercentDataBad) + ', ' + \ |
|
11476 | 'PercentDataGood:' + str(self.PercentDataGood) + ', ' + \ |
|
11477 | 'UseSlopedExtrapolation:' + str(self.UseSlopedExtrapolation) + ')' |
|
11478 | ||
11479 | __repr__ = __str__ |
|
11480 | ||
11481 | ||
11482 | class AggregateFilter(FrozenClass): |
|
11483 | ''' |
|
11484 | :ivar StartTime: |
|
11485 | :vartype StartTime: DateTime |
|
11486 | :ivar AggregateType: |
|
11487 | :vartype AggregateType: NodeId |
|
11488 | :ivar ProcessingInterval: |
|
11489 | :vartype ProcessingInterval: Double |
|
11490 | :ivar AggregateConfiguration: |
|
11491 | :vartype AggregateConfiguration: AggregateConfiguration |
|
11492 | ''' |
|
11493 | ||
11494 | ua_types = ( |
|
11495 | ||
11496 | ('StartTime', 'DateTime'), |
|
11497 | ('AggregateType', 'NodeId'), |
|
11498 | ('ProcessingInterval', 'Double'), |
|
11499 | ('AggregateConfiguration', 'AggregateConfiguration'), |
|
11500 | ) |
|
11501 | ||
11502 | def __init__(self, binary=None): |
|
11503 | if binary is not None: |
|
11504 | self._binary_init(binary) |
|
11505 | self._freeze = True |
|
@@ 8833-8887 (lines=55) @@ | ||
8830 | ('QueryDataSets', 'ListOfQueryDataSet'), |
|
8831 | ('ContinuationPoint', 'ByteString'), |
|
8832 | ('ParsingResults', 'ListOfParsingResult'), |
|
8833 | ('DiagnosticInfos', 'ListOfDiagnosticInfo'), |
|
8834 | ('FilterResult', 'ContentFilterResult'), |
|
8835 | ) |
|
8836 | ||
8837 | def __init__(self, binary=None): |
|
8838 | if binary is not None: |
|
8839 | self._binary_init(binary) |
|
8840 | self._freeze = True |
|
8841 | return |
|
8842 | self.QueryDataSets = [] |
|
8843 | self.ContinuationPoint = None |
|
8844 | self.ParsingResults = [] |
|
8845 | self.DiagnosticInfos = [] |
|
8846 | self.FilterResult = ContentFilterResult() |
|
8847 | self._freeze = True |
|
8848 | ||
8849 | def to_binary(self): |
|
8850 | packet = [] |
|
8851 | packet.append(uabin.Primitives.Int32.pack(len(self.QueryDataSets))) |
|
8852 | for fieldname in self.QueryDataSets: |
|
8853 | packet.append(fieldname.to_binary()) |
|
8854 | packet.append(uabin.Primitives.ByteString.pack(self.ContinuationPoint)) |
|
8855 | packet.append(uabin.Primitives.Int32.pack(len(self.ParsingResults))) |
|
8856 | for fieldname in self.ParsingResults: |
|
8857 | packet.append(fieldname.to_binary()) |
|
8858 | packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos))) |
|
8859 | for fieldname in self.DiagnosticInfos: |
|
8860 | packet.append(fieldname.to_binary()) |
|
8861 | packet.append(self.FilterResult.to_binary()) |
|
8862 | return b''.join(packet) |
|
8863 | ||
8864 | @staticmethod |
|
8865 | def from_binary(data): |
|
8866 | return QueryFirstResult(data) |
|
8867 | ||
8868 | def _binary_init(self, data): |
|
8869 | length = uabin.Primitives.Int32.unpack(data) |
|
8870 | array = [] |
|
8871 | if length != -1: |
|
8872 | for _ in range(0, length): |
|
8873 | array.append(QueryDataSet.from_binary(data)) |
|
8874 | self.QueryDataSets = array |
|
8875 | self.ContinuationPoint = uabin.Primitives.ByteString.unpack(data) |
|
8876 | length = uabin.Primitives.Int32.unpack(data) |
|
8877 | array = [] |
|
8878 | if length != -1: |
|
8879 | for _ in range(0, length): |
|
8880 | array.append(ParsingResult.from_binary(data)) |
|
8881 | self.ParsingResults = array |
|
8882 | length = uabin.Primitives.Int32.unpack(data) |
|
8883 | array = [] |
|
8884 | if length != -1: |
|
8885 | for _ in range(0, length): |
|
8886 | array.append(DiagnosticInfo.from_binary(data)) |
|
8887 | self.DiagnosticInfos = array |
|
8888 | self.FilterResult = ContentFilterResult.from_binary(data) |
|
8889 | ||
8890 | def __str__(self): |