Code Duplication    Length = 55-55 lines in 5 locations

opcua/ua/uaprotocol_auto.py 5 locations

@@ 9776-9830 (lines=55) @@
9773
    __repr__ = __str__
9774
9775
9776
class EventFilterResult(FrozenClass):
9777
    '''
9778
    :ivar SelectClauseResults:
9779
    :vartype SelectClauseResults: StatusCode
9780
    :ivar SelectClauseDiagnosticInfos:
9781
    :vartype SelectClauseDiagnosticInfos: DiagnosticInfo
9782
    :ivar WhereClauseResult:
9783
    :vartype WhereClauseResult: ContentFilterResult
9784
    '''
9785
    def __init__(self, binary=None):
9786
        if binary is not None:
9787
            self._binary_init(binary)
9788
            self._freeze = True
9789
            return
9790
        self.SelectClauseResults = []
9791
        self.SelectClauseDiagnosticInfos = []
9792
        self.WhereClauseResult = ContentFilterResult()
9793
        self._freeze = True
9794
9795
    def to_binary(self):
9796
        packet = []
9797
        packet.append(uatype_Int32.pack(len(self.SelectClauseResults)))
9798
        for fieldname in self.SelectClauseResults:
9799
            packet.append(fieldname.to_binary())
9800
        packet.append(uatype_Int32.pack(len(self.SelectClauseDiagnosticInfos)))
9801
        for fieldname in self.SelectClauseDiagnosticInfos:
9802
            packet.append(fieldname.to_binary())
9803
        packet.append(self.WhereClauseResult.to_binary())
9804
        return b''.join(packet)
9805
9806
    @staticmethod
9807
    def from_binary(data):
9808
        return EventFilterResult(data)
9809
9810
    def _binary_init(self, data):
9811
        length = uatype_Int32.unpack(data.read(4))[0]
9812
        array = []
9813
        if length != -1:
9814
            for _ in range(0, length):
9815
                array.append(StatusCode.from_binary(data))
9816
        self.SelectClauseResults = array
9817
        length = uatype_Int32.unpack(data.read(4))[0]
9818
        array = []
9819
        if length != -1:
9820
            for _ in range(0, length):
9821
                array.append(DiagnosticInfo.from_binary(data))
9822
        self.SelectClauseDiagnosticInfos = array
9823
        self.WhereClauseResult = ContentFilterResult.from_binary(data)
9824
9825
    def __str__(self):
9826
        return 'EventFilterResult(' + 'SelectClauseResults:' + str(self.SelectClauseResults) + ', ' + \
9827
               'SelectClauseDiagnosticInfos:' + str(self.SelectClauseDiagnosticInfos) + ', ' + \
9828
               'WhereClauseResult:' + str(self.WhereClauseResult) + ')'
9829
9830
    __repr__ = __str__
9831
9832
9833
class AggregateFilterResult(FrozenClass):
@@ 9066-9120 (lines=55) @@
9063
    __repr__ = __str__
9064
9065
9066
class HistoryUpdateResult(FrozenClass):
9067
    '''
9068
    :ivar StatusCode:
9069
    :vartype StatusCode: StatusCode
9070
    :ivar OperationResults:
9071
    :vartype OperationResults: StatusCode
9072
    :ivar DiagnosticInfos:
9073
    :vartype DiagnosticInfos: DiagnosticInfo
9074
    '''
9075
    def __init__(self, binary=None):
9076
        if binary is not None:
9077
            self._binary_init(binary)
9078
            self._freeze = True
9079
            return
9080
        self.StatusCode = StatusCode()
9081
        self.OperationResults = []
9082
        self.DiagnosticInfos = []
9083
        self._freeze = True
9084
9085
    def to_binary(self):
9086
        packet = []
9087
        packet.append(self.StatusCode.to_binary())
9088
        packet.append(uatype_Int32.pack(len(self.OperationResults)))
9089
        for fieldname in self.OperationResults:
9090
            packet.append(fieldname.to_binary())
9091
        packet.append(uatype_Int32.pack(len(self.DiagnosticInfos)))
9092
        for fieldname in self.DiagnosticInfos:
9093
            packet.append(fieldname.to_binary())
9094
        return b''.join(packet)
9095
9096
    @staticmethod
9097
    def from_binary(data):
9098
        return HistoryUpdateResult(data)
9099
9100
    def _binary_init(self, data):
9101
        self.StatusCode = StatusCode.from_binary(data)
9102
        length = uatype_Int32.unpack(data.read(4))[0]
9103
        array = []
9104
        if length != -1:
9105
            for _ in range(0, length):
9106
                array.append(StatusCode.from_binary(data))
9107
        self.OperationResults = array
9108
        length = uatype_Int32.unpack(data.read(4))[0]
9109
        array = []
9110
        if length != -1:
9111
            for _ in range(0, length):
9112
                array.append(DiagnosticInfo.from_binary(data))
9113
        self.DiagnosticInfos = array
9114
9115
    def __str__(self):
9116
        return 'HistoryUpdateResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
9117
               'OperationResults:' + str(self.OperationResults) + ', ' + \
9118
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
9119
9120
    __repr__ = __str__
9121
9122
9123
class HistoryUpdateParameters(FrozenClass):
@@ 7250-7304 (lines=55) @@
7247
    __repr__ = __str__
7248
7249
7250
class ParsingResult(FrozenClass):
7251
    '''
7252
    :ivar StatusCode:
7253
    :vartype StatusCode: StatusCode
7254
    :ivar DataStatusCodes:
7255
    :vartype DataStatusCodes: StatusCode
7256
    :ivar DataDiagnosticInfos:
7257
    :vartype DataDiagnosticInfos: DiagnosticInfo
7258
    '''
7259
    def __init__(self, binary=None):
7260
        if binary is not None:
7261
            self._binary_init(binary)
7262
            self._freeze = True
7263
            return
7264
        self.StatusCode = StatusCode()
7265
        self.DataStatusCodes = []
7266
        self.DataDiagnosticInfos = []
7267
        self._freeze = True
7268
7269
    def to_binary(self):
7270
        packet = []
7271
        packet.append(self.StatusCode.to_binary())
7272
        packet.append(uatype_Int32.pack(len(self.DataStatusCodes)))
7273
        for fieldname in self.DataStatusCodes:
7274
            packet.append(fieldname.to_binary())
7275
        packet.append(uatype_Int32.pack(len(self.DataDiagnosticInfos)))
7276
        for fieldname in self.DataDiagnosticInfos:
7277
            packet.append(fieldname.to_binary())
7278
        return b''.join(packet)
7279
7280
    @staticmethod
7281
    def from_binary(data):
7282
        return ParsingResult(data)
7283
7284
    def _binary_init(self, data):
7285
        self.StatusCode = StatusCode.from_binary(data)
7286
        length = uatype_Int32.unpack(data.read(4))[0]
7287
        array = []
7288
        if length != -1:
7289
            for _ in range(0, length):
7290
                array.append(StatusCode.from_binary(data))
7291
        self.DataStatusCodes = array
7292
        length = uatype_Int32.unpack(data.read(4))[0]
7293
        array = []
7294
        if length != -1:
7295
            for _ in range(0, length):
7296
                array.append(DiagnosticInfo.from_binary(data))
7297
        self.DataDiagnosticInfos = array
7298
7299
    def __str__(self):
7300
        return 'ParsingResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
7301
               'DataStatusCodes:' + str(self.DataStatusCodes) + ', ' + \
7302
               'DataDiagnosticInfos:' + str(self.DataDiagnosticInfos) + ')'
7303
7304
    __repr__ = __str__
7305
7306
7307
class QueryFirstParameters(FrozenClass):
@@ 7142-7196 (lines=55) @@
7139
    __repr__ = __str__
7140
7141
7142
class ContentFilterElementResult(FrozenClass):
7143
    '''
7144
    :ivar StatusCode:
7145
    :vartype StatusCode: StatusCode
7146
    :ivar OperandStatusCodes:
7147
    :vartype OperandStatusCodes: StatusCode
7148
    :ivar OperandDiagnosticInfos:
7149
    :vartype OperandDiagnosticInfos: DiagnosticInfo
7150
    '''
7151
    def __init__(self, binary=None):
7152
        if binary is not None:
7153
            self._binary_init(binary)
7154
            self._freeze = True
7155
            return
7156
        self.StatusCode = StatusCode()
