#!/bin/sh # # Review past data with browse # # xterm options # -e run the following program in the window # -T use following string as window title # -n use following string as icon title # -j use jump scrolling # -sb display scroll bar # -ut don't write a record in log file /etc/utmp # -geometry 80x24+0+0 NAME=`basename $0` FILE="" DISP=Safari Tcl=0 FDISP=firefox2 Firefox=0 REFRESH=8 Verbose="" Add() { if [ ! -r $1 ] then echo "Cannot read $1" exit 4 fi FILE="$FILE $1" } Display() { fire=`which $FDISP` saf=`which $DISP` case $fire in /usr*) Fire=$fire ;; *) Fire=0 esac case $saf in /usr*) Saf=$saf ;; *) Saf=0 esac } Help() { echo "Usage: $NAME [-h] [-n #] [-v] [-F] [-T] filename [file2 ...]" echo " where -h yields this message" echo " where -n # sets the sample size for statistics" echo " where -u causes rtlm to report time in UTC" echo " where -v causes the BROWSE program to be verbose" echo " where -F causes the Firefox browser to be used" echo " and -T forces Tcl display of data" echo "" echo "The default display uses the Safari browser" exit 1 } if [ "$NAME" = "CNoise" ] then xterm -T Statistics -j -sb -ut -geometry 40x8+20+50 -e CStatistics & elif [ "$NAME" = "CLog" ] then xterm -T "Telemetry Archive" -j -sb -ut -geometry 40x4+20+250 -e CArchive & elif [ "$NAME" = "CReview" ] then ######## Check arguments for readable files if [ "$#" = "0" ] then Help fi while [ "$1" != "" ] do case $1 in # ITOS sends us *.hk, *.sci, *.meta -F*) Firefox=1 ;; -T*) Tcl=1 ;; -h*) Help ;; -n*) shift if [ "$1" = "" ] then Help else StatFlag="-n $1" fi ;; -u*) UTC="-u" ;; -v*) Verbose="-v" ;; *\.hk) Add $1 ;; *\.sci) Add $1 ;; *\.bin) Add $1 ;; *) ;; esac shift done if [ "$FILE" = "" ] then echo "Can only process *.bin, *.hk, and *.sci files" exit 4 fi ######## Only one pdist per machine tmp=`ps x | fgrep pdist | wc -l` if [ "$tmp" -gt "1" ] # We don't want to start browse running then # if someone else is using this machine echo pdist already running on this machine with tmp = $tmp exit 2 else xterm -T "CRaTER pdist" -j -sb -ut -geometry 60x4+150-100 -e pdist -v & ######## Start file browser sleep 2 xterm -T "CRaTER browse" -j -sb -ut -geometry 80x10+150-100 -e browse $Verbose $FILE & fi ######## Start statistics window sleep 2 xterm -T Statistics -j -sb -ut -geometry 40x8+20+50 -e CStatistics -L $StatFlag & ######## Display as appropriate Display if [ \( $Fire != 0 -o $Saf != 0 \) -a \( $Tcl = 0 \) ] then if [ ! -r monitor.html ] then scp acis:/nfs/acis/a1/crater/"monitor.*" . fi # When looking at data taken with the MIT EGSE # we should use -t $REFRESH # since in those cases housekeeping appears once per second xterm -T "CRaTER Web monitor" -j -sb -ut -geometry 20x4+100-600 -e CWeb -L $UTC & HERE=`pwd` rm -f $HERE/index.html if [ $Fire != 0 ] then $Fire $HERE/index.html else $Saf $HERE/index.html fi ######## Otherwise use Tcl scripts else CHouse -L & sleep 2 CCmd -L & echo "$NAME: Close all five windows on exit!" fi else echo "Unknown program name $NAME used for invocation" echo "Repent/Retreat/Reboot" fi exit 0 ######################################################################## # Pod follows ######################################################################## =for html