##########################################################################################################
##########################################################################################################
##########################################################################################################
###    EPICS PVS


###########################################################################
####    MACHINE

pvs_machine = [
    "SARCL02-MBND100:P-READ",  # Predicted bunch energy
    "SARUN:FELPHOTENE.VAL",    # Predicted photon energy from machine settings
]

# accelerator parameters
pvs_RF = [
    "SINSB01-RSYS:GET-VSUM-PHASE-OFFSET",
    "SINSB02-RSYS:GET-VSUM-PHASE-OFFSET",
    "SINSB03-RSYS:GET-VSUM-PHASE-OFFSET",
    "SINSB04-RSYS:GET-VSUM-PHASE-OFFSET",
    "SINXB01-RSYS:GET-VSUM-PHASE-OFFSET",
    "SINDI01-RSYS:GET-VSUM-PHASE-OFFSET",
    "S10CB01-RSYS:GET-VSUM-PHASE-OFFSET",
    "S10CB02-RSYS:GET-VSUM-PHASE-OFFSET",
    "S10CB03-RSYS:GET-VSUM-PHASE-OFFSET",
    "S10CB04-RSYS:GET-VSUM-PHASE-OFFSET",
    "S10CB06-RSYS:GET-VSUM-PHASE-OFFSET",
    "S10CB05-RSYS:GET-VSUM-PHASE-OFFSET",
    "S10CB07-RSYS:GET-VSUM-PHASE-OFFSET",
    "S10CB08-RSYS:GET-VSUM-PHASE-OFFSET",
    "S10CB09-RSYS:GET-VSUM-PHASE-OFFSET",
    "S20CB01-RSYS:GET-VSUM-PHASE-OFFSET",
    "S20CB02-RSYS:GET-VSUM-PHASE-OFFSET",
    "S20CB03-RSYS:GET-VSUM-PHASE-OFFSET",
    "S20CB04-RSYS:GET-VSUM-PHASE-OFFSET",
    "S30CB01-RSYS:GET-VSUM-PHASE-OFFSET",
    "S30CB02-RSYS:GET-VSUM-PHASE-OFFSET",
    "S30CB03-RSYS:GET-VSUM-PHASE-OFFSET",
    "S30CB04-RSYS:GET-VSUM-PHASE-OFFSET",
    "S30CB05-RSYS:GET-VSUM-PHASE-OFFSET",
    "S30CB06-RSYS:GET-VSUM-PHASE-OFFSET",
    "S30CB07-RSYS:GET-VSUM-PHASE-OFFSET",
    "S30CB08-RSYS:GET-VSUM-PHASE-OFFSET",
    "S30CB09-RSYS:GET-VSUM-PHASE-OFFSET",
    "S30CB10-RSYS:GET-VSUM-PHASE-OFFSET",
    "S30CB11-RSYS:GET-VSUM-PHASE-OFFSET",
    "S30CB12-RSYS:GET-VSUM-PHASE-OFFSET",
    "S30CB13-RSYS:GET-VSUM-PHASE-OFFSET",
    "S30CB14-RSYS:GET-VSUM-PHASE-OFFSET",
    "SINEG01-RSYS:GET-VSUM-AMPLT-SCALE",
    "SINSB01-RSYS:GET-VSUM-AMPLT-SCALE",
    "SINSB02-RSYS:GET-VSUM-AMPLT-SCALE",
    "SINSB03-RSYS:GET-VSUM-AMPLT-SCALE",
    "SINSB04-RSYS:GET-VSUM-AMPLT-SCALE",
    "SINXB01-RSYS:GET-VSUM-AMPLT-SCALE",
    "SINDI01-RSYS:GET-VSUM-AMPLT-SCALE",
    "S10CB01-RSYS:GET-VSUM-AMPLT-SCALE",
    "S10CB02-RSYS:GET-VSUM-AMPLT-SCALE",
    "S10CB03-RSYS:GET-VSUM-AMPLT-SCALE",
    "S10CB04-RSYS:GET-VSUM-AMPLT-SCALE",
    "S10CB05-RSYS:GET-VSUM-AMPLT-SCALE",
    "S10CB06-RSYS:GET-VSUM-AMPLT-SCALE",
    "S10CB07-RSYS:GET-VSUM-AMPLT-SCALE",
    "S10CB08-RSYS:GET-VSUM-AMPLT-SCALE",
    "S10CB09-RSYS:GET-VSUM-AMPLT-SCALE",
    "S20CB01-RSYS:GET-VSUM-AMPLT-SCALE",
    "S20CB02-RSYS:GET-VSUM-AMPLT-SCALE",
    "S20CB03-RSYS:GET-VSUM-AMPLT-SCALE",
    "S20CB04-RSYS:GET-VSUM-AMPLT-SCALE",
    "S30CB01-RSYS:GET-VSUM-AMPLT-SCALE",
    "S30CB02-RSYS:GET-VSUM-AMPLT-SCALE",
    "S30CB03-RSYS:GET-VSUM-AMPLT-SCALE",
    "S30CB04-RSYS:GET-VSUM-AMPLT-SCALE",
    "S30CB05-RSYS:GET-VSUM-AMPLT-SCALE",
    "S30CB06-RSYS:GET-VSUM-AMPLT-SCALE",
    "S30CB07-RSYS:GET-VSUM-AMPLT-SCALE",
    "S30CB08-RSYS:GET-VSUM-AMPLT-SCALE",
    "S30CB09-RSYS:GET-VSUM-AMPLT-SCALE",
    "S30CB10-RSYS:GET-VSUM-AMPLT-SCALE",
    "S30CB11-RSYS:GET-VSUM-AMPLT-SCALE",
    "S30CB12-RSYS:GET-VSUM-AMPLT-SCALE",
    "S30CB13-RSYS:GET-VSUM-AMPLT-SCALE",
    "S30CB14-RSYS:GET-VSUM-AMPLT-SCALE",
]


