Node('fi.psi.ch',
     'ILL furnace',
     'tcp://5000',
     )

Mod('T_main',
    'frappy_psi.furnace.PRtransmitter',
    'sample temperature',
    addr='ai2',
    valuerange=(0, 2300),
    value=Param(unit='degC'),
    )

Mod('T_extra',
    'frappy_psi.furnace.PRtransmitter',
    'extra temperature',
    addr='ai1',
    valuerange=(0, 2300),
    value=Param(unit='degC'),
    )

Mod('T_wall',
    'frappy_psi.ionopimax.VoltageInput',
    'furnace wall temperature',
    addr='av2',
    rawrange=(0, 1.5),
    valuerange=(0, 150),
    value=Param(unit='degC'),
    )

Mod('T3',
    'frappy_psi.furnace.PRtransmitter',
    'extra temperature',
    addr='ai3',
    valuerange=(0, 1372),
    value=Param(unit='degC'),
    )

Mod('T4',
    'frappy_psi.furnace.PRtransmitter',
    'extra temperature',
    addr='ai4',
    valuerange=(0, 1372),
    value=Param(unit='degC'),
    )

Mod('T',
    'frappy_psi.furnace.PIctrl',
    'controlled temperature ',
    value = Param(unit='degC'),
    input_module = 'T_htr',
    output_module = 't_out',
    output_min = 0,
    output_max = 100,
    p = 1,
    i = 0.01,
   )

Mod('htr_io',
    'frappy_psi.tdkpower.IO',
    'powersupply communicator',
    uri='serial:///dev/ttyUSB0?baudrate=9600',
    )

Mod('htr_power',
    'frappy_psi.tdkpower.Power',
    'heater power',
    io='htr_io',
    )

Mod('htr',
    'frappy_psi.furnace.TdkOutput',
    'heater output',
    io='htr_io',
    maxvolt=8,
    maxcurrent=200,
    )

Mod('flowswitch',
    'frappy_psi.ionopimax.DigitalInput',
    'flow switch',
    addr='dt2',
    true_level='low',
    )

Mod('interlock',
    'frappy_psi.furnace.Interlocks',
    'interlock parameters',
    main_T='T_main',
    extra_T='T_extra',
    wall_T='T_wall',
    vacuum='p',
    control='T',
    htr='htr',
    flowswitch='flowswitch',
    wall_limit=50,
    main_T_limit = 1400,
    extra_T_limit = 1400,
    vacuum_limit=0.001,
    )

Mod('p',
    'frappy_psi.furnace.PKRgauge',
    'pressure reading',
    addr = 'av1',
    rawrange = (1.82, 8.6),
    valuerange = (5e-9, 1000),
    value = Param(unit='mbar'),
   )

Mod('vso',
    'frappy_psi.ionopimax.VoltagePower',
    'voltage power output',
    target = 24,
    export = False,
   )
