Code Duplication    Length = 69-69 lines in 2 locations

opcua/ua/uaprotocol_auto.py 2 locations

@@ 12744-12812 (lines=69) @@
12741
               'Parameters:' + str(self.Parameters) + ')'
12742
12743
    __repr__ = __str__
12744
12745
12746
class ModifySubscriptionParameters(FrozenClass):
12747
    '''
12748
    :ivar SubscriptionId:
12749
    :vartype SubscriptionId: UInt32
12750
    :ivar RequestedPublishingInterval:
12751
    :vartype RequestedPublishingInterval: Double
12752
    :ivar RequestedLifetimeCount:
12753
    :vartype RequestedLifetimeCount: UInt32
12754
    :ivar RequestedMaxKeepAliveCount:
12755
    :vartype RequestedMaxKeepAliveCount: UInt32
12756
    :ivar MaxNotificationsPerPublish:
12757
    :vartype MaxNotificationsPerPublish: UInt32
12758
    :ivar Priority:
12759
    :vartype Priority: Byte
12760
    '''
12761
12762
    ua_types = {
12763
        'SubscriptionId': 'UInt32',
12764
        'RequestedPublishingInterval': 'Double',
12765
        'RequestedLifetimeCount': 'UInt32',
12766
        'RequestedMaxKeepAliveCount': 'UInt32',
12767
        'MaxNotificationsPerPublish': 'UInt32',
12768
        'Priority': 'Byte',
12769
               }
12770
12771
    def __init__(self, binary=None):
12772
        if binary is not None:
12773
            self._binary_init(binary)
12774
            self._freeze = True
12775
            return
12776
        self.SubscriptionId = 0
12777
        self.RequestedPublishingInterval = 0
12778
        self.RequestedLifetimeCount = 0
12779
        self.RequestedMaxKeepAliveCount = 0
12780
        self.MaxNotificationsPerPublish = 0
12781
        self.Priority = 0
12782
        self._freeze = True
12783
12784
    def to_binary(self):
12785
        packet = []
12786
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
12787
        packet.append(uabin.Primitives.Double.pack(self.RequestedPublishingInterval))
12788
        packet.append(uabin.Primitives.UInt32.pack(self.RequestedLifetimeCount))
12789
        packet.append(uabin.Primitives.UInt32.pack(self.RequestedMaxKeepAliveCount))
12790
        packet.append(uabin.Primitives.UInt32.pack(self.MaxNotificationsPerPublish))
12791
        packet.append(uabin.Primitives.Byte.pack(self.Priority))
12792
        return b''.join(packet)
12793
12794
    @staticmethod
12795
    def from_binary(data):
12796
        return ModifySubscriptionParameters(data)
12797
12798
    def _binary_init(self, data):
12799
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
12800
        self.RequestedPublishingInterval = uabin.Primitives.Double.unpack(data)
12801
        self.RequestedLifetimeCount = uabin.Primitives.UInt32.unpack(data)
12802
        self.RequestedMaxKeepAliveCount = uabin.Primitives.UInt32.unpack(data)
12803
        self.MaxNotificationsPerPublish = uabin.Primitives.UInt32.unpack(data)
12804
        self.Priority = uabin.Primitives.Byte.unpack(data)
12805
12806
    def __str__(self):
12807
        return 'ModifySubscriptionParameters(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
12808
               'RequestedPublishingInterval:' + str(self.RequestedPublishingInterval) + ', ' + \
12809
               'RequestedLifetimeCount:' + str(self.RequestedLifetimeCount) + ', ' + \
12810
               'RequestedMaxKeepAliveCount:' + str(self.RequestedMaxKeepAliveCount) + ', ' + \
12811
               'MaxNotificationsPerPublish:' + str(self.MaxNotificationsPerPublish) + ', ' + \
12812
               'Priority:' + str(self.Priority) + ')'
12813
12814
    __repr__ = __str__
