Code Duplication    Length = 51-51 lines in 8 locations

opcua/ua/uaprotocol_auto.py 8 locations

@@ 13364-13414 (lines=51) @@
13361
    __repr__ = __str__
13362
13363
13364
class TransferSubscriptionsResult(FrozenClass):
13365
    '''
13366
    :ivar Results:
13367
    :vartype Results: TransferResult
13368
    :ivar DiagnosticInfos:
13369
    :vartype DiagnosticInfos: DiagnosticInfo
13370
    '''
13371
13372
    ua_types = [
13373
13374
        ('Results', 'ListOfTransferResult'),
13375
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
13376
               ]
13377
13378
    def __init__(self):
13379
        self.Results = []
13380
        self.DiagnosticInfos = []
13381
        self._freeze = True
13382
13383
    def to_binary(self):
13384
        packet = []
13385
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
13386
        for fieldname in self.Results:
13387
            packet.append(fieldname.to_binary())
13388
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
13389
        for fieldname in self.DiagnosticInfos:
13390
            packet.append(fieldname.to_binary())
13391
        return b''.join(packet)
13392
13393
    @staticmethod
13394
    def from_binary(data):
13395
        obj = TransferSubscriptionsResult()
13396
        length = uabin.Primitives.Int32.unpack(data)
13397
        array = []
13398
        if length != -1:
13399
            for _ in range(0, length):
13400
                array.append(TransferResult.from_binary(data))
13401
        obj.Results = array
13402
        length = uabin.Primitives.Int32.unpack(data)
13403
        array = []
13404
        if length != -1:
13405
            for _ in range(0, length):
13406
                array.append(DiagnosticInfo.from_binary(data))
13407
        obj.DiagnosticInfos = array
13408
        return obj
13409
13410
    def __str__(self):
13411
        return 'TransferSubscriptionsResult(' + 'Results:' + str(self.Results) + ', ' + \
13412
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
13413
13414
    __repr__ = __str__
13415
13416
13417
class TransferSubscriptionsResponse(FrozenClass):
@@ 12597-12647 (lines=51) @@
12594
    __repr__ = __str__
12595
12596
12597
class DataChangeNotification(FrozenClass):
12598
    '''
12599
    :ivar MonitoredItems:
12600
    :vartype MonitoredItems: MonitoredItemNotification
12601
    :ivar DiagnosticInfos:
12602
    :vartype DiagnosticInfos: DiagnosticInfo
12603
    '''
12604
12605
    ua_types = [
12606
12607
        ('MonitoredItems', 'ListOfMonitoredItemNotification'),
12608
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
12609
               ]
12610
12611
    def __init__(self):
12612
        self.MonitoredItems = []
12613
        self.DiagnosticInfos = []
12614
        self._freeze = True
12615
12616
    def to_binary(self):
12617
        packet = []
12618
        packet.append(uabin.Primitives.Int32.pack(len(self.MonitoredItems)))
12619
        for fieldname in self.MonitoredItems:
12620
            packet.append(fieldname.to_binary())
12621
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
12622
        for fieldname in self.DiagnosticInfos:
12623
            packet.append(fieldname.to_binary())
12624
        return b''.join(packet)
12625
12626
    @staticmethod
12627
    def from_binary(data):
12628
        obj = DataChangeNotification()
12629
        length = uabin.Primitives.Int32.unpack(data)
12630
        array = []
12631
        if length != -1:
12632
            for _ in range(0, length):
12633
                array.append(MonitoredItemNotification.from_binary(data))
12634
        obj.MonitoredItems = array
12635
        length = uabin.Primitives.Int32.unpack(data)
12636
        array = []
12637
        if length != -1:
12638
            for _ in range(0, length):
12639
                array.append(DiagnosticInfo.from_binary(data))
12640
        obj.DiagnosticInfos = array
12641
        return obj
12642
12643
    def __str__(self):
12644
        return 'DataChangeNotification(' + 'MonitoredItems:' + str(self.MonitoredItems) + ', ' + \
12645
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
12646
12647
    __repr__ = __str__
