#!/bin/sh

caput FBCK:FB10:TR01:STATE 0
caput -a FBCK:FB10:TR01:POI1 6 12 23 41 23 32 53

# F matrix
caput -a FBCK:FB10:TR01:FMATRIX 17 1 0 0 0 0.97811 1.9127 0 0 0 0 1 0 0 0 1.022 1.997 0 0 0 0 

# G matrix
caput -a FBCK:FB10:TR01:GMATRIX 10 2.5181 2.8809 0 0 -0.33363 1.1087 0 0 0 0 -0.34556 2.3591 0 0 -0.5343 0.89322 0 0 0 0 

# Loop configs
caput FBCK:FB10:TR01:NAME Inj
caput FBCK:FB10:TR01:INSTALLED 1
caput FBCK:FB10:TR01:TOTALPOI 1
caput FBCK:FB10:TR01:ITERATEFUNC TrajectoryFit

# Measurements
caput FBCK:FB10:TR01:M1DEVNAME BPMS:IN20:581:X
caput FBCK:FB10:TR01:M1USED 1
caput FBCK:FB10:TR01:M1CAMODE 1

caput FBCK:FB10:TR01:M2DEVNAME BPMS:IN20:631:X
caput FBCK:FB10:TR01:M2USED 1
caput FBCK:FB10:TR01:M2CAMODE 1

caput FBCK:FB10:TR01:M3DEVNAME BPMS:IN20:581:Y
caput FBCK:FB10:TR01:M3USED 1
caput FBCK:FB10:TR01:M3CAMODE 1

caput FBCK:FB10:TR01:M4DEVNAME BPMS:IN20:631:Y
caput FBCK:FB10:TR01:M4USED 1
caput FBCK:FB10:TR01:M4CAMODE 1

# States
caput FBCK:FB10:TR01:S1NAME "X Position"
caput FBCK:FB10:TR01:S1USED 1

caput FBCK:FB10:TR01:S2NAME "X Angle"
caput FBCK:FB10:TR01:S2USED 1

caput FBCK:FB10:TR01:S3NAME "Y Position"
caput FBCK:FB10:TR01:S3USED 1

caput FBCK:FB10:TR01:S4NAME "Y Angle"
caput FBCK:FB10:TR01:S4USED 1

# Actuators
caput FBCK:FB10:TR01:A1DEVNAME FILE:/tmp/XCOR.381.BCTRL
caput FBCK:FB10:TR01:A1USED 1
caput FBCK:FB10:TR01:A1CAMODE 1

caput FBCK:FB10:TR01:A2DEVNAME FILE:/tmp/XCOR.521.BCTRL
caput FBCK:FB10:TR01:A2USED 1
caput FBCK:FB10:TR01:A2CAMODE 1

caput FBCK:FB10:TR01:A3DEVNAME FILE:/tmp/YCOR.382.BCTRL
caput FBCK:FB10:TR01:A3USED 1
caput FBCK:FB10:TR01:A3CAMODE 1

caput FBCK:FB10:TR01:A4DEVNAME FILE:/tmp/IN20.522.BCTRL
caput FBCK:FB10:TR01:A4USED 1
caput FBCK:FB10:TR01:A4CAMODE 1

#enable loop
caput FBCK:FB10:TR01:INSTALLED 1
caput FBCK:FB10:TR01:STATE ON
