Skip to content
Snippets Groups Projects
Commit 420b2fa8 authored by Lorenzo Pivetta's avatar Lorenzo Pivetta
Browse files

First import

parent efb1bfda
Branches master
No related tags found
No related merge requests found
#
# Description: Acquired $devccd background
# Author: Giulio Gaio
# Date: 2020/03/02
#
step1;((read($devccd/State) == ALARM) || (read($devccd/State) == ON)) ? goto(2) : goto(-1);Checking $devccd state;Error checking $devccd state;-1
step2;read($devccd/BackgroundSubtraction) == 0 ? (write($devccd/BackgroundSubtraction) = 1) && goto(3) : goto(3);Enabling $devccd bakcground subtraction;Error enabling $devccd bakcground subtraction;-1
step3;command($devccd/AcquireBackground) && (write(this/OldCameraCounter) = read($devccd/CameraCounter)) && goto(4);Acquiring $devccd backgorund;Error acquiring $devccd background;-1
step4;sleep($sleep_monitor) && (read(this/OldCameraCounter) == read($devccd/CameraCounter)) ? goto(4) : goto(5);Checking $devccd counter;Error checking $devccd counter;10000
#
attr;OldCameraCounter;long;0
#
# Wildcards
# $devcam=lhl/diagnostics/ccd_lhl.02
# $sleep_monitor=0.1
#
# Description: Set iufel screen $devfilter filter
# Author: Giulio Gaio
# Date:2020/03/02
#
#
step1;(write(this/Counter) = 0) && read($devfilter/State) != $steady_state ? goto(-1) : goto(2);Reading $devfilter initial state;Error reading $devfilter initial state;-1
step2;command($devfilter/GotoReference) && goto(3);Setting $devfilter reference;Error setting $devfilter reference;-1
step3;sleep($sleep_monitor) && (read($devfilter/State) == $moving_state) ? goto(3) : goto(4);Checking $devfilter moving state;Error checking $devfilter moving state;20000
step4;read($devfilter/State) != $steady_state ? goto(-1) : goto(5);Reading $devfilter initial state;Error reading $devfilter initial state;-1
step5;read(this/Counter) == read(this/FilterNum) ? goto(10) : goto(6);Checking $devfilter final position;Checking $devfilter final position;-1
step6;command($devfilter/NextFilter) && goto(7);Setting $devfilter next filter;Error setting $devfilter next filter;-1
step7;sleep($sleep_monitor) && (read($devfilter/State) == $moving_state) ? goto(7) : goto(8);Checking $devfilter moving state;Error checking $devfilter moving state;80000
step8;read($devfilter/State) != $steady_state ? goto(-1) : goto(9);Reading $devfilter initial state;Error reading $devfilter initial state;-1
step9;(write(this/Counter) = (read(this/Counter)+1)) && goto(5);Incrementing $devfilter counter;Error incrementing $devfilter counter;-1
#
# R/W dynamic attributes
attr;FilterNum;long;0
attr;Counter;long;0
#
# Wildcards
# $devfilter=fel02/diagnostics/mscr_rots_fel02.03
# $sleep_monitor=1
#
# Description: Switch camera $devcam OFF
# Author: Giulio Gaio
# Date:17/01/2020
#
step1;(write(this/StartState) = read($devcam/State)) && goto(2);Reading $devcam initial state;Error reading $devcam initial state;-1
step2;((read(this/StartState) == ON) || (read(this/StartState) == ALARM)) ? goto(3) : goto(6);Check $devcam initial state;Error checking $devcam initial state;-1
step3;command($devcam/Stop) && goto(4);Turn $devcam OFF;Error turning $devcam OFF;-1
step4;sleep($sleep_monitor) && ((read($devcam/State) != OFF) && (read($devcam/State) != FAULT)) ? goto(4) : goto(5);Waiting $devcam going OFF;Error waiting $devcam going OFF;30000
step5;read($devcam/State) != OFF ? goto(-1) : goto(6);Checking final state;Error checking final state;-1
#
# R/W dynamic attributes
attr;StartState;long;0
#
# Wildcards
# $devcam=lhl/diagnostics/ccd_lhl.02
# $sleep_monitor=0.1
#
# Description: Switch camera $devcam ON
# Author: Giulio Gaio
# Date:17/01/2020
#
#
step1;(write(this/StartState) = read($devcam/State)) && goto(2);Reading $devcam initial state;Error reading $devcam initial state;-1
step2;((read(this/StartState) == ON) || (read(this/StartState) == ALARM)) ? goto(6) : goto(3);Check $devcam initial state;Error checking $devcam initial state;-1
step3;(command($devcam/Start) = 0) && goto(4);Turn $devcam ON;Error turning $decam ON;-1
step4;sleep($sleep_monitor) && ((read($devcam/State) != ON) && (read($devcam/State) != ALARM)) ? goto(5) : goto(6);Waiting $devcam ON state;Error waiting $devcam ON state;40000
step5;(read($devcam/State) == FAULT) ? goto(-1) : goto(4);Checking $devcam FAULT state;Error checking $devcam FAULT state;-1
step6;((read(this/HwRoi) == 0) && (read($devcam/HwRoi) == 1)) ? (write($devcam/HwRoi) = 0) && goto(4) : goto(7);Disabling $devcam HwRoi;Error disabling $devcam HwRoi;-1
step7;(read(this/FullSwRoi) == 1) ? (write(this/Width) = read($devcam/Width)) && (write(this/Height) = read($devcam/Height)) && goto(8) : goto(9);Reading $devcam width/height;Error reading width/height;-1
step8;(write($devcam/RoiParam[0]) = 1) && (write($devcam/RoiParam[1]) = 1) && (write($devcam/RoiParam[2]) = (read(this/Width)-1)) && (write($devcam/RoiParam[3]) = (read(this/Height)-1)) && goto(9);Setting $devcam ROI;Error setting $devcam ROI;-1
#
# R/W dynamic attributes
attr;StartState;long;0
attr;HwRoi;bool;0
attr;FullSwRoi;bool;1
attr;Width;long;0
attr;Height;long;0
#
# Wildcards
# $devcam=lhl/diagnostics/ccd_lhl.02
# $sleep_monitor=0.1
#
# Description: Switch camera $devcam ON or reset it
# Author: Giulio Gaio
# Date:17/01/2020
#
#
step1;(write(this/StartState) = read($devcam/State)) && goto(2);Reading $devcam initial state;Error reading $devcam initial state;-1
step2;sleep(0.2) && read($devcam/State) == MOVING ? goto(2) : goto(3);Waiting $devcam connecting;Error waiting $devcam connecting;50000
step3;((read(this/StartState) == ON) || (read(this/StartState) == ALARM)) ? goto(7) : goto(4);Check $devcam initial state;Error checking $devcam initial state;-1
step4;((read($devcam/State) == OFF) || (read($devcam/State) == FAULT)) ? command($devcam/Stop) && sleep(1) && (command($devcam/Start) = 0) && goto(5) : goto(5);Turn $devcam ON;Error turning $decam ON;-1
step5;sleep($sleep_monitor) && ((read($devcam/State) != ON) && (read($devcam/State) != ALARM)) ? goto(6) : goto(7);Waiting $devcam ON state;Error waiting $devcam ON state;50000;tangoerror=goto(5)
step6;sleep($sleep_monitor) && (read($devcam/State) == FAULT) ? command($devcam/Stop) && $cmd_reset : goto(5);Checking $devcam FAULT state;Error checking $devcam FAULT state;50000;tangoerror=goto(6)
step7;((read(this/HwRoi) == 0) && (read($devcam/HwRoi) == 1)) ? (write($devcam/HwRoi) = 0) && goto(5) : goto(8);Disabling $devcam HwRoi;Error disabling $devcam HwRoi;-1
step8;(read(this/FullSwRoi) == 1) ? (write(this/Width) = read($devcam/Width)) && (write(this/Height) = read($devcam/Height)) && goto(9) : goto(10);Reading $devcam width/height;Error reading width/height;-1
step9;(write($devcam/RoiParam[0]) = 1) && (write($devcam/RoiParam[1]) = 1) && (write($devcam/RoiParam[2]) = (read(this/Width)-1)) && (write($devcam/RoiParam[3]) = (read(this/Height)-1)) && goto(10);Setting $devcam ROI;Error setting $devcam ROI;-1
#
# R/W dynamic attributes
attr;StartState;long;0
attr;HwRoi;bool;0
attr;FullSwRoi;bool;1
attr;Width;long;0
attr;Height;long;0
#
# Wildcards
# $devcam=lhl/diagnostics/ccd_lhl.02
# $sleep_monitor=0.1
# $cmd_reset=goto(-1)
# $cmd_reset=command(tls/diagnostics/mscr_tls.01/ResetCamera) && sleep(10) && command($devcam/Off) && goto(1)
#
# Description: Optimize $device gain/exposure
# Author: Giulio Gaio
# Date: 2020/03/02
#
step1;sleep($sleep_start) && (read($device/State) == ALARM) ? (write($device/ProcessMode) = 0) && (write($device/AutoFeedbackGain) = 1) && (write($device/AutoFeedbackTargetThres) = 0) && (write($device/AutoFeedbackDeadBand) = 5) && goto(2) : goto(21);Checking $device ALARM state;Error checking $device ALARM state;-1
step2;(write($device/GainAutoEnable) = 0) && (write($device/ExposureAutoEnable) = 0) && goto(3);Disabling $device auto tune feedbacks;Error disabling autotune feedbacks;-1
step3;(write($device/Gain) = (read($device/GainAutoMin))) && (write($device/Exposure) = (read($device/ExposureAutoMin))) && sleep($sleep_monitor) && (read($device/MaxVal) == 255) ? goto(20) : (write($device/Gain) = (read($device/GainAutoMax))) && (write($device/Exposure) = (read($device/ExposureAutoMax))) && goto(4);Setting $device minimum settings;Error setting $device minimum settings;-1
#
step4;command($seqexposure/Start) && goto(5);Start $seqexposure sequence;Error starting $seqexposure sequence;-1
step5;sleep($sleep_monitor) && (read($seqexposure/State) == RUNNING) ? goto(5) : goto(6);Waiting $seqexposure RUNNING state;Error waiting $seqexposure RUNNING state;-1
step6;read($seqexposure/State) == OFF ? (write($device/ExposureAutoEnable) = 1) && goto(7) : goto(-1);Checking $seqexposure OFF state;Error checking $seqexposure OFF state;-1
#
step7;sleep($sleep_monitor) && (abs(read($device/AutoTargetValue) - read($device/MaxVal)) > read($device/AutoFeedbackDeadBand)) ? goto(8) : goto(9);Checking $device MaxVal;Error checking MaxVal;60000;timeouterror=goto(9)
step8;((read($device/Exposure) <= read($device/ExposureAutoMin)) || (read($device/Exposure) >= read($device/ExposureAutoMax))) ? goto(9) : goto(7);Checking $device exposure upper limit;Error checking $device exposure upper limit;-1
#
step9;(write($device/ExposureAutoEnable) = 0) && (read($device/State) == ALARM) ? goto(10) : goto(15);Checking $device ALARM state;Error checking $device ALARM state;-1
#
step10;command($seqgain/Stop) && goto(11);Start $seqgain sequence;Error starting $seqgain sequence;-1;tangoerror=goto(12)
step11;sleep($sleep_monitor) && (read($seqgain/State) == RUNNING) ? goto(11) : goto(12);Waiting $seqgain RUNNING state;Error waiting $seqgain RUNNING state;-1
step12;read($seqgain/State) == OFF ? (write($device/GainAutoEnable) = 1) && goto(13) : goto(-1);Checking $seqexposure OFF state;Error checking $seqexposure OFF state;-1
#
step13;sleep($sleep_monitor) && (abs(read($device/AutoTargetValue) - read($device/MaxVal)) > read($device/AutoFeedbackDeadBand)) ? goto(14) : goto(15);Checking $device MaxVal;Error checking MaxVal;60000;timeouterror=goto(15)
step14;((read($device/Gain) <= read($device/GainAutoMin)) || (read($device/Gain) >= read($device/GainAutoMax))) ? goto(15) : goto(13);Checking $device gain upper limit;Error checking $device gain upper limit;-1
#
step15;(write($device/GainAutoEnable) = 0) && command($seqend/Stop) && goto(16);Start $seqend sequence;Error starting $seqend sequence;-1;tangoerror=goto(20)
step16;sleep($sleep_monitor) && (read($seqend/State) == RUNNING) ? goto(16) : goto(17);Waiting $seqend RUNNING state;Error waiting $seqend RUNNING state;-1
step17;read($seqend/State) == OFF ? goto(18) : goto(-1);Checking $seqexposure OFF state;Error checking $seqexposure OFF state;-1
#
step18;(abs(read($device/AutoTargetValue) - read($device/MaxVal)) > (read($device/AutoFeedbackDeadBand)*4)) ? goto(19) : goto(20);Checking $device MaxVal;Error checking MaxVal;-1
step19;(((read($device/Exposure) >= read($device/ExposureAutoMax)) || (read($device/Exposure) <= read($device/ExposureAutoMin))) && ((read($device/Gain) >= read($device/GainAutoMax)) || (read($device/Gain) <= read($device/GainAutoMin)))) ? goto(20) : goto(4);Checking tuning limits;Error checking tuning limits;-1
step20;(write($device/AutoFeedbackGain) = 0.3) && (write($device/AutoFeedbackTargetThres) = 5) && sleep(3) && (write($device/Exposure) = (read($device/Exposure) * read(this/ExposureScaling))) && goto(21);Restore values;Error restoring default values;-1
#
attr;ExposureScaling;double;1.3
#
#
# $device=
# $seqexposure=
# $seqgain=
# $seqend=
# $sleep_start=3
# $sleep_monitor=0.3
#
# Description: Set reference on camera $devcam
# Author: Giulio Gaio
# Date:2020/03/17
#
#
step1;sleep($sleep_monitor) && (read($devcam/State) == ON) ? goto(2) : goto(1);Check $devcam ON state;Error checking $devcam ON state;20000
step2;command($devcam/SetReference) && goto(3);Setting $devcam reference;Error setting $devcam reference;-1
#
# Wildcards
# $devcam=lhl/diagnostics/ccd_lhl.02
# $sleep_monitor=0.1
\ No newline at end of file
#
# Description: Wait $devccd new image
# Author: Giulio Gaio
# Date: 2020/03/02
#
step1;((read($devccd/State) == ALARM) || (read($devccd/State) == ON)) ? goto(2) : goto(-1);Checking $devccd state;Error checking $devccd state;-1
step2;(write(this/OldCameraCounter) = read($devccd/CameraCounter)) && goto(3);Acquiring $devccd camera counter;Error acquiring $devccd camera counter;-1
step3;sleep($sleep_monitor) && (read(this/OldCameraCounter) == read($devccd/CameraCounter)) ? goto(3) : (write(this/OldCameraCounter) = read($devccd/CameraCounter)) && goto(4);Checking $devccd counter;Error checking $devccd counter;10000
step4;sleep($sleep_monitor) && (read(this/OldCameraCounter) == read($devccd/CameraCounter)) ? goto(4) : goto(5);Checking $devccd counter;Error checking $devccd counter;10000
#
attr;OldCameraCounter;long;0
#
# Wildcards
# $devcam=lhl/diagnostics/ccd_lhl.02
# $sleep_monitor=0.1
#
# Description: Save $devccd$/$attr_image$ reference image
# Author: Giulio Gaio
# Date: 2021/10/22
#
step1;exec(/runtime/bin/save-image-cli $devself_seq$ $devccd$ $attr_image$) == 0 ? goto(3) : goto(-1);Running /runtime/bin/save-image-cli;Error running /runtime/bin/save-image-cli;-1
attr;Revert;bool;0
attr;Image1;long[1500,1500]
attr;Image2;long[1500,1500]
attr;Epoch1;long64;0
attr;Epoch2;long64;0
attr;Date1;string;0
attr;Date2;string;0
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment