Jpp  17.2.1-pre0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JAcousticsToolkit.sh
Go to the documentation of this file.
1 #!/bin/zsh
2 script=${0##*/}
3 
4 # ------------------------------------------------------------------------------------------
5 #
6 # Toolkit for acoustics scripts.
7 #
8 # ------------------------------------------------------------------------------------------
9 
10 if [ -z $JPP_DIR ]; then
11  echo "Variable JPP_DIR undefined."
12  exit
13 fi
14 
15 source $JPP_DIR/setenv.sh $JPP_DIR >& /dev/null
16 
17 if do_usage $*; then
18  usage "source $script"\
19  "\nToolkit for acoustics scripts."
20 fi
21 
22 
23 #
24 # Method to add tripod data from given file into associative array.
25 #
26 # \param 1 file name
27 # \param 2 associative array
28 #
29 function get_tripods+()
30 {
31  set_local_variable __FILE__ $1
32  set_local_variable __ARRAY__ $2
33 
34  while read __line__; do
35 
36  if [[ -n "$__line__" && "$__line__" != \#* ]]; then
37 
38  echo $__line__ | read __id__ __x__ __y__ __z__
39 
40  eval ${__ARRAY__}\[${__id__}\]=\"$__x__ $__y__ $__z__\"
41  fi
42 
43  done < $__FILE__
44 }
45 
46 
47 #
48 # Method to write tripod data from given file into associative array.
49 #
50 # \param 1 file name
51 # \param 2 associative array
52 #
53 function get_tripods()
54 {
55  eval $2=\(\)
56 
57  get_tripods+ $1 $2
58 }
59 
60 
61 #
62 # Method to add transmitter data from given file into associative array.
63 #
64 # \param 1 file name
65 # \param 2 associative array
66 #
67 function get_transmitters+()
68 {
69  set_local_variable __FILE__ $1
70  set_local_variable __ARRAY__ $2
71 
72  while read __line__; do
73 
74  if [[ -n "$__line__" && "$__line__" != \#* ]]; then
75 
76  echo $__line__ | read __id__ __string__ __floor__ __x__ __y__ __z__
77 
78  eval ${__ARRAY__}\[${__id__}\]=\"$__x__ $__y__ $__z__\"
79  fi
80 
81  done < $__FILE__
82 }
83 
84 
85 #
86 # Method to write transmitter data from given file into associative array.
87 #
88 # \param 1 file name
89 # \param 2 associative array
90 #
91 function get_transmitters()
92 {
93  eval $2=\(\)
94 
95  get_transmitters+ $1 $2
96 }
97 
98 
99 #
100 # Method to print string numbers of strings with with transmitter.
101 #
102 # \param 1 file name
103 # \return string numbers
104 #
105 function get_strings_with_transmitter()
106 {
107  set_local_variable __FILE__ $1
108 
109  while read __line__; do
110 
111  if [[ -n "$__line__" && "$__line__" != \#* ]]; then
112 
113  echo $__line__ | read __id__ __string__ __floor__ __x__ __y__ __z__
114 
115  echo -n " $__string__"
116  fi
117 
118  done < $__FILE__
119 
120  echo
121 }
122 
123 
124 #
125 # Method to print string numbers of strings with with hydrophone.
126 #
127 # \param 1 file name
128 # \return string numbers
129 #
130 function get_strings_with_hydrophone()
131 {
132  set_local_variable __FILE__ $1
133 
134  while read __line__; do
135 
136  if [[ -n "$__line__" && "$__line__" != \#* ]]; then
137 
138  echo $__line__ | read __string__ __floor__ __x__ __y__ __z__
139 
140  echo -n " $__string__"
141  fi
142 
143  done < $__FILE__
144 
145  echo
146 }
147 
148 
149 #
150 # Method to write waveform data from given file into associative array.
151 #
152 # \param 1 file name
153 # \param 2 associative array
154 #
155 function get_waveforms()
156 {
157  set_local_variable __FILE__ $1
158  set_local_variable __ARRAY__ $2
159 
160  while read __line__; do
161 
162  if [[ -n "$__line__" && "$__line__" != \#* ]]; then
163 
164  echo $__line__ | read __id__ __m__
165 
166  eval ${__ARRAY__}\[${__id__}\]=\"$__m__\"
167  fi
168 
169  done < $__FILE__
170 }
std::istream & read(std::istream &in, JTestSummary &summary, const char delimiter= ' ')
Read test summary.
exit
Definition: JPizza.sh:36
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR &dev null if do_usage *then usage source $script nToolkit for acoustics scripts fi function get_tripods()
then echo
const int n
Definition: JPolint.hh:697
* usage
script
Definition: JAcoustics.sh:2
esac $JPP_BIN JLogger sh $LOGGER until pgrep JGetMessage</dev/null > dev null