#######################
# Undulator gap

pvs_undulator = [
    "SARUN03-UIND030:K_SET.VAL",
    "SARUN04-UIND030:K_SET.VAL",
    "SARUN05-UIND030:K_SET.VAL",
    "SARUN06-UIND030:K_SET.VAL",
    "SARUN07-UIND030:K_SET.VAL",
    "SARUN08-UIND030:K_SET.VAL",
    "SARUN09-UIND030:K_SET.VAL",
    "SARUN10-UIND030:K_SET.VAL",
    "SARUN11-UIND030:K_SET.VAL",
    "SARUN12-UIND030:K_SET.VAL",
    "SARUN13-UIND030:K_SET.VAL",
    "SARUN14-UIND030:K_SET.VAL",
    "SARUN15-UIND030:K_SET.VAL",
    "SFB_POINTING_AR:SP1",
    "SFB_POINTING_AR:SP2",
    "SFB_POINTING_AR:ONOFF1",
    "SGE-HL-FPAR:X-SLOPE1",
    "SGE-HL-FPAR:Y-SLOPE1",
    "SGE-HL-FPAR:X-OFFSET1",
    "SGE-HL-FPAR:Y-OFFSET1",
]




###########################################################################
####    FRONT-END

#####################
# Slits OAPU044

pvs_OAPU044 = [
    "SARFE10-OAPU044:MOTOR_X",
    "SARFE10-OAPU044:MOTOR_Y",
    "SARFE10-OAPU044:MOTOR_W",
    "SARFE10-OAPU044:MOTOR_H",
]


####################
# Gas intensity monitor PBPG050

pvs_gas_monitor = [
    "SARFE10-PBPG050:PHOTON-ENERGY-PER-PULSE-US",
    "SARFE10-PBPG050:PHOTON-ENERGY-PER-PULSE-DS",
    "SARFE10-PBPG050:PHOTON-ENERGY-PER-PULSE-AVG",
]


###################
# Beam position and intensity monitor PBPS053

pvs_PBPS053 = [
    "SARFE10-PBPS053:MOTOR_X1",
    # "SARFE10-PBPS053:MOTOR_X2", # Not available, disabled
    "SARFE10-PBPS053:MOTOR_PROBE",
]


####################
# Upstream attenuator OATT053

pvs_OATT053_old = [
    "SARFE10-OATT053:MOTOR_1",
    "SARFE10-OATT053:MOTOR_1.RBV",
    "SARFE10-OATT053:MOTOR_2",
    "SARFE10-OATT053:MOTOR_2.RBV",
    "SARFE10-OATT053:MOTOR_3",
    "SARFE10-OATT053:MOTOR_3.RBV",
    "SARFE10-OATT053:MOTOR_4",
    "SARFE10-OATT053:MOTOR_4.RBV",
    "SARFE10-OATT053:MOTOR_5",
    "SARFE10-OATT053:MOTOR_5.RBV",
    "SARFE10-OATT053:MOTOR_6",
    "SARFE10-OATT053:MOTOR_6.RBV",
    "SARFE10-OATT053:ENERGY",
    "SARFE10-OATT053:TRANS_SP",
    "SARFE10-OATT053:TRANS_RB",
]


####################
# New Upstream attenuator OATT053

pvs_OATT053 = [
    "SARFE10-OATT053:photonenergy", #        Photon energy for Transmission          
    "SARFE10-OATT053:transmission", #        Total Transmission of all stages        
    "SARFE10-OATT053:transmission3", #
    "SARFE10-OATT053:PHOTONENERGY_local", # Manually entered Photon Energy 
    "SARFE10-OATT053:ENERGY", #  Energy eV"
    "SARFE10-OATT053:MOTOR_1",  #                  motor             Motor 1         
    "SARFE10-OATT053:MOTOR_2",  #                   motor             Motor 2        
    "SARFE10-OATT053:MOTOR_3",  #                   motor             Motor 3        
    "SARFE10-OATT053:MOTOR_4",  #                   motor             Motor 4        
    "SARFE10-OATT053:MOTOR_5",  #                   motor             Motor 5        
    "SARFE10-OATT053:MOTOR_6",  #                   motor             Motor 6
    "SAROP31-OATT053:UsrRec.TC1",  # current transmission
    "SAROP31-OATT053:UsrRec.TR1",  # resulting transmission
    "SAROP31-OATT053:UsrRec.TD",   # setpoint transmission
]


###################
# Beam profile monitor PPRM053

pvs_PPRM053 = [
    "SARFE10-PPRM053:MOTOR_PROBE.RBV",
    #"SARFE10-PPRM053:FPICTURE", 
    #"SARFE10-PPRM064:FPICTURE", # TODO move to correct place
]


###################
# Diode PDIM053

# pvs_PDIM053 = [
# ]


###################
# Spectrometer PSSS059

