-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcalib.sh
executable file
·40 lines (34 loc) · 944 Bytes
/
calib.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Pattern run
# Parameters: pattern mode
if [ $# != 3 ]
then
echo "Usage:" $0 "<board ID> <Att1> <Att2>"
exit
fi
# Configuration
BOARDID=$1
NRUN=$(<$DATADIR/last_run.txt)
NRUN=$(($NRUN+1))
if [ "$2" -gt "127" ] || [ "$3" -gt "127" ]
then
echo "Error: 127 is the max value allowed for attenuation factor. Aborting."
exit 0
fi
awk '/Attr1/{$3='$2'}1;' calibgen.cfg > temp.cfg
awk '/Attr2/{$3='$3'}1;' temp.cfg > calib$NRUN.cfg
# Clean
tmux kill-window -t "w"
# Execute run
$DAQDIR/run.sh 1236 192.168.1.1$BOARDID calib$NRUN.cfg $DATADIR/C$NRUN'_b'$BOARDID.data "w" 500
#for i in {1..500}
#do
# echo $NRUN $BOARDID
# echo 'Event' $i
# $DAQDIR/run.sh 1236 192.168.1.1$BOARDID calib$NRUN.cfg $DATADIR/C$NRUN'_b'$BOARDID.data "w" 0
#done
# Log run id
mv calib$NRUN.cfg $DATADIR/C$NRUN'_b'$BOARDID.cfg
rm $DATADIR/last_run.txt
echo $NRUN >> $DATADIR/last_run.txt
echo "Now killing tmux window w."
tmux kill-window -t "w"