12648
12649
12650
class MonitoredItemNotification(FrozenClass):
@@ 12419-12469 (lines=51) @@
12416
    __repr__ = __str__
12417
12418
12419
class SetPublishingModeResult(FrozenClass):
12420
    '''
12421
    :ivar Results:
12422
    :vartype Results: StatusCode
12423
    :ivar DiagnosticInfos:
12424
    :vartype DiagnosticInfos: DiagnosticInfo
12425
    '''
12426
12427
    ua_types = [
12428
12429
        ('Results', 'ListOfStatusCode'),
12430
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
12431
               ]
12432
12433
    def __init__(self):
12434
        self.Results = []
12435
        self.DiagnosticInfos = []
12436
        self._freeze = True
12437
12438
    def to_binary(self):
12439
        packet = []
12440
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
12441
        for fieldname in self.Results:
12442
            packet.append(fieldname.to_binary())
12443
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
12444
        for fieldname in self.DiagnosticInfos:
12445
            packet.append(fieldname.to_binary())
12446
        return b''.join(packet)
12447
12448
    @staticmethod
12449
    def from_binary(data):
12450
        obj = SetPublishingModeResult()
12451
        length = uabin.Primitives.Int32.unpack(data)
12452
        array = []
12453
        if length != -1:
12454
            for _ in range(0, length):
12455
                array.append(StatusCode.from_binary(data))
12456
        obj.Results = array
12457
        length = uabin.Primitives.Int32.unpack(data)
12458
        array = []
12459
        if length != -1:
12460
            for _ in range(0, length):
12461
                array.append(DiagnosticInfo.from_binary(data))
12462
        obj.DiagnosticInfos = array
12463
        return obj
12464
12465
    def __str__(self):
12466
        return 'SetPublishingModeResult(' + 'Results:' + str(self.Results) + ', ' + \
12467
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
12468
12469
    __repr__ = __str__
12470
12471
12472
class SetPublishingModeResponse(FrozenClass):
@@ 11432-11482 (lines=51) @@
11429
    __repr__ = __str__
11430
11431
11432
class SetMonitoringModeResult(FrozenClass):
11433
    '''
11434
    :ivar Results:
11435
    :vartype Results: StatusCode
11436
    :ivar DiagnosticInfos:
11437
    :vartype DiagnosticInfos: DiagnosticInfo
11438
    '''
11439
11440
    ua_types = [
11441
11442
        ('Results', 'ListOfStatusCode'),
11443
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
11444
               ]
11445
11446
    def __init__(self):
11447
        self.Results = []
11448
        self.DiagnosticInfos = []
11449
        self._freeze = True
11450
11451
    def to_binary(self):
11452
        packet = []
11453
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
11454
        for fieldname in self.Results:
11455
            packet.append(fieldname.to_binary())
11456
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
11457
        for fieldname in self.DiagnosticInfos:
11458
            packet.append(fieldname.to_binary())
11459
        return b''.join(packet)
11460
11461
    @staticmethod
11462
    def from_binary(data):
11463
        obj = SetMonitoringModeResult()
11464
        length = uabin.Primitives.Int32.unpack(data)
11465
        array = []
11466
        if length != -1:
11467
            for _ in range(0, length):
11468
                array.append(StatusCode.from_binary(data))
11469
        obj.Results = array
11470
        length = uabin.Primitives.Int32.unpack(data)
11471
        array = []
11472
        if length != -1:
11473
            for _ in range(0, length):
11474
                array.append(DiagnosticInfo.from_binary(data))
11475
        obj.DiagnosticInfos = array
11476
        return obj
11477
11478
    def __str__(self):
11479
        return 'SetMonitoringModeResult(' + 'Results:' + str(self.Results) + ', ' + \
11480
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
11481
11482
    __repr__ = __str__
11483
11484
11485
class SetMonitoringModeResponse(FrozenClass):
@@ 9091-9141 (lines=51) @@
9088
    __repr__ = __str__
