-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Description
Expected Behavior
The checks in our scripts should be meaningful and correct to give us proper feedback
Current Behavior
There's a place in camViewer where we check if the camera name exists in a hutch via counting and then compare the count to the camera name, which is incorrect. If the line is changed to store the camera name instead of the count we still have some issues because the following checks are a bit wonky.
This gives a confusing printout but doesn't break the script because regardless of the result of the check we proceed anyway.
engineering_tools/scripts/camViewer
Lines 321 to 333 in 953c167
| tmp=/tmp/cv.$$ | |
| 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." | |
| sleep 3 | |
| elif [ "$c" == "$CAMNAME" ] && [ "$hutch" != "$(get_info --gethutch)" ] ; then | |
| echo "To use camera controls, you must be on the same hutch machine as your camera." | |
| echo "Opening read-only main screen..." | |
| sleep 3 | |
| rm -f $tmp | |
| fi |
Possible Solution
Revise as appropriate
Context
Originally posted by @ZLLentz in #204 (comment)
Metadata
Metadata
Assignees
Labels
No labels