Node('flamemag.psi.ch',
     'flame magnet',
     interface='tcp://5000',
)

sea_cfg = 'flamemag.config'

Mod('cio',
    'frappy_psi.cryoltd.IO',
    'IO to cryo ltd software',
    uri='tcp://flamemag:3128',
)

Mod('main',
    'frappy_psi.cryoltd.Main',
    'master module',
    io='cio',
)

Mod('B',
    'frappy_psi.cryoltd.MainField',
    'magnetic field',
    channel='Main',
    main='main',
    constraint=80000.0,
    target=Param(
        max=35000.0,
    ),
    mode='PERSISTENT',
    hw_units='T',
    A_to_G=285.73,
    ramp=Param(
        max=412.0,
    ),
    overshoot={'o': 1.0, 't': 180.0},
    degauss={'s': 500.0, 'd': 30.0, 'f': 5.0, 't': 120.0},
    tolerance=5.0,
    wait_switch_on = 30,
    wait_switch_off = 30,
    wait_stable_field=180.0,
)

Mod('Bx',
    'frappy_psi.cryoltd.CorrectedField',
    'magnetic field x component',
    channel='VMX',
    main='main',
    check_against='B',
    target=Param(
        max=200.0,
    ),
    hw_units='A',
    A_to_G=4.134,
    ramp=Param(
        max=23.0,
    ),
    tolerance=1.0,
    offset=0.0,
)

Mod('By',
    'frappy_psi.cryoltd.CorrectedField',
    'magnetic field y component',
    channel='VMY',
    main='main',
    check_against='B',
    target=Param(
        max=100.0,
    ),
    hw_units='A',
    A_to_G=4.1117,
    ramp=Param(
        max=22.9,
    ),
    tolerance=1.0,
    offset=0.0,
)

Mod('Bz',
    'frappy_psi.cryoltd.CorrectedField',
    'magnetic field z component',
    channel='VMZ',
    main='main',
    check_against='B',
    target=Param(
        max=100.0,
    ),
    hw_units='A',
    A_to_G=5.74,
    ramp=Param(
        max=33.6,
    ),
    tolerance=1.0,
    offset=0.0,
)

Mod('compressorA',
    'frappy_psi.cryoltd.Compressor',
    'compressor A',
    channel='A',
    main='main',
)

Mod('compressorB',
    'frappy_psi.cryoltd.Compressor',
    'compressor B',
    channel='B',
    main='main',
)

Mod('T_stage1_A',
    'frappy_psi.cryoltd.Temperature', '',
    channel='1st Stage A',
    main='main',
)

Mod('T_stage2_A',
    'frappy_psi.cryoltd.Temperature', '',
    channel='2nd Stage A',
    main='main',
)

Mod('T_stage1_B',
    'frappy_psi.cryoltd.Temperature', '',
    channel='1st Stage B',
    main='main',
)

Mod('T_stage2_B',
    'frappy_psi.cryoltd.Temperature', '',
    channel='2nd Stage B',
    main='main',
)

Mod('T_top_A',
    'frappy_psi.cryoltd.Temperature', '',
    channel='Inner Magnet A (Top)',
    main='main',
)

Mod('T_bottom_A',
    'frappy_psi.cryoltd.Temperature', '',
    channel='Inner Magnet A (Bottom)',
    main='main',
)

Mod('T_top_B',
    'frappy_psi.cryoltd.Temperature', '',
    channel='Inner Magnet B (Top)',
    main='main',
)

Mod('T_bottom_B',
    'frappy_psi.cryoltd.Temperature', '',
    channel='Inner Magnet B (Bottom)',
    main='main',
)

Mod('T_Z_shim',
    'frappy_psi.cryoltd.Temperature', '',
    channel='Z Shim Former',
    main='main',
)

Mod('T_XY_shim',
    'frappy_psi.cryoltd.Temperature', '',
    channel='XY Shim Former',
    main='main',
)

Mod('T_XY_vector',
    'frappy_psi.cryoltd.Temperature', '',
    channel='XY Vector Former',
    main='main',
)

Mod('T_radiation_shield',
    'frappy_psi.cryoltd.Temperature', '',
    channel='Radiation Shield',
    main='main',
)

Mod('T_persistent_joints',
    'frappy_psi.cryoltd.Temperature', '',
    channel='Persistent Joints',
    main='main',
)

Mod('T_outer_A',
    'frappy_psi.cryoltd.Temperature', '',
    channel='Outer Magnet A',
    main='main',
)

Mod('T_outer_B',
    'frappy_psi.cryoltd.Temperature', '',
    channel='Outer Magnet B',
    main='main',
)

Mod('T_shim_B',
    'frappy_psi.cryoltd.Temperature', '',
    channel='Z Shim Former B',
    main='main',
)

Mod('T_bore_shield',
    'frappy_psi.cryoltd.Temperature', '',
    channel='Bore Radiation Shield',
    main='main',
)

Mod('T_XYZ_shim',
    'frappy_psi.cryoltd.Temperature', '',
    channel='XYZ Shim Plate',
    main='main',
)

Mod('T_Z_shim_switch',
    'frappy_psi.cryoltd.Temperature', '',
    channel='Z Shim Switch',
    main='main',
)

Mod('T_main_switch',
    'frappy_psi.cryoltd.Temperature', '',
    channel='Main Coil Switch',
    main='main',
)

Mod('Babs',
    'frappy_psi.cryoltd.AbsField', '',
    main='B',
    bx='Bx',
    by='By',
    bz='Bz',
)
