-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExec_threeD
More file actions
72 lines (62 loc) · 1.47 KB
/
Exec_threeD
File metadata and controls
72 lines (62 loc) · 1.47 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/bash
#FILE: Exec_threeD
#DATE: 23 FEB 2004
#AUTH: G. E. Deschaines
#DESC: Execute threeD.exe with specified trajectory output file,
# missile type code, and rendered image output switch.
function display_usage
{
echo "usage: Exec_threeD #### [1|2] [0|1]"
echo "where: #### is a TXYZ.OUT file run number of the form"
echo " 0000 to 9999 inclusive."
echo " [1|2] a missile type code: 1=MANPAD, 2=AIM-9"
echo " [0|1] rendered image output switch: 0=no, 1=yes"
}
# Set run number.
if [ $# -lt 1 ] || [ $1 -lt 0 ] || [ $1 -gt 9999 ]
then
display_usage
exit -1
fi
run=$1
# Set missile type code.
msltyp=1
if [ $# -gt 1 ] && [ $2 -ge 1 ] && [ $2 -le 2 ]
then
msltyp=$2
else
display_usage
exit -1
fi
# Set rendered image output switch.
imgout=0
if [ $# -gt 2 ] && [ $3 -ge 0 ] && [ $3 -le 1 ]
then
imgout=$3
else
display_usage
exit -1
fi
# Check if threeD executable file exists.
if [ ! -e ./bin/threeD.exe ]
then
echo "error: threeD.exe does not exist, but can be created"
echo " by running the Make_threeD shell script."
exit -1
fi
# Check if trajectory output file exists.
file="TXYZ.OUT.${run}"
if [ ! -e ./txyz/$file ]
then
echo "error: file ${file} does not exist."
exit -2
fi
# Create ./Ximg subdirectory is not present.
if [ "${imgout}" == "1" ] && [ ! -d ./Ximg ]
then
mkdir ./Ximg
fi
# Initiate execution of threeD.
./bin/threeD.exe "${run}" "${msltyp}" "${imgout}"
# Terminate this shell script.
exit 0