pvs_PSSS059 = [
    "SARFE10-PSSS055:MOTOR_X1.RBV",
    "SARFE10-PSSS055:MOTOR_Y1.RBV",
    "SARFE10-PSSS055:MOTOR_ROT_X1.RBV",
    "SARFE10-PSSS055:MOTOR_PROBE.RBV",
    "SARFE10-PSSS059:MOTOR_X3.RBV",
    "SARFE10-PSSS059:MOTOR_Y3.RBV",
    "SARFE10-PSSS059:MOTOR_ROT_X3.RBV",
    "SARFE10-PSSS059:MOTOR_Y4.RBV",
    "SARFE10-PSSS059:MOTOR_ROT_X4.RBV",
    "SARFE10-PSSS059:MOTOR_X5.RBV",
    "SARFE10-PSSS059:MOTOR_Y5.RBV",
    "SARFE10-PSSS059:MOTOR_Z5.RBV",
    "SARFE10-PSSS055:GRATING_SP",
    "SARFE10-PSSS059:CRYSTAL_SP",
    "SARFE10-PSSS059:SPC_ROI_YMIN",
    "SARFE10-PSSS059:SPC_ROI_YMAX",
    "SARFE10-PSSS055:MOTOR_PROBE.RBV",
]


###################
# PPRM064

# pvs_PPRM064 = [
# ]


###################
# Alvra M1 horizontal offset mirror

# pvs_OOMH064 = [
# ]


###################
# PPRM066

# pvs_PPRM066 = [
# ]




###########################################################################
####    BERNINA BRANCH until DCM


###################
# Bernina photon energy

pvs_photon_energy_bernina = [
    "SAROP21-ARAMIS:ENERGY_SP",
    "SAROP21-ARAMIS:ENERGY",
]


###################
# Bernina apertures OAPU092

pvs_OAPU092_bernina = [
    "SAROP21-OAPU092:MOTOR_X.RBV",
    "SAROP21-OAPU092:MOTOR_Y.RBV",
    "SAROP21-OAPU092:MOTOR_W.RBV",
    "SAROP21-OAPU092:MOTOR_H.RBV",
]


###################
# Bernina M1 vertical offset mirror

pvs_OOMV092_bernina = [
    "SAROP21-OOMV092:W_X.RBV",
    "SAROP21-OOMV092:W_Y.RBV",
    "SAROP21-OOMV092:W_RX.RBV",
    "SAROP21-OOMV092:W_RZ.RBV",
    "SAROP21-OOMV092:BU.RBV",
    "SAROP21-OOMV092:BD.RBV",
    "SAROP21-OOMV092:VS1.RBV",
    "SAROP21-OOMV092:VS2.RBV",
    "SAROP21-OOMV092:VS3.RBV",
    "SAROP21-OOMV092:TX.RBV",
]


###################
# Bernina post-M1 screen PPRM094

pvs_PPRM094_bernina = [
    "SAROP21-PPRM113:MOTOR_PROBE",
]


###################
# Bernina M2 vertical offset mirror

pvs_OOMV096_bernina = [
    "SAROP21-OOMV096:W_X.RBV",
    "SAROP21-OOMV096:W_Y.RBV",
    "SAROP21-OOMV096:W_RX.RBV",
    "SAROP21-OOMV096:W_RZ.RBV",
    "SAROP21-OOMV096:BU.RBV",
    "SAROP21-OOMV096:BD.RBV",
    "SAROP21-OOMV096:VS1.RBV",
    "SAROP21-OOMV096:VS2.RBV",
    "SAROP21-OOMV096:VS3.RBV",
    "SAROP21-OOMV096:TX.RBV",
]


###################
# Bernina post-M2 screen PSCR097

pvs_PSCR097_bernina = [
    "SAROP21-PSCR097:MOTOR_Y1.RBV",
]


###################
# Bernina DCM ODCM098

pvs_ODCM098_bernina = [
    "SAROP21-ODCM098:RX12.RBV", #     BRAGG  	
    "SAROP21-ODCM098:TX12.RBV", #     Horizontal	
    "SAROP21-ODCM098:T2.RBV", #       Crystal gap T2 
    "SAROP21-ODCM098:RZ1.RBV", #      1st xtal roll  
    "SAROP21-ODCM098:RZ2.RBV", #      2nd xtal roll  
    "SAROP21-ODCM098:RX2.RBV", #      2nd xtal pitch 
    "SAROP21-ODCM098:ENERGY", #      DCM photon energy
]


###################
# Bernina apertures OAPU102

pvs_OAPU102_bernina = [
    "SAROP21-OAPU102:MOTOR_X.RBV",
    "SAROP21-OAPU102:MOTOR_Y.RBV",
    "SAROP21-OAPU102:MOTOR_W.RBV",
    "SAROP21-OAPU102:MOTOR_H.RBV",
]


###################
# Bernina spontaneous radiation monitor PSRD103

pvs_PSRD103_bernina = [
    "SAROP21-PSRD103:MOTOR_PROBE",
]


###################
# Bernina beam intensity and position monitor PBPS113 (alias PBPS103)

pvs_PBPS113_bernina = [
    "SAROP21-PBPS103:MOTOR_X1.DRBV",
    "SAROP21-PBPS103:MOTOR_Y1.DRBV",
    "SAROP21-PBPS103:MOTOR_X1.RBV",
    "SAROP21-PBPS103:MOTOR_Y1.RBV",
    "SAROP21-PBPS103:MOTOR_PROBE.RBV",
    "SAROP21-PPRM113:MOTOR_PROBE.RBV"
]


###################
# Bernina pulse-picker OPPI113

pvs_OPPI113_bernina = [
    "SAROP21-OPPI113:MOTOR_X1.RBV", # X1 instead of X
    "SAROP21-OPPI113:MOTOR_Y1.RBV", # Y1 instead of X
    "SAROP21-OPPI113:TC1", # Pulse picker temperature
]


###################
# Bernina screen PPRM113

