Code Duplication    Length = 58-58 lines in 5 locations

opcua/ua/uaprotocol_auto.py 5 locations

@@ 10642-10699 (lines=58) @@
10639
    __repr__ = __str__
10640
10641
10642
class EventFilterResult(FrozenClass):
10643
    '''
10644
    :ivar SelectClauseResults:
10645
    :vartype SelectClauseResults: StatusCode
10646
    :ivar SelectClauseDiagnosticInfos:
10647
    :vartype SelectClauseDiagnosticInfos: DiagnosticInfo
10648
    :ivar WhereClauseResult:
10649
    :vartype WhereClauseResult: ContentFilterResult
10650
    '''
10651
10652
    ua_types = [
10653
10654
        ('SelectClauseResults', 'ListOfStatusCode'),
10655
        ('SelectClauseDiagnosticInfos', 'ListOfDiagnosticInfo'),
10656
        ('WhereClauseResult', 'ContentFilterResult'),
10657
               ]
10658
10659
    def __init__(self):
10660
        self.SelectClauseResults = []
10661
        self.SelectClauseDiagnosticInfos = []
10662
        self.WhereClauseResult = ContentFilterResult()
10663
        self._freeze = True
10664
10665
    def to_binary(self):
10666
        packet = []
10667
        packet.append(uabin.Primitives.Int32.pack(len(self.SelectClauseResults)))
10668
        for fieldname in self.SelectClauseResults:
10669
            packet.append(fieldname.to_binary())
10670
        packet.append(uabin.Primitives.Int32.pack(len(self.SelectClauseDiagnosticInfos)))
10671
        for fieldname in self.SelectClauseDiagnosticInfos:
10672
            packet.append(fieldname.to_binary())
10673
        packet.append(self.WhereClauseResult.to_binary())
10674
        return b''.join(packet)
10675
10676
    @staticmethod
10677
    def from_binary(data):
10678
        obj = EventFilterResult()
10679
        length = uabin.Primitives.Int32.unpack(data)
10680
        array = []
10681
        if length != -1:
10682
            for _ in range(0, length):
10683
                array.append(StatusCode.from_binary(data))
10684
        obj.SelectClauseResults = array
10685
        length = uabin.Primitives.Int32.unpack(data)
10686
        array = []
10687
        if length != -1:
10688
            for _ in range(0, length):
10689
                array.append(DiagnosticInfo.from_binary(data))
10690
        obj.SelectClauseDiagnosticInfos = array
10691
        obj.WhereClauseResult = ContentFilterResult.from_binary(data)
10692
        return obj
10693
10694
    def __str__(self):
10695
        return 'EventFilterResult(' + 'SelectClauseResults:' + str(self.SelectClauseResults) + ', ' + \
10696
               'SelectClauseDiagnosticInfos:' + str(self.SelectClauseDiagnosticInfos) + ', ' + \
10697
               'WhereClauseResult:' + str(self.WhereClauseResult) + ')'
10698
10699
    __repr__ = __str__
10700
10701
10702
class AggregateFilterResult(FrozenClass):
@@ 9894-9951 (lines=58) @@
9891
    __repr__ = __str__
9892
9893
9894
class HistoryUpdateResult(FrozenClass):
9895
    '''
9896
    :ivar StatusCode:
9897
    :vartype StatusCode: StatusCode
9898
    :ivar OperationResults:
9899
    :vartype OperationResults: StatusCode
9900
    :ivar DiagnosticInfos:
9901
    :vartype DiagnosticInfos: DiagnosticInfo
9902
    '''
9903
9904
    ua_types = [
9905
9906
        ('StatusCode', 'StatusCode'),
9907
        ('OperationResults', 'ListOfStatusCode'),
9908
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
9909
               ]
9910
9911
    def __init__(self):
9912
        self.StatusCode = StatusCode()
9913
        self.OperationResults = []
9914
        self.DiagnosticInfos = []
9915
        self._freeze = True
9916
9917
    def to_binary(self):
9918
        packet = []
9919
        packet.append(self.StatusCode.to_binary())
9920
        packet.append(uabin.Primitives.Int32.pack(len(self.OperationResults)))
9921
        for fieldname in self.OperationResults:
9922
            packet.append(fieldname.to_binary())
9923
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
9924
        for fieldname in self.DiagnosticInfos:
9925
            packet.append(fieldname.to_binary())
