diff --git a/scripts/camViewer b/scripts/camViewer index 8f5c0e43..70e8ecf6 100755 --- a/scripts/camViewer +++ b/scripts/camViewer @@ -285,7 +285,7 @@ fi -if [ $CAMNUM -eq 0 ]; then +if [ "$CAMNUM" -eq 0 ]; then if [ "$hutch" = "tmo" ]; then CAMNAME=IM2K0 elif [ "$hutch" = "rix" ]; then @@ -302,17 +302,15 @@ if [ $CAMNUM -eq 0 ]; then CAMNAME=xcs_yag2 fi - fi - export EPICS_CA_MAX_ARRAY_BYTES=24000000 -echo working with camera of name: $CAMNAME +echo working with camera of name: "$CAMNAME" name_to_pv "$CAMNAME" "$hutch" if [ $MAINSCREEN -gt 0 ]; then tmp=/tmp/cv.$$ - list_cams $hutch >$tmp + list_cams "$hutch" >$tmp c=$(wc <$tmp | grep "$CAMNAME" $tmp | awk '{print $1}') if [ "$c" == '' ]; then echo "Camera name not found in hutch. To see which cameras you can access from your current machine use the '-l/--list' option." @@ -324,17 +322,16 @@ if [ $MAINSCREEN -gt 0 ]; then rm -f $tmp fi - echo 'try to get the main screen for: ' $CAMNAME + echo 'try to get the main screen for: ' "$CAMNAME" echo 'start the main screen for camera base PV: ' "$CAMPVFULL" cmdName=$(caget -St "$CAMPVFULL":LAUNCH_EDM) echo calling edm main screen from: "$cmdName" $cmdName exit - fi if [ $REBOOT -gt 0 ]; then - echo 'reboot IOC for camera: ' $CAMNAME + echo 'reboot IOC for camera: ' "$CAMNAME" edmcmdName=$(caget -St "$CAMPVFULL":LAUNCH_EDM) IOCPV=$(grep 'export IOC_PV' "$edmcmdName" | awk '{print $2 "\n" }' | sed s/IOC_PV=/''/g) echo 'restart IOC last started on: ' "$(caget -t "$IOCPV":STARTTOD)" @@ -342,48 +339,44 @@ if [ $REBOOT -gt 0 ]; then exit fi -if [ $ENABLE -gt 0 ]; then +if [ $ENABLE -gt 0 ]; then echo "Enabling ${CAMNAME}" iocinfo - imgr "$ioc" --hutch "$iochutch" --enable + imgr "$ioc" --hutch "$iochutch" --enable exit fi if [ $DISABLE -gt 0 ]; then echo "Disabling ${CAMNAME}" iocinfo - imgr "$ioc" --hutch "$iochutch" --disable + imgr "$ioc" --hutch "$iochutch" --disable exit fi if [ $ACQUIRE -gt 0 ]; then - #hutch_check echo "Starting acquisition for ${CAMNAME}" caput -n "$CAMPVFULL":Acquire 1 exit fi if [ $STOP -gt 0 ]; then - #hutch_check - echo "Stopping acquisition for ${CAMNAME}" + echo "Stopping acquisition for ${CAMNAME}" caput -n "$CAMPVFULL":Acquire 0 exit fi if [ $NUDGE -gt 0 ]; then - #hutch_check echo "Stopping and starting acquisition for ${CAMNAME}" caput -n "$CAMPVFULL":Acquire 0 sleep 2 caput -n "$CAMPVFULL":Acquire 1 exit fi - IS_ACQUIRING=$(caget -t -n "$CAMPVFULL":Acquire_RBV) if isNum "$IS_ACQUIRING"; then if [ "$IS_ACQUIRING" -eq 0 ]; then - echo 'start acquiring for camera ' $CAMNAME + echo 'start acquiring for camera ' "$CAMNAME" caput -n "$CAMPVFULL":Acquire 1 fi else