pvs_PPRM113_bernina = [
    "SAROP21-PPRM113:MOTOR_PROBE.RBV",
]




###########################################################################
####    CRISTALLINA BRANCH


####################
# Cristallina M1 horizontal offset mirror OOMH067

pvs_OOMH067 = [
    "SAROP31-OOMH067:W_X.RBV",
    "SAROP31-OOMH067:W_Y.RBV",
    "SAROP31-OOMH067:W_RX.RBV",
    "SAROP31-OOMH067:W_RY.RBV",
    "SAROP31-OOMH067:W_RZ.RBV",
    "SAROP31-OOMH067:BU.RBV",
    "SAROP31-OOMH067:BD.RBV",
    "SAROP31-OOMH067:VS1.RBV",
    "SAROP31-OOMH067:VS2.RBV",
    "SAROP31-OOMH067:VS3.RBV",
    "SAROP31-OOMH067:TX.RBV",
    "SAROP31-OOMH067:RY.RBV",
]


####################
# Beam screen between the first two horizontal mirrors PSCR068
pvs_PSCR068 = [
    "SAROP31-PSCR068:MOTOR_PROBE.RBV",
]


####################
# Cristallina M2 horizontal offset mirror OOMH084

pvs_OOMH084 = [
    "SAROP31-OOMH084:W_X.RBV",
    "SAROP31-OOMH084:W_Y.RBV",
    "SAROP31-OOMH084:W_RX.RBV",
    "SAROP31-OOMH084:W_RY.RBV",
    "SAROP31-OOMH084:W_RZ.RBV",
    "SAROP31-OOMH084:BU.RBV",
    "SAROP31-OOMH084:BD.RBV",
    "SAROP31-OOMH084:VS1.RBV",
    "SAROP31-OOMH084:VS2.RBV",
    "SAROP31-OOMH084:VS3.RBV",
    "SAROP31-OOMH084:TX.RBV",
    "SAROP31-OOMH084:RY.RBV",
]


###################
# Beam profile monitor PPRM085

pvs_PPRM085 = [
    "SAROP31-PPRM085:MOTOR_PROBE.RBV",
]


###################
# Slits OAPU107

pvs_OAPU107 = [
    "SAROP31-OAPU107:MOTOR_X.RBV",
    "SAROP31-OAPU107:MOTOR_Y.RBV",
    "SAROP31-OAPU107:MOTOR_W.RBV",
    "SAROP31-OAPU107:MOTOR_H.RBV",
]


###################
## Double channel-cut monochromator ODCC110

pvs_ODCC110 = [
    "SAROP31-ODCC110:MOT_RX1.RBV",
    "SAROP31-ODCC110:MOT_RX2.RBV",
    "SAROP31-ODCC110:MOT_ENY.RBV",
    "SAROP31-ODCC110:MOT_OFS.RBV",
    "SAROP31-ODCC110:MOT_TX1.RBV",
    "SAROP31-ODCC110:ENC_RX11",
    "SAROP31-ODCC110:ENC_RX12",
    "SAROP31-ODCC110:ENC_RX21",
    "SAROP31-ODCC110:ENC_RX22",
    "SAROP31-ODCC110:ENC_RX1I",
    "SAROP31-ODCC110:ENC_RX1A",
    "SAROP31-ODCC110:ENC_RX2I",
    "SAROP31-ODCC110:ENC_RX2A",
]


###################
## Infra-channel-cut-crystals screen PSCR110110

pvs_PSCR110 = [
    "SAROP31-PSCR110:MOT_TY1.RBV",
]


###################
## Beam position and intensity monitor PBPS113

pvs_PBPS113 = [
    "SAROP31-PBPS113:MOTOR_X1.DRBV",
    "SAROP31-PBPS113:MOTOR_Y1.DRBV",
    "SAROP31-PBPS113:MOTOR_X1.RBV",
    "SAROP31-PBPS113:MOTOR_Y1.RBV",
    "SAROP31-PBPS113:MOTOR_PROBE.RBV",
]


###################
# Diode PDIM113

pvs_PDIM113 = [
    "SAROP31-PDIM113:MOTOR_PROBE.RBV",
]


###################
# Beam profile monitor PPRM113

pvs_PPRM113 = [
    "SAROP31-PPRM113:MOTOR_PROBE.RBV",
]


####################
# Alignment laser mirror OLAS147

pvs_OLAS147 = [
    "SAROP31-OLAS147:MOTOR_1.RBV",
]


###################
# Slits OAPU149

pvs_OAPU149 = [
    "SAROP31-OAPU149:MOTOR_X.RBV",
    "SAROP31-OAPU149:MOTOR_Y.RBV",
    "SAROP31-OAPU149:MOTOR_W.RBV",
    "SAROP31-OAPU149:MOTOR_H.RBV",
]


###################
# Beam position and intensity monitor PBPS149

pvs_PBPS149 = [
    "SAROP31-PBPS149:MOTOR_X1.DRBV",
    "SAROP31-PBPS149:MOTOR_Y1.DRBV",
    "SAROP31-PBPS149:MOTOR_X1.RBV",
    "SAROP31-PBPS149:MOTOR_Y1.RBV",
    "SAROP31-PBPS149:MOTOR_PROBE.RBV",
]


###################
# Beam profile monitor PPRM150

pvs_PPRM150 = [
    "SAROP31-PPRM150:MOTOR_PROBE.RBV",
]


####################
# Attenuators OATA150, old

pvs_OATA150_old = [
    "SAROP31-OATA150:MOTOR_1.RBV",
    "SAROP31-OATA150:MOTOR_2.RBV",
    "SAROP31-OATA150:MOTOR_3.RBV",
    "SAROP31-OATA150:MOTOR_4.RBV",
    "SAROP31-OATA150:MOTOR_5.RBV",
    "SAROP31-OATA150:MOTOR_6.RBV",
    "SAROP31-OATA150:ENERGY",
    "SAROP31-OATA150:TRANS_SP",
    "SAROP31-OATA150:TRANS_RB",
    "SAROP31-OATA150:TRANS3EDHARM_RB",
    "SAROP31-OATA150:MOT2TRANS.VALD"
]


####################
# Attenuators OATA150

pvs_OATA150 = [
    "SAROP31-OATA150:photonenergy", #              ai                Photon energy for Transmission            SAROP31-CPCL-OSAT150       swissfel
    "SAROP31-OATA150:transmission", #         ai                Total Transmission of all stages          SAROP31-CPCL-OSAT150       swissfel
    "SAROP31-OATA150:transmission3", #
    "SAROP31-OATA150:PHOTONENERGY_local", # Manually entered Photon Energy 
    "SAROP31-OATA150:ENERGY", #  Energy eV"
    "SAROP31-OATA150:MOTOR_1",  #                  motor             Motor 1                                   SAROP31-CPPM-MOT7171       swissfel
    "SAROP31-OATA150:MOTOR_2",  #                   motor             Motor 2                                   SAROP31-CPPM-MOT7171       swissfel
    "SAROP31-OATA150:MOTOR_3",  #                   motor             Motor 3                                   SAROP31-CPPM-MOT7171       swissfel
    "SAROP31-OATA150:MOTOR_4",  #                   motor             Motor 4                                   SAROP31-CPPM-MOT7171       swissfel
    "SAROP31-OATA150:MOTOR_5",  #                   motor             Motor 5                                   SAROP31-CPPM-MOT7171       swissfel
    "SAROP31-OATA150:MOTOR_6",  #                   motor             Motor 6  
    "SAROP31-OATA150:UsrRec.TC1",  # current transmission
    "SAROP31-OATA150:UsrRec.TR1",  # resulting transmission
    "SAROP31-OATA150:UsrRec.TD",   # setpoint transmission
]


####################
# Pulse picker OPPI151

pvs_OPPI151 = [
    "SAROP31-OPPI151:MOTOR_X1.RBV", # X1 instead of X
    "SAROP31-OPPI151:MOTOR_Y1.RBV", # Y1 instead of X
    "SAROP31-OPPI151:TC1", # Pulse picker temperature
]


####################
## Horizontal offset mirror ODMV152

pvs_ODMV152 = [
    "SAROP31-ODMV152:W_X.RBV",
    "SAROP31-ODMV152:W_Y.RBV",
    "SAROP31-ODMV152:W_RX.RBV",
    "SAROP31-ODMV152:W_RZ.RBV",
    "SAROP31-ODMV152:BU.RBV",
    "SAROP31-ODMV152:BD.RBV",
    "SAROP31-ODMV152:VS1.RBV",
    "SAROP31-ODMV152:VS2.RBV",
    "SAROP31-ODMV152:VS3.RBV",
    "SAROP31-ODMV152:TX.RBV",
]


###########################
# Vertical KB mirror OKBV153

pvs_OKBV153 = [
    "SAROP31-OKBV153:W_X.RBV",
    "SAROP31-OKBV153:W_Y.RBV",
    "SAROP31-OKBV153:W_RX.RBV",
    "SAROP31-OKBV153:W_RY.RBV",
    "SAROP31-OKBV153:W_RZ.RBV",
    "SAROP31-OKBV153:BU.RBV",
    "SAROP31-OKBV153:BD.RBV",
    "SAROP31-OKBV153:TY1.RBV",
    "SAROP31-OKBV153:TY2.RBV",
    "SAROP31-OKBV153:TY3.RBV",
    "SAROP31-OKBV153:TX1.RBV",
    "SAROP31-OKBV153:TX2.RBV",
]


####################
# Screen between the KB's PSCD153

pvs_PSCD153 = [
    "SAROP31-PSCD153:MOTOR_PROBE.RBV"
]


###########################
# Horizontal KB mirror OKBH154

pvs_OKBH154 = [
    "SAROP31-OKBH154:W_X.RBV",
    "SAROP31-OKBH154:W_Y.RBV",
    "SAROP31-OKBH154:W_RX.RBV",
    "SAROP31-OKBH154:W_RY.RBV",
    "SAROP31-OKBH154:W_RZ.RBV",
    "SAROP31-OKBH154:BU.RBV",
    "SAROP31-OKBH154:BD.RBV",
    "SAROP31-OKBH154:TY1.RBV",
    "SAROP31-OKBH154:TY2.RBV",
    "SAROP31-OKBH154:TY3.RBV",
    "SAROP31-OKBH154:TX2.RBV",
]


###########################
# Izero-slit unit

pvs_i0_chamber = [
    "SARES30-MCS20610:MCS1.RBV",
    "SARES30-MCS20610:MCS2.RBV",
    "SARES30-MCS20610:MCS3.RBV",
    "SARES30-MCS20610:MCS4.RBV",
    "SARES30-MCS20610:MCS5.RBV"
]

pvs_i0_slits = [
    "SARES30-MCS20610-XSLIT:CALC_POS.RBV",
    "SARES30-MCS20610-XSLIT:CALC_WIDTH.RBV",
    "SARES30-MCS20610-YSLIT:CALC_POS.RBV",
    "SARES30-MCS20610-YSLIT:CALC_WIDTH.RBV",
]


###########################################################################
####    GENERAL PURPOSE EXPERIMENT


####################
# Standa motors (mainly used with the X-ray eye)

pvs_standa = [
    "SARES30-MOBI1:MOT_1.RBV",
    "SARES30-MOBI1:MOT_2.RBV",
    "SARES30-MOBI1:MOT_3.RBV",
]


####################
# Newport 300 mm stage

pvs_newport_300 = [
    "SARES30-MOBI1:MOT_5.RBV",
]


###############################
# Smaract stages mini XYZ from SwissMX

pvs_smaract_xyz = [
    "SARES30-MCS2750:MOT_1.RBV",
    "SARES30-MCS2750:MOT_1.VAL",
    "SARES30-MCS2750:MOT_2.RBV",
    "SARES30-MCS2750:MOT_2.VAL",
    "SARES30-MCS2750:MOT_3.RBV",
    "SARES30-MCS2750:MOT_3.VAL",
]


####################
# Attocube motors

pvs_attocube = [
    "SARES30-ATTOCUBE:A0-POS",
    "SARES30-ATTOCUBE:A1-POS",
]


###############################
# Smaract stages from Juraj

pvs_smaract_juraj = [
    "SARES30-XSMA156:X:MOTRBV",
    "SARES30-XSMA156:Y:MOTRBV",
    "SARES30-XSMA156:Z:MOTRBV",
    "SARES30-XSMA156:Ry:MOTRBV",
    "SARES30-XSMA156:Rx:MOTRBV",
    "SARES30-XSMA156:Rz:MOTRBV",
]


###############################
# General purpose JJ-slits

pvs_JJ_slits = [
    "SARES30-MOBI2:MOT_X.RBV",
    "SARES30-MOBI2:MOT_Y.RBV",
    "SARES30-MOBI2:MOT_W.RBV",
    "SARES30-MOBI2:MOT_H.RBV",
]




###########################################################################
####    CRISTALLINA-Q EXPERIMENT


###############################
# Diffractometer 1

ID_dm1 = "SARES31-GPS"
pvs_diffractometer_1 = [
    ID_dm1 + ":ROT2THETA-PosAct",
    ID_dm1 + ":ROTTHETA-PosAct",
    ID_dm1 + ":TRXBASE-PosAct",
    ID_dm1 + ":TRY-PosAct",
    ID_dm1 + ":TRX-PosAct",
    ID_dm1 + ":TRZ-PosAct",
    ID_dm1 + ":TD-PosAct",
    # ID_dm1 + ":m1s012-Drv01-TrqAct", # TRYBASE Mot 1 torque
    # ID_dm1 + ":m1s013-Drv01-TrqAct", # TRYBASE Mot 2 torque
    # ID_dm1 + ":m1s014-Drv01-TrqAct", # TRYBASE Mot 3 torque
    # ID_dm1 + ":m1s015-Drv01-TrqAct", # TRYBASE Mot 4 torque
    # ID_dm1 + ":m1s027-Drv01-TrqAct", # TD Mot torque
    # ID_dm1 + ":m1s011-Drv01-TrqAct", # TRXBASE Mot torque
    # ID_dm1 + ":m1s030-Drv01-TrqAct", # TRX Mot torque
    # ID_dm1 + ":m1s031-Drv01-TrqAct", # TRY Mot torque
    # ID_dm1 + ":m1s029-Drv01-TrqAct", # TRZ Mot torque
    # ID_dm1 + ":m1s010-Drv01-TrqAct", # ROT2THETA Mot torque
    # ID_dm1 + ":m1s028-Drv01-TrqAct", # ROTTHETA Mot torque
]


###############################
# Diffractometer 2

ID_dm2 = "SARES32-GPS"
pvs_diffractometer_2 = [
    ID_dm2 + ":ROTTHETA-PosAct",
    ID_dm2 + ":TRXBASE-PosAct",
    ID_dm2 + ":TRY-PosAct",
    ID_dm2 + ":TRX-PosAct",
    ID_dm2 + ":ROT2THETA-PosAct",
    ID_dm2 + ":TRZ-PosAct",
    ID_dm2 + ":TD-PosAct",
    ID_dm2 + ":ROTX-PosAct",
    ID_dm2 + ":ROTZ-PosAct",
    # ID_dm2 + ":m0s012-Drv01-TrqAct", # TRYBASE Mot 1 torque
    # ID_dm2 + ":m0s013-Drv01-TrqAct", # TRYBASE Mot 2 torque
    # ID_dm2 + ":m0s014-Drv01-TrqAct", # TRYBASE Mot 3 torque
    # ID_dm2 + ":m0s015-Drv01-TrqAct", # TRYBASE Mot 4 torque
    # ID_dm2 + ":m0s027-Drv01-TrqAct", # TD Mot torque
    # ID_dm2 + ":m0s011-Drv01-TrqAct", # TRXBASE Mot torque
    # ID_dm2 + ":m1s030-Drv01-TrqAct", # TRX Mot torque
    # ID_dm2 + ":m1s031-Drv01-TrqAct", # TRY Mot torque
    # ID_dm2 + ":m1s029-Drv01-TrqAct", # TRZ Mot torque    
    # ID_dm2 + ":m0s032-Drv01-TrqAct", # ROTX Mot torque
    # ID_dm2 + ":m0s033-Drv01-TrqAct", # ROTZ Mot torque
    # ID_dm2 + ":m0s010-Drv01-TrqAct", # ROT2THETA Mot torque
    # ID_dm2 + ":m0s028-Drv01-TrqAct", # ROTTHETA Mot torque
]

