Skip to content

Commit

Permalink
Style and format fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
spenc333 committed May 10, 2023
1 parent 40fa5f6 commit 90b9f61
Showing 1 changed file with 10 additions and 17 deletions.
27 changes: 10 additions & 17 deletions scripts/camViewer
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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."
Expand All @@ -324,66 +322,61 @@ 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)"
caput "$IOCPV":SYSRESET 1
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
Expand Down

0 comments on commit 90b9f61

Please sign in to comment.