Skip to content
Snippets Groups Projects
Commit 0f96c5cd authored by Gabriel Fedel's avatar Gabriel Fedel :speech_balloon:
Browse files

Makes the sp calib be re-enable after the where the closed loop is changed

[ICSHWI-5826]
parent f288c112
No related branches found
No related tags found
1 merge request!34Big chunk of updates
......@@ -22,6 +22,9 @@ short mon_cav_raw;
short mon_kly_egu;
short mon_kly_raw;
short calib_en;
short prev_en;
//copy records
assign cp_cav_egu "{P}{R}#CpWavSPEGUCav.PROC";
assign cp_cav_raw "{P}{R}#CpWavSPRawCav.PROC";
......@@ -38,6 +41,8 @@ assign mon_kly_raw "{P}{R}#WavSPRawKlyChg";
assign cavity to "{P}{R}CloseLoopCav";
assign calib_en to "{P}{R}RFCtrlSP-CalEn";
monitor cavity;
monitor mon_cav_egu;
......@@ -56,18 +61,24 @@ ss spcalibsel_ {
state wait_change {
when (cavity != last_cavity) {
} state reload_calib
} state save_en
when (cavity == TRUE && (mon_cav_egu == 1 || mon_cav_raw == 1)){
} state reload_calib
} state save_en
when (cavity == FALSE && (mon_kly_egu == 1 || mon_kly_raw == 1)){
} state reload_calib
} state save_en
}
// save calibration enable before update the tables
state save_en {
when(){
pvGet(calib_en);
prev_en = calib_en;
} state reload_calib
}
state reload_calib {
when (cavity == TRUE){
cp_cav_egu = 1;
......@@ -78,7 +89,7 @@ ss spcalibsel_ {
pvPut(mon_cav_egu);
mon_cav_raw = 0;
pvPut(mon_cav_raw);
}state init_state
}state re_enable
when (cavity == FALSE){
cp_cav_egu = 1;
......@@ -90,6 +101,16 @@ ss spcalibsel_ {
pvPut(mon_kly_egu);
mon_kly_raw = 0;
pvPut(mon_kly_raw);
}state re_enable
}
//if calib was enabled, re-enable it
state re_enable{
when(delay (0.1) && prev_en == 1) {
calib_en = 1;
pvPut(calib_en);
}state init_state
when(delay (0.1) && prev_en == 0){
}state init_state
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment