Jpp
software/JDataFilter/JDataFilter.sh
Go to the documentation of this file.
1 #!/bin/zsh
2 #
3 # \author rbruijn
4 #
5 script=${0##*/}
6 
7 # ------------------------------------------------------------------------------------------
8 #
9 # Example script to run JDataFilter and JDOMSimulator(s)
10 #
11 # ------------------------------------------------------------------------------------------
12 
13 
14 if [ -z $JPP_DIR ]; then
15  echo "Variable JPP_DIR undefined."
16  exit
17 fi
18 
19 
20 source $JPP_DIR/setenv.sh $JPP_DIR >& /dev/null
21 
22 
23 if ( do_usage $* ); then
24  usage "$script"
25 fi
26 
27 
28 #local test
29 
30 SERVER=localhost
31 LOGGER=localhost
32 DEBUG=3
33 RUN=1
34 
35 HOST1=$HOST
36 HOST2=$HOST
37 
38 PORT=5552
39 
40 RUNTIME_S=1
41 
42 cat>ev_init.txt<<EOF
43 hello world
44 EOF
45 
46 # re-start ligier for command and logger messages
47 
48 if (( 1 )); then
49  JLigiers.sh continue
50 fi
51 
52 
53 
54 # driver input
55 
56 cat>driver.txt<<EOF
57 
58 process dfilter $HOST1 ssh \$HOST\$ "JDataFilter -H \$SERVER\$ -M \$LOGGER\$ -d $DEBUG &";
59 
60 enter
61 
62 event ev_init { RC_CMD %<ev_init.txt>%from me%<ev_init.txt>% }
63 event ev_configure { RC_DFLTR datawriter=localhost; }
64 
65 event ev_start { RC_CMD $RUN}
66 
67 sleep $RUNTIME_S
68 
69 event ev_pause { RC_CMD }
70 event ev_stop { RC_CMD }
71 event ev_reset { RC_CMD }
72 event ev_off { RC_CMD }
73 
74 EOF
75 
76 JDAQDriver -H $SERVER -M $LOGGER -d $DEBUG -f driver.txt -c