9089
9090
9091
class HistoryModifiedData(FrozenClass):
9092
    '''
9093
    :ivar DataValues:
9094
    :vartype DataValues: DataValue
9095
    :ivar ModificationInfos:
9096
    :vartype ModificationInfos: ModificationInfo
9097
    '''
9098
9099
    ua_types = [
9100
9101
        ('DataValues', 'ListOfDataValue'),
9102
        ('ModificationInfos', 'ListOfModificationInfo'),
9103
               ]
9104
9105
    def __init__(self):
9106
        self.DataValues = []
9107
        self.ModificationInfos = []
9108
        self._freeze = True
9109
9110
    def to_binary(self):
9111
        packet = []
9112
        packet.append(uabin.Primitives.Int32.pack(len(self.DataValues)))
9113
        for fieldname in self.DataValues:
9114
            packet.append(fieldname.to_binary())
9115
        packet.append(uabin.Primitives.Int32.pack(len(self.ModificationInfos)))
9116
        for fieldname in self.ModificationInfos:
9117
            packet.append(fieldname.to_binary())
9118
        return b''.join(packet)
9119
9120
    @staticmethod
9121
    def from_binary(data):
9122
        obj = HistoryModifiedData()
9123
        length = uabin.Primitives.Int32.unpack(data)
9124
        array = []
9125
        if length != -1:
9126
            for _ in range(0, length):
9127
                array.append(DataValue.from_binary(data))
9128
        obj.DataValues = array
9129
        length = uabin.Primitives.Int32.unpack(data)
9130
        array = []
9131
        if length != -1:
9132
            for _ in range(0, length):
9133
                array.append(ModificationInfo.from_binary(data))
9134
        obj.ModificationInfos = array
9135
        return obj
9136
9137
    def __str__(self):
9138
        return 'HistoryModifiedData(' + 'DataValues:' + str(self.DataValues) + ', ' + \
9139
               'ModificationInfos:' + str(self.ModificationInfos) + ')'
9140
9141
    __repr__ = __str__
9142
9143
9144
class HistoryEvent(FrozenClass):
@@ 7911-7961 (lines=51) @@
7908
    __repr__ = __str__
7909
7910
7911
class ContentFilterResult(FrozenClass):
7912
    '''
7913
    :ivar ElementResults:
7914
    :vartype ElementResults: ContentFilterElementResult
7915
    :ivar ElementDiagnosticInfos:
7916
    :vartype ElementDiagnosticInfos: DiagnosticInfo
7917
    '''
7918
7919
    ua_types = [
7920
7921
        ('ElementResults', 'ListOfContentFilterElementResult'),
7922
        ('ElementDiagnosticInfos', 'ListOfDiagnosticInfo'),
7923
               ]
7924
7925
    def __init__(self):
7926
        self.ElementResults = []
7927
        self.ElementDiagnosticInfos = []
7928
        self._freeze = True
7929
7930
    def to_binary(self):
7931
        packet = []
7932
        packet.append(uabin.Primitives.Int32.pack(len(self.ElementResults)))
7933
        for fieldname in self.ElementResults:
7934
            packet.append(fieldname.to_binary())
7935
        packet.append(uabin.Primitives.Int32.pack(len(self.ElementDiagnosticInfos)))
7936
        for fieldname in self.ElementDiagnosticInfos:
7937
            packet.append(fieldname.to_binary())
7938
        return b''.join(packet)
7939
7940
    @staticmethod
7941
    def from_binary(data):
7942
        obj = ContentFilterResult()
7943
        length = uabin.Primitives.Int32.unpack(data)
7944
        array = []
7945
        if length != -1:
7946
            for _ in range(0, length):
7947
                array.append(ContentFilterElementResult.from_binary(data))
7948
        obj.ElementResults = array
7949
        length = uabin.Primitives.Int32.unpack(data)
7950
        array = []
7951
        if length != -1:
7952
            for _ in range(0, length):
7953
                array.append(DiagnosticInfo.from_binary(data))
7954
        obj.ElementDiagnosticInfos = array
7955
        return obj
7956
7957
    def __str__(self):
