autotrigger.sh 880 B

123456789101112131415161718192021222324252627282930313233
  1. #! /bin/bash
  2. #Example options:
  3. # ./autotrigger.sh --threads 4 - use multiple threads for preprocessing
  4. # ./autotrigger.sh --data raw --format raw - test raw_data_callback functionality
  5. # PCILIB_DEBUG_MISSING_EVENTS=1 IPECAMERA_DEBUG_HARDWARE=1 ./autotrigger.sh - debug missing frames
  6. function pci {
  7. APP_PATH=`dirname $0`/..
  8. if [ -d $APP_PATH/../pcitool ]; then
  9. PCILIB_BINARY="$APP_PATH/../pcitool/pcitool/pci"
  10. PCILIB_PATH="$APP_PATH/../pcitool/pcilib"
  11. else
  12. PCILIB_BINARY=`which pci`
  13. PCILIB_PATH=""
  14. fi
  15. LD_LIBRARY_PATH="$PCILIB_PATH" PCILIB_PLUGIN_DIR="$APP_PATH" $PCILIB_BINARY $*
  16. }
  17. echo "Starting the grabber"
  18. pci -g -o /dev/null --run-time 10002000000 --verbose 10 $@ &
  19. pid=$!
  20. trap "{ kill -s INT $!; }" SIGINT
  21. sleep 0.1
  22. pci -w 9040 80004a01
  23. sleep 10000
  24. pci -w 9040 80000201
  25. echo "Waiting grabber to finish"
  26. wait $pid