12815
@@ 12516-12584 (lines=69) @@
12513
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
12514
12515
    __repr__ = __str__
12516
12517
12518
class CreateSubscriptionParameters(FrozenClass):
12519
    '''
12520
    :ivar RequestedPublishingInterval:
12521
    :vartype RequestedPublishingInterval: Double
12522
    :ivar RequestedLifetimeCount:
12523
    :vartype RequestedLifetimeCount: UInt32
12524
    :ivar RequestedMaxKeepAliveCount:
12525
    :vartype RequestedMaxKeepAliveCount: UInt32
12526
    :ivar MaxNotificationsPerPublish:
12527
    :vartype MaxNotificationsPerPublish: UInt32
12528
    :ivar PublishingEnabled:
12529
    :vartype PublishingEnabled: Boolean
12530
    :ivar Priority:
12531
    :vartype Priority: Byte
12532
    '''
12533
12534
    ua_types = {
12535
        'RequestedPublishingInterval': 'Double',
12536
        'RequestedLifetimeCount': 'UInt32',
12537
        'RequestedMaxKeepAliveCount': 'UInt32',
12538
        'MaxNotificationsPerPublish': 'UInt32',
12539
        'PublishingEnabled': 'Boolean',
12540
        'Priority': 'Byte',
12541
               }
12542
12543
    def __init__(self, binary=None):
12544
        if binary is not None:
12545
            self._binary_init(binary)
12546
            self._freeze = True
12547
            return
12548
        self.RequestedPublishingInterval = 0
12549
        self.RequestedLifetimeCount = 0
12550
        self.RequestedMaxKeepAliveCount = 0
12551
        self.MaxNotificationsPerPublish = 0
12552
        self.PublishingEnabled = True
12553
        self.Priority = 0
12554
        self._freeze = True
12555
12556
    def to_binary(self):
12557
        packet = []
12558
        packet.append(uabin.Primitives.Double.pack(self.RequestedPublishingInterval))
12559
        packet.append(uabin.Primitives.UInt32.pack(self.RequestedLifetimeCount))
12560
        packet.append(uabin.Primitives.UInt32.pack(self.RequestedMaxKeepAliveCount))
12561
        packet.append(uabin.Primitives.UInt32.pack(self.MaxNotificationsPerPublish))
12562
        packet.append(uabin.Primitives.Boolean.pack(self.PublishingEnabled))
12563
        packet.append(uabin.Primitives.Byte.pack(self.Priority))
12564
        return b''.join(packet)
12565
12566
    @staticmethod
12567
    def from_binary(data):
12568
        return CreateSubscriptionParameters(data)
12569
12570
    def _binary_init(self, data):
12571
        self.RequestedPublishingInterval = uabin.Primitives.Double.unpack(data)
12572
        self.RequestedLifetimeCount = uabin.Primitives.UInt32.unpack(data)
12573
        self.RequestedMaxKeepAliveCount = uabin.Primitives.UInt32.unpack(data)
12574
        self.MaxNotificationsPerPublish = uabin.Primitives.UInt32.unpack(data)
12575
        self.PublishingEnabled = uabin.Primitives.Boolean.unpack(data)
12576
        self.Priority = uabin.Primitives.Byte.unpack(data)
12577
12578
    def __str__(self):
12579
        return 'CreateSubscriptionParameters(' + 'RequestedPublishingInterval:' + str(self.RequestedPublishingInterval) + ', ' + \
12580
               'RequestedLifetimeCount:' + str(self.RequestedLifetimeCount) + ', ' + \
12581
               'RequestedMaxKeepAliveCount:' + str(self.RequestedMaxKeepAliveCount) + ', ' + \
12582
               'MaxNotificationsPerPublish:' + str(self.MaxNotificationsPerPublish) + ', ' + \
12583
               'PublishingEnabled:' + str(self.PublishingEnabled) + ', ' + \
12584
               'Priority:' + str(self.Priority) + ')'
12585
12586
    __repr__ = __str__
12587