7157
        self.OperandStatusCodes = []
7158
        self.OperandDiagnosticInfos = []
7159
        self._freeze = True
7160
7161
    def to_binary(self):
7162
        packet = []
7163
        packet.append(self.StatusCode.to_binary())
7164
        packet.append(uatype_Int32.pack(len(self.OperandStatusCodes)))
7165
        for fieldname in self.OperandStatusCodes:
7166
            packet.append(fieldname.to_binary())
7167
        packet.append(uatype_Int32.pack(len(self.OperandDiagnosticInfos)))
7168
        for fieldname in self.OperandDiagnosticInfos:
7169
            packet.append(fieldname.to_binary())
7170
        return b''.join(packet)
7171
7172
    @staticmethod
7173
    def from_binary(data):
7174
        return ContentFilterElementResult(data)
7175
7176
    def _binary_init(self, data):
7177
        self.StatusCode = StatusCode.from_binary(data)
7178
        length = uatype_Int32.unpack(data.read(4))[0]
7179
        array = []
7180
        if length != -1:
7181
            for _ in range(0, length):
7182
                array.append(StatusCode.from_binary(data))
7183
        self.OperandStatusCodes = array
7184
        length = uatype_Int32.unpack(data.read(4))[0]
7185
        array = []
7186
        if length != -1:
7187
            for _ in range(0, length):
7188
                array.append(DiagnosticInfo.from_binary(data))
7189
        self.OperandDiagnosticInfos = array
7190
7191
    def __str__(self):
7192
        return 'ContentFilterElementResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
7193
               'OperandStatusCodes:' + str(self.OperandStatusCodes) + ', ' + \
7194
               'OperandDiagnosticInfos:' + str(self.OperandDiagnosticInfos) + ')'
7195
7196
    __repr__ = __str__
7197
7198
7199
class ContentFilterResult(FrozenClass):
@@ 3382-3436 (lines=55) @@
3379
    __repr__ = __str__
3380
3381
3382
class ActivateSessionResult(FrozenClass):
3383
    '''
3384
    :ivar ServerNonce:
3385
    :vartype ServerNonce: ByteString
3386
    :ivar Results:
3387
    :vartype Results: StatusCode
3388
    :ivar DiagnosticInfos:
3389
    :vartype DiagnosticInfos: DiagnosticInfo
3390
    '''
3391
    def __init__(self, binary=None):
3392
        if binary is not None:
3393
            self._binary_init(binary)
3394
            self._freeze = True
3395
            return
3396
        self.ServerNonce = b''
3397
        self.Results = []
3398
        self.DiagnosticInfos = []
3399
        self._freeze = True
3400
3401
    def to_binary(self):
3402
        packet = []
3403
        packet.append(pack_bytes(self.ServerNonce))
3404
        packet.append(uatype_Int32.pack(len(self.Results)))
3405
        for fieldname in self.Results:
3406
            packet.append(fieldname.to_binary())
3407
        packet.append(uatype_Int32.pack(len(self.DiagnosticInfos)))
3408
        for fieldname in self.DiagnosticInfos:
3409
            packet.append(fieldname.to_binary())
3410
        return b''.join(packet)
3411
3412
    @staticmethod
3413
    def from_binary(data):
3414
        return ActivateSessionResult(data)
3415
3416
    def _binary_init(self, data):
3417
        self.ServerNonce = unpack_bytes(data)
3418
        length = uatype_Int32.unpack(data.read(4))[0]
3419
        array = []
3420
        if length != -1:
3421
            for _ in range(0, length):
3422
                array.append(StatusCode.from_binary(data))
3423
        self.Results = array
3424
        length = uatype_Int32.unpack(data.read(4))[0]
3425
        array = []
3426
        if length != -1:
3427
            for _ in range(0, length):
3428
                array.append(DiagnosticInfo.from_binary(data))
3429
        self.DiagnosticInfos = array
3430
3431
    def __str__(self):
3432
        return 'ActivateSessionResult(' + 'ServerNonce:' + str(self.ServerNonce) + ', ' + \
3433
               'Results:' + str(self.Results) + ', ' + \
3434
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
3435
3436
    __repr__ = __str__
3437
3438
3439
class ActivateSessionResponse(FrozenClass):