Skip to content

Class definition

Line

Bases: PviObject

class representing a PVI Line

Typical usage example:

pviConnection = Connection()
line = Line( pviConnection.root, 'LNANSL', CD='LNANSL')
device = Device( line, 'TCP', CD='/IF=TcpIp' )
Source code in pvi\pvi_objects\Line.py
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
class Line(PviObject):
    '''class representing a PVI Line

        Typical usage example:
        ```
        pviConnection = Connection()
        line = Line( pviConnection.root, 'LNANSL', CD='LNANSL')
        device = Device( line, 'TCP', CD='/IF=TcpIp' )
        ```
    '''
    def __init__( self, parent : PviObject, name : str, **objectDescriptor: Union[str,int, float]):
        '''
        Args: 
            parent : PVI connection's root object
            name : name of the line in PVI hierarchy, e.g. 'LNANSL'
            objectDescriptor: 
                ANSL : CD='LNANSL'  
                INA2000 : CD='LNINA2'  
                SNMP : CD='LNSNMP'

        '''
        if parent.type != T_POBJ_TYPE.POBJ_PVI:
            raise PviError(12009, self)         
        super().__init__( parent, T_POBJ_TYPE.POBJ_LINE, name, **objectDescriptor)

    def __repr__(self):
        return f"Line( name={self._name}, linkID={self._linkID} )"

__init__(parent, name, **objectDescriptor)

Parameters:

Name Type Description Default
parent

PVI connection's root object

required
name

name of the line in PVI hierarchy, e.g. 'LNANSL'

required
objectDescriptor Union[str, int, float]

ANSL : CD='LNANSL'
INA2000 : CD='LNINA2'
SNMP : CD='LNSNMP'

{}
Source code in pvi\pvi_objects\Line.py
39
40
41
42
43
44
45
46
47
48
49
50
51
52
def __init__( self, parent : PviObject, name : str, **objectDescriptor: Union[str,int, float]):
    '''
    Args: 
        parent : PVI connection's root object
        name : name of the line in PVI hierarchy, e.g. 'LNANSL'
        objectDescriptor: 
            ANSL : CD='LNANSL'  
            INA2000 : CD='LNINA2'  
            SNMP : CD='LNSNMP'

    '''
    if parent.type != T_POBJ_TYPE.POBJ_PVI:
        raise PviError(12009, self)         
    super().__init__( parent, T_POBJ_TYPE.POBJ_LINE, name, **objectDescriptor)