Node('varioxb.psi.ch',
     'VarioxB - 100 mm cryostat',
     interface='tcp://5000',
)

Mod('itc1',
    'frappy_psi.mercury.IO',
    'ITC for heat exchanger and pressures',
    uri='linvb-ts:3001',
)

Mod('itc2',
    'frappy_psi.mercury.IO',
    'ITC for neck and nv heaters',
    uri='linvb-ts:3002',
)

Mod('T_stat',
    'frappy_psi.mercury.TemperatureAutoFlow',
    'static heat exchanger temperature',
    meaning=['temperature_regulation', 27],
    output_module='htr_stat',
    needle_valve='p_stat',
    slot='DB6.T1',
    io='itc1',
    tolerance=0.1,
)

Mod('htr_stat',
    'frappy_psi.mercury.HeaterOutput',
    'static heat exchanger heater',
    slot='DB1.H1',
    io='itc1',
)

Mod('p_stat',
    'frappy_psi.mercury.PressureLoop',
    'static needle valve pressure',
    output_module='pos_stat',
    settling_time=60.0,
    slot='DB5.P1',
    io='itc1',
    tolerance=1.0,
    value=Param(
        unit='mbar_flow',
    ),
)

Mod('pos_stat',
    'frappy_psi.mercury.ValvePos',
    'static needle valve position',
    slot='DB5.P1,DB3.G1',
    io='itc1',
)

Mod('T_dyn',
    'frappy_psi.mercury.TemperatureAutoFlow',
    'dynamic heat exchanger temperature',
    output_module='htr_dyn',
    needle_valve='p_dyn',
    slot='DB7.T1',
    io='itc1',
    tolerance=0.1,
)

Mod('htr_dyn',
    'frappy_psi.mercury.HeaterOutput',
    'dynamic heat exchanger heater',
    slot='DB2.H1',
    io='itc1',
)

Mod('p_dyn',
    'frappy_psi.mercury.PressureLoop',
    'dynamic needle valve pressure',
    output_module='pos_dyn',
    settling_time=60.0,
    slot='DB8.P1',
    io='itc1',
    tolerance=1.0,
    value=Param(
        unit='mbar_flow',
    ),
)

Mod('pos_dyn',
    'frappy_psi.mercury.ValvePos',
    'dynamic needle valve position',
    slot='DB8.P1,DB4.G1',
    io='itc1',
)

Mod('lev',
    'frappy_psi.mercury.HeLevel',
    'LHe level',
    slot='DB4.L1',
    io='itc2',
)

Mod('n2lev',
    'frappy_psi.mercury.N2Level',
    'LN2 level',
    slot='DB4.L1',
    io='itc2',
)

Mod('T_neck1',
    'frappy_psi.mercury.TemperatureLoop',
    'neck heater 1 temperature',
    output_module='htr_neck1',
    slot='MB1.T1',
    io='itc2',
    tolerance=1.0,
)

Mod('htr_neck1',
    'frappy_psi.mercury.HeaterOutput',
    'neck heater 1 power',
    slot='MB0.H1',
    io='itc2',
)

Mod('T_neck2',
    'frappy_psi.mercury.TemperatureLoop',
    'neck heater 2 temperature',
    output_module='htr_neck2',
    slot='DB6.T1',
    io='itc2',
    tolerance=1.0,
)

Mod('htr_neck2',
    'frappy_psi.mercury.HeaterOutput',
    'neck heater 2 power',
    slot='DB1.H1',
    io='itc2',
)

Mod('T_nvs',
    'frappy_psi.mercury.TemperatureLoop',
    'static needle valve temperature',
    output_module='htr_nvs',
    slot='DB7.T1',
    io='itc2',
    tolerance=0.1,
)

Mod('htr_nvs',
    'frappy_psi.mercury.HeaterOutput',
    'static needle valve heater power',
    slot='DB2.H1',
    io='itc2',
)

Mod('T_nvd',
    'frappy_psi.mercury.TemperatureLoop',
    'dynamic needle valve heater temperature',
    output_module='htr_nvd',
    slot='DB8.T1',
    io='itc2',
    tolerance=0.1,
)

Mod('htr_nvd',
    'frappy_psi.mercury.HeaterOutput',
    'dynamic needle valve heater power',
    slot='DB3.H1',
    io='itc2',
)

# Motor controller is not yet available!
#
'''
Mod('om_io',
    'frappy_psi.phytron.PhytronIO',
    'dom motor IO',
    uri='mb11-ts.psi.ch:3004',
)

Mod('om',
    'frappy_psi.phytron.Motor',
    'stick rotation, typically used for omega',
    io='om_io',
    target_min=-180,
    target_max=360,
    encoder_mode='NO',
    target=Param(min=-180, max=360)
)
'''