# Disabled as these are outdated.

ECMC_dm1 = "SARES31-CPCL-ECMC01"
ECMC_dm2 = "SARES32-CPLC-ECMC02"

pvs_diffractometer_extras = [
    ECMC_dm1 + ":m0s016-Enc01-PosAct", # TRYBASE Mot 1 motor encoder
    ECMC_dm1 + ":m0s017-Enc01-PosAct", # TRYBASE Mot 2 motor encoder
    ECMC_dm1 + ":m0s018-Enc01-PosAct", # TRYBASE Mot 3 motor encoder
    ECMC_dm1 + ":m0s019-Enc01-PosAct", # TRYBASE Mot 4 motor encoder
    ECMC_dm1 + ":m0s031-Enc01-PosAct", # TD Mot motor encoder
    ECMC_dm1 + ":m0s015-Enc01-PosAct", # TRXBASE Mot motor encoder
    ECMC_dm1 + ":m0s034-Enc01-PosAct", # TRX Mot motor encoder
    ECMC_dm1 + ":m0s014-Enc01-PosAct", # ROT2THETA Mot motor encoder
    ECMC_dm1 + ":m0s032-Enc01-PosAct", # ROTTHETA Mot motor encoder
# 	#### 
    ECMC_dm2 + ":m0s012-Enc01-PosAct", # TRYBASE Mot 1 motor encoder
    ECMC_dm2 + ":m0s013-Enc01-PosAct", # TRYBASE Mot 2 motor encoder
    ECMC_dm2 + ":m0s014-Enc01-PosAct", # TRYBASE Mot 3 motor encoder
    ECMC_dm2 + ":m0s015-Enc01-PosAct", # TRYBASE Mot 4 motor encoder
    ECMC_dm2 + ":m0s027-Enc01-PosAct", # TD Mot motor encoder
    ECMC_dm2 + ":m0s011-Enc01-PosAct", # TRXBASE Mot motor encoder
    ECMC_dm2 + ":m0s030-Enc01-PosAct", # TRX Mot motor encoder
    ECMC_dm2 + ":m0s032-Enc01-PosAct", # ROTX Mot motor encoder
    ECMC_dm2 + ":m0s033-Enc01-PosAct", # ROTZ Mot motor encoder
    ECMC_dm2 + ":m0s010-Enc01-PosAct", # ROT2THETA Mot motor encoder
    ECMC_dm2 + ":m0s028-Enc01-PosAct", # ROTTHETA Mot motor encoder

    ECMC_dm1 + ":m1s016-Drv01-TrqAct", # TRYBASE Mot 1 torque
    ECMC_dm1 + ":m1s017-Drv01-TrqAct", # TRYBASE Mot 2 torque
    ECMC_dm1 + ":m1s018-Drv01-TrqAct", # TRYBASE Mot 3 torque
    ECMC_dm1 + ":m1s019-Drv01-TrqAct", # TRYBASE Mot 4 torque
    ECMC_dm1 + ":m1s031-Drv01-TrqAct", # TD Mot torque
    ECMC_dm1 + ":m1s015-Drv01-TrqAct", # TRXBASE Mot torque
    
    ECMC_dm1 + ":m1s034-Drv01-TrqAct", # TRX Mot torque
    ECMC_dm1 + ":m1s035-Drv01-TrqAct", # TRY Mot torque
    ECMC_dm1 + ":m1s033-Drv01-TrqAct", # TRZ Mot torque

    ECMC_dm1 + ":m1s014-Drv01-TrqAct", # ROT2THETA Mot torque
    ECMC_dm1 + ":m1s032-Drv01-TrqAct", # ROTTHETA Mot torque
]

###############################
# DilSc

# LakeShore
ID_DilSc_LakeShore = "SARES31-DIL-LS1"
pvs_DilSc_Lakeshore = [
    ID_DilSc_LakeShore + ":A_KELVIN",
    ID_DilSc_LakeShore + ":7_KELVIN",
    ID_DilSc_LakeShore + ":8_KELVIN",

    ID_DilSc_LakeShore + ":A_RES",
    ID_DilSc_LakeShore + ":7_RES",
    ID_DilSc_LakeShore + ":8_RES",

    ID_DilSc_LakeShore + ":1_RES",
    ID_DilSc_LakeShore + ":2_RES",
    ID_DilSc_LakeShore + ":3_RES",

    ID_DilSc_LakeShore + ":A_EX_STRING.SVAL",
    ID_DilSc_LakeShore + ":7_EX_STRING.SVAL",
    ID_DilSc_LakeShore + ":8_EX_STRING.SVAL",

    ID_DilSc_LakeShore + ":1_EX_STRING.SVAL",
    ID_DilSc_LakeShore + ":2_EX_STRING.SVAL",
    ID_DilSc_LakeShore + ":3_EX_STRING.SVAL",

    ID_DilSc_LakeShore + ":H0_SETP_GET",
    ID_DilSc_LakeShore + ":H0_PWR_GET",
]

# Magnet Mercury iPS
ID_DilSc_MagnetPSU  = "SARES31-MAG-IPS1"

pvs_DilSc_MagnetPSU = []
for axis in ['X','Y','Z']:
    ID_with_axis = f'{ID_DilSc_MagnetPSU}'+'-'+f'{axis}'
    pvs_DilSc_MagnetPSU.append( ID_with_axis + ':SIG_FLD' )
    pvs_DilSc_MagnetPSU.append( ID_with_axis + ':SIG_FSET' )
    pvs_DilSc_MagnetPSU.append( ID_with_axis + ':SIG_RFST' )
    pvs_DilSc_MagnetPSU.append( ID_with_axis + ':ACTN' )