7958
        return 'ContentFilterResult(' + 'ElementResults:' + str(self.ElementResults) + ', ' + \
7959
               'ElementDiagnosticInfos:' + str(self.ElementDiagnosticInfos) + ')'
7960
7961
    __repr__ = __str__
7962
7963
7964
class ParsingResult(FrozenClass):
@@ 6326-6376 (lines=51) @@
6323
    __repr__ = __str__
6324
6325
6326
class BrowseNextResult(FrozenClass):
6327
    '''
6328
    :ivar Results:
6329
    :vartype Results: BrowseResult
6330
    :ivar DiagnosticInfos:
6331
    :vartype DiagnosticInfos: DiagnosticInfo
6332
    '''
6333
6334
    ua_types = [
6335
6336
        ('Results', 'ListOfBrowseResult'),
6337
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
6338
               ]
6339
6340
    def __init__(self):
6341
        self.Results = []
6342
        self.DiagnosticInfos = []
6343
        self._freeze = True
6344
6345
    def to_binary(self):
6346
        packet = []
6347
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
6348
        for fieldname in self.Results:
6349
            packet.append(fieldname.to_binary())
6350
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
6351
        for fieldname in self.DiagnosticInfos:
6352
            packet.append(fieldname.to_binary())
6353
        return b''.join(packet)
6354
6355
    @staticmethod
6356
    def from_binary(data):
6357
        obj = BrowseNextResult()
6358
        length = uabin.Primitives.Int32.unpack(data)
6359
        array = []
6360
        if length != -1:
6361
            for _ in range(0, length):
6362
                array.append(BrowseResult.from_binary(data))
6363
        obj.Results = array
6364
        length = uabin.Primitives.Int32.unpack(data)
6365
        array = []
6366
        if length != -1:
6367
            for _ in range(0, length):
6368
                array.append(DiagnosticInfo.from_binary(data))
6369
        obj.DiagnosticInfos = array
6370
        return obj
6371
6372
    def __str__(self):
6373
        return 'BrowseNextResult(' + 'Results:' + str(self.Results) + ', ' + \
6374
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
6375
6376
    __repr__ = __str__
6377
6378
6379
class BrowseNextResponse(FrozenClass):
@@ 5718-5768 (lines=51) @@
5715
    __repr__ = __str__
5716
5717
5718
class DeleteReferencesResult(FrozenClass):
5719
    '''
5720
    :ivar Results:
5721
    :vartype Results: StatusCode
5722
    :ivar DiagnosticInfos:
5723
    :vartype DiagnosticInfos: DiagnosticInfo
5724
    '''
5725
5726
    ua_types = [
5727
5728
        ('Results', 'ListOfStatusCode'),
5729
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
5730
               ]
5731
5732
    def __init__(self):
5733
        self.Results = []
5734
        self.DiagnosticInfos = []
5735
        self._freeze = True
5736
5737
    def to_binary(self):
5738
        packet = []
5739
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
5740
        for fieldname in self.Results:
5741
            packet.append(fieldname.to_binary())
5742
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
5743
        for fieldname in self.DiagnosticInfos:
5744
            packet.append(fieldname.to_binary())
5745
        return b''.join(packet)
5746
5747
    @staticmethod
5748
    def from_binary(data):
5749
        obj = DeleteReferencesResult()
5750
        length = uabin.Primitives.Int32.unpack(data)
5751
        array = []
5752
        if length != -1:
5753
            for _ in range(0, length):
5754
                array.append(StatusCode.from_binary(data))
5755
        obj.Results = array
5756
        length = uabin.Primitives.Int32.unpack(data)
5757
        array = []
5758
        if length != -1:
5759
            for _ in range(0, length):
5760
                array.append(DiagnosticInfo.from_binary(data))
5761
        obj.DiagnosticInfos = array
5762
        return obj
5763
5764
    def __str__(self):
5765
        return 'DeleteReferencesResult(' + 'Results:' + str(self.Results) + ', ' + \
5766
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
5767
5768
    __repr__ = __str__
5769
5770
5771
class DeleteReferencesResponse(FrozenClass):