# error creating module mf:
#   Module mf needs a value for either 'uri' or 'io'
# error creating module pos:
#   Module pos needs a value for either 'uri' or 'io'
# error creating module lev:
#   Module lev needs a value for either 'uri' or 'io'
# error creating module chamber:
#   Module chamber needs a value for either 'uri' or 'io'
# error creating module r1:
#   Module r1 needs a value for either 'uri' or 'io'
# error creating module r2:
#   Module r2 needs a value for either 'uri' or 'io'
# error creating module r3:
#   Module r3 needs a value for either 'uri' or 'io'
# error creating module r4:
#   Module r4 needs a value for either 'uri' or 'io'
# error creating module i1:
#   Module i1 needs a value for either 'uri' or 'io'
# error creating module i2:
#   Module i2 needs a value for either 'uri' or 'io'
# error creating module i3:
#   Module i3 needs a value for either 'uri' or 'io'
# error creating module i4:
#   Module i4 needs a value for either 'uri' or 'io'
# error creating module v1:
#   Module v1 needs a value for either 'uri' or 'io'
# error creating module v2:
#   Module v2 needs a value for either 'uri' or 'io'
# error creating module tv:
#   Module tv needs a value for either 'uri' or 'io'
# error creating module ts:
#   Module ts needs a value for either 'uri' or 'io'
Node('PPMS.psi.ch',
     'PPMS at PSI',
     interface='tcp://5000',
)

Mod('tt',
    'frappy_psi.ppms.Temp',
    'main temperature',
    io='ppms',
)

Mod('mf',
    'frappy_psi.ppms.Field',
    target=Param(
        min=-9,
        max=9,
    ),
    description='magnetic field',
    io='ppms',
)

Mod('pos',
    'frappy_psi.ppms.Position',
    description='sample rotator',
    io='ppms',
)

Mod('lev',
    'frappy_psi.ppms.Level',
    description='helium level',
    io='ppms',
)

Mod('chamber',
    'frappy_psi.ppms.Chamber',
    description='chamber state',
    io='ppms',
)

Mod('r1',
    'frappy_psi.ppms.BridgeChannel',
    description='resistivity channel 1',
    no=1,
    value=Param(
        unit='Ohm',
    ),
    io='ppms',
)

Mod('r2',
    'frappy_psi.ppms.BridgeChannel',
    description='resistivity channel 2',
    no=2,
    value=Param(
        unit='Ohm',
    ),
    io='ppms',
)

Mod('r3',
    'frappy_psi.ppms.BridgeChannel',
    description='resistivity channel 3',
    no=3,
    value=Param(
        unit='Ohm',
    ),
    io='ppms',
)

Mod('r4',
    'frappy_psi.ppms.BridgeChannel',
    description='resistivity channel 4',
    no=4,
    value=Param(
        unit='Ohm',
    ),
    io='ppms',
)

Mod('i1',
    'frappy_psi.ppms.Channel',
    description='current channel 1',
    no=1,
    value=Param(
        unit='uA',
    ),
    io='ppms',
)

Mod('i2',
    'frappy_psi.ppms.Channel',
    description='current channel 2',
    no=2,
    value=Param(
        unit='uA',
    ),
    io='ppms',
)

Mod('i3',
    'frappy_psi.ppms.Channel',
    description='current channel 3',
    no=3,
    value=Param(
        unit='uA',
    ),
    io='ppms',
)

Mod('i4',
    'frappy_psi.ppms.Channel',
    description='current channel 4',
    no=4,
    value=Param(
        unit='uA',
    ),
    io='ppms',
)

Mod('v1',
    'frappy_psi.ppms.DriverChannel',
    description='voltage channel 1',
    no=1,
    value=Param(
        unit='V',
    ),
    io='ppms',
)

Mod('v2',
    'frappy_psi.ppms.DriverChannel',
    description='voltage channel 2',
    no=2,
    value=Param(
        unit='V',
    ),
    io='ppms',
)

Mod('tv',
    'frappy_psi.ppms.UserChannel',
    description='VTI temperature',
    enabled=0,
    linkenable='ts',
    value=Param(
        unit='K',
    ),
    io='ppms',
)

Mod('ts',
    'frappy_psi.ppms.UserChannel',
    description='sample temperature',
    enabled=0,
    linkenable='tv',
    value=Param(
        unit='K',
    ),
    io='ppms',
)

Mod('ppms',
    'frappy_psi.ppms.Main',
    description='the main and poller module',
    class_id='QD.MULTIVU.PPMS.1',
    pollinterval=2.0,
)