###############################
# PuMa Aerotech motor controller

ID_PuMa_Aerotech = "SARES30-PUMA"
pvs_PuMa_Aerotech = [
    ID_PuMa_Aerotech + "-SX:MOT.RBV",
    ID_PuMa_Aerotech + "-SY:MOT.RBV",
    ID_PuMa_Aerotech + "-SZ:MOT.RBV",
    ID_PuMa_Aerotech + "-SR:MOT.RBV",

    ID_PuMa_Aerotech + "-MX:MOT.RBV",
    ID_PuMa_Aerotech + "-MY:MOT.RBV",
    ID_PuMa_Aerotech + "-MZ:MOT.RBV",
    ID_PuMa_Aerotech + "-MR:MOT.RBV",
]


###############################
# Huber vertical stage

pvs_huber_z= [
    "SARES30-MOBI2:MOT_Z.RBV",
]




###########################################################################
####    CRISTALLINA-MX EXPERIMENT


###############################
# Fast XY-stage

pvs_swissmx = [
    "SAR-EXPMX:MOT_FX.RBV",
    "SAR-EXPMX:MOT_FY.RBV",
]






###########################################################################
####    CHANNEL GROUPS

###############################
# All channels (slic updates the list based on these)

pv_channels = (
    pvs_machine
    # + pvs_RF
    + pvs_undulator
    + pvs_OAPU044
    + pvs_gas_monitor
    + pvs_PBPS053
    + pvs_OATT053
    + pvs_PPRM053
    # + pvs_PDIM053
    + pvs_PSSS059
    # + pvs_PPRM064
    # + pvs_OOMH064
    # + pvs_PPRM066
    + pvs_OOMH067
    + pvs_PSCR068
    + pvs_OOMH084
    + pvs_PPRM085
    + pvs_OAPU107
    + pvs_ODCC110
    + pvs_PSCR110
    + pvs_PBPS113
    + pvs_PDIM113
    + pvs_PPRM113
    + pvs_OLAS147
    + pvs_OAPU149
    + pvs_PBPS149
    + pvs_PPRM150
    + pvs_OATA150
    + pvs_OPPI151
    + pvs_ODMV152
    + pvs_OKBV153
    + pvs_PSCD153
    + pvs_OKBH154
    + pvs_i0_chamber
    + pvs_i0_slits
    + pvs_standa
    # + pvs_newport_300
    # + pvs_smaract_xyz
    + pvs_diffractometer_1
    # + pvs_diffractometer_2
    # these do not work properly at the moment:
    # + pvs_diffractometer_extras
    + pvs_DilSc_Lakeshore
    + pvs_DilSc_MagnetPSU
    # + pvs_PuMa_Aerotech
    + pvs_huber_z
    + pvs_JJ_slits
    # + pvs_attocube
    # + pvs_smaract_juraj
    # + pvs_photon_energy_bernina
    # + pvs_OAPU092_bernina
    # + pvs_OOMV092_bernina
    # + pvs_PPRM094_bernina
    # + pvs_OOMV096_bernina
    # + pvs_PSCR097_bernina
    # + pvs_ODCM098_bernina
    # + pvs_OAPU102_bernina
    # + pvs_PSRD103_bernina
    # + pvs_PBPS113_bernina
    # + pvs_OPPI113_bernina
    # + pvs_PPRM113_bernina
)

pv_channels_cristallina_beamline = (
    pvs_machine
    # + pvs_RF
    + pvs_undulator
    + pvs_OAPU044
    + pvs_gas_monitor
    + pvs_PBPS053
    + pvs_OATT053
    + pvs_PPRM053
    # + pvs_PDIM053
    + pvs_PSSS059
    # + pvs_PPRM064
    # + pvs_OOMH064
    # + pvs_PPRM066
    + pvs_OOMH067
    + pvs_PSCR068
    + pvs_OOMH084
    + pvs_PPRM085
    + pvs_OAPU107
    + pvs_ODCC110
    + pvs_PSCR110
    + pvs_PBPS113
    + pvs_PDIM113
    + pvs_PPRM113
    + pvs_OLAS147
    + pvs_OAPU149
    + pvs_PBPS149
    + pvs_PPRM150
    + pvs_OATA150
    + pvs_OPPI151
    + pvs_ODMV152
    + pvs_OKBV153
    + pvs_PSCD153
    + pvs_OKBH154
    + pvs_i0_chamber
    + pvs_i0_slits
)

pv_channels_bernina_DCM = (
    pvs_machine
    # + pvs_RF
    + pvs_undulator
    + pvs_OAPU044
    + pvs_gas_monitor
    + pvs_PBPS053
    + pvs_OATT053
    + pvs_PPRM053
    # + pvs_PDIM053
    + pvs_PSSS059
    # + pvs_PPRM064
    # + pvs_OOMH064
    # + pvs_PPRM066
    + pvs_OOMH067
    + pvs_PSCR068
    + pvs_photon_energy_bernina
    + pvs_OAPU092_bernina
    + pvs_OOMV092_bernina
    + pvs_PPRM094_bernina
    + pvs_OOMV096_bernina
    + pvs_PSCR097_bernina
    + pvs_ODCM098_bernina
    + pvs_OAPU102_bernina
    + pvs_PSRD103_bernina
    + pvs_PBPS113_bernina
    + pvs_OPPI113_bernina
    + pvs_PPRM113_bernina
)