9926
        return b''.join(packet)
9927
9928
    @staticmethod
9929
    def from_binary(data):
9930
        obj = HistoryUpdateResult()
9931
        obj.StatusCode = StatusCode.from_binary(data)
9932
        length = uabin.Primitives.Int32.unpack(data)
9933
        array = []
9934
        if length != -1:
9935
            for _ in range(0, length):
9936
                array.append(StatusCode.from_binary(data))
9937
        obj.OperationResults = array
9938
        length = uabin.Primitives.Int32.unpack(data)
9939
        array = []
9940
        if length != -1:
9941
            for _ in range(0, length):
9942
                array.append(DiagnosticInfo.from_binary(data))
9943
        obj.DiagnosticInfos = array
9944
        return obj
9945
9946
    def __str__(self):
9947
        return 'HistoryUpdateResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
9948
               'OperationResults:' + str(self.OperationResults) + ', ' + \
9949
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
9950
9951
    __repr__ = __str__
9952
9953
9954
class HistoryUpdateParameters(FrozenClass):
@@ 7964-8021 (lines=58) @@
7961
    __repr__ = __str__
7962
7963
7964
class ParsingResult(FrozenClass):
7965
    '''
7966
    :ivar StatusCode:
7967
    :vartype StatusCode: StatusCode
7968
    :ivar DataStatusCodes:
7969
    :vartype DataStatusCodes: StatusCode
7970
    :ivar DataDiagnosticInfos:
7971
    :vartype DataDiagnosticInfos: DiagnosticInfo
7972
    '''
7973
7974
    ua_types = [
7975
7976
        ('StatusCode', 'StatusCode'),
7977
        ('DataStatusCodes', 'ListOfStatusCode'),
7978
        ('DataDiagnosticInfos', 'ListOfDiagnosticInfo'),
7979
               ]
7980
7981
    def __init__(self):
7982
        self.StatusCode = StatusCode()
7983
        self.DataStatusCodes = []
7984
        self.DataDiagnosticInfos = []
7985
        self._freeze = True
7986
7987
    def to_binary(self):
7988
        packet = []
7989
        packet.append(self.StatusCode.to_binary())
7990
        packet.append(uabin.Primitives.Int32.pack(len(self.DataStatusCodes)))
7991
        for fieldname in self.DataStatusCodes:
7992
            packet.append(fieldname.to_binary())
7993
        packet.append(uabin.Primitives.Int32.pack(len(self.DataDiagnosticInfos)))
7994
        for fieldname in self.DataDiagnosticInfos:
7995
            packet.append(fieldname.to_binary())
7996
        return b''.join(packet)
7997
7998
    @staticmethod
7999
    def from_binary(data):
8000
        obj = ParsingResult()
8001
        obj.StatusCode = StatusCode.from_binary(data)
8002
        length = uabin.Primitives.Int32.unpack(data)
8003
        array = []
8004
        if length != -1:
8005
            for _ in range(0, length):
8006
                array.append(StatusCode.from_binary(data))
8007
        obj.DataStatusCodes = array
8008
        length = uabin.Primitives.Int32.unpack(data)
8009
        array = []
8010
        if length != -1:
8011
            for _ in range(0, length):
8012
                array.append(DiagnosticInfo.from_binary(data))
8013
        obj.DataDiagnosticInfos = array
8014
        return obj
8015
8016
    def __str__(self):
8017
        return 'ParsingResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
8018
               'DataStatusCodes:' + str(self.DataStatusCodes) + ', ' + \
8019
               'DataDiagnosticInfos:' + str(self.DataDiagnosticInfos) + ')'
8020
8021
    __repr__ = __str__
8022
8023
8024
class QueryFirstParameters(FrozenClass):
@@ 7851-7908 (lines=58) @@
7848
    __repr__ = __str__
7849
7850
7851
class ContentFilterElementResult(FrozenClass):
7852
    '''
7853
    :ivar StatusCode:
7854
    :vartype StatusCode: StatusCode
7855
    :ivar OperandStatusCodes:
7856
    :vartype OperandStatusCodes: StatusCode
7857
    :ivar OperandDiagnosticInfos:
7858
    :vartype OperandDiagnosticInfos: DiagnosticInfo
7859
    '''
7860
7861
    ua_types = [
7862
7863
        ('StatusCode', 'StatusCode'),
7864
        ('OperandStatusCodes', 'ListOfStatusCode'),
7865
        ('OperandDiagnosticInfos', 'ListOfDiagnosticInfo'),
7866
               ]
7867
7868
    def __init__(self):
7869
        self.StatusCode = StatusCode()
7870
        self.OperandStatusCodes = []
7871
        self.OperandDiagnosticInfos = []
7872
        self._freeze = True
7873
7874
    def to_binary(self):
7875
        packet = []
7876
        packet.append(self.StatusCode.to_binary())
7877
        packet.append(uabin.Primitives.Int32.pack(len(self.OperandStatusCodes)))
7878
        for fieldname in self.OperandStatusCodes:
7879
            packet.append(fieldname.to_binary())
7880
        packet.append(uabin.Primitives.Int32.pack(len(self.OperandDiagnosticInfos)))
7881
        for fieldname in self.OperandDiagnosticInfos:
7882
            packet.append(fieldname.to_binary())
7883
        return b''.join(packet)
7884
7885
    @staticmethod
7886
    def from_binary(data):
7887
        obj = ContentFilterElementResult()
7888
        obj.StatusCode = StatusCode.from_binary(data)
7889
        length = uabin.Primitives.Int32.unpack(data)
7890
        array = []
7891
        if length != -1:
7892
            for _ in range(0, length):
7893
                array.append(StatusCode.from_binary(data))
7894
        obj.OperandStatusCodes = array
7895
        length = uabin.Primitives.Int32.unpack(data)
7896
        array = []
7897
        if length != -1:
7898
            for _ in range(0, length):
7899
                array.append(DiagnosticInfo.from_binary(data))
7900
        obj.OperandDiagnosticInfos = array
7901
        return obj
7902
7903
    def __str__(self):
7904
        return 'ContentFilterElementResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
7905
               'OperandStatusCodes:' + str(self.OperandStatusCodes) + ', ' + \
7906
               'OperandDiagnosticInfos:' + str(self.OperandDiagnosticInfos) + ')'
7907
7908
    __repr__ = __str__
7909
7910
7911
class ContentFilterResult(FrozenClass):
@@ 3794-3851 (lines=58) @@
3791
    __repr__ = __str__
3792
3793
3794
class ActivateSessionResult(FrozenClass):
3795
    '''
3796
    :ivar ServerNonce:
3797
    :vartype ServerNonce: ByteString
3798
    :ivar Results:
3799
    :vartype Results: StatusCode
3800
    :ivar DiagnosticInfos:
3801
    :vartype DiagnosticInfos: DiagnosticInfo
3802
    '''
3803
3804
    ua_types = [
3805
3806
        ('ServerNonce', 'ByteString'),
3807
        ('Results', 'ListOfStatusCode'),
3808
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
3809
               ]
3810
3811
    def __init__(self):
3812
        self.ServerNonce = None
3813
        self.Results = []
3814
        self.DiagnosticInfos = []
3815
        self._freeze = True
3816
3817
    def to_binary(self):
3818
        packet = []
3819
        packet.append(uabin.Primitives.ByteString.pack(self.ServerNonce))
3820
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
3821
        for fieldname in self.Results:
3822
            packet.append(fieldname.to_binary())
3823
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
3824
        for fieldname in self.DiagnosticInfos:
3825
            packet.append(fieldname.to_binary())
3826
        return b''.join(packet)
3827
3828
    @staticmethod
3829
    def from_binary(data):
3830
        obj = ActivateSessionResult()
3831
        self.ServerNonce = uabin.Primitives.ByteString.unpack(data)
3832
        length = uabin.Primitives.Int32.unpack(data)
3833
        array = []
3834
        if length != -1:
3835
            for _ in range(0, length):
3836
                array.append(StatusCode.from_binary(data))
3837
        obj.Results = array
3838
        length = uabin.Primitives.Int32.unpack(data)
3839
        array = []
3840
        if length != -1:
3841
            for _ in range(0, length):
3842
                array.append(DiagnosticInfo.from_binary(data))
3843
        obj.DiagnosticInfos = array
3844
        return obj
3845
3846
    def __str__(self):
3847
        return 'ActivateSessionResult(' + 'ServerNonce:' + str(self.ServerNonce) + ', ' + \
3848
               'Results:' + str(self.Results) + ', ' + \
3849
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
3850
3851
    __repr__ = __str__
3852
3853
3854
class ActivateSessionResponse(FrozenClass):