#!/bin/bash
#

##
# Show the menu items
#
menu() {
    echo "";
    echo "(1) Start Prosilica Drivers";
    echo "(2) Stop  Prosilica Drivers";
    echo "(3) Start Image Acquisition";
    echo "(4) Stop  Image Acquisition";
    echo "(5) Start LCM Spy program";
    echo "(6) Check number of images files";
    echo "(7) Exit";
    echo     "> Enter a command number 1 to 6"
    echo -ne "> ";
}

##
# Main loop
#
# Show the menu, read the requested command, execute the command.
#
echo "";
echo "******************************************"
echo "*        Image Acquisition Helper        *"
echo "******************************************"
while :
do
  menu
  read CMD
  case $CMD in
      1) ./run-stereo-driver;;
      2) ./kill-cameras;;
      3) ./cam-attributes -s -m -O;./cam-attributes -s -c -O;;
      4) ./cam-attributes -s -m -X;./cam-attributes -s -c -X;;
      5) ./perls-spy &;;
      6) echo "";echo "# image files: `ls -ltr ./latest/images/bw/IMG* | wc -l`";;
      [7qQ]) echo "Exiting..."; break;;
      *) echo "Invalid command, try again...";;
  esac
  sleep 0.5
  echo "";
  echo "******************************************"
done

#
