author | A.M. Thurnherr <ant@ldeo.columbia.edu> |
Fri, 07 Jan 2011 23:25:51 +0000 | |
changeset 10 | 5873914adea7 |
parent 4 | fda11de1826e |
child 12 | 5e67754f6457 |
permissions | -rwxr-xr-x |
0 | 1 |
#!/usr/bin/expect -f |
2 |
#====================================================================== |
|
3 |
# A B O R T 1 |
|
4 |
# doc: Wed Mar 10 22:23:52 2004 |
|
4
fda11de1826e
version left on Poseidon at end of P403
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
0
diff
changeset
|
5 |
# dlm: Thu Aug 26 00:20:26 2010 |
0 | 6 |
# (c) 2004 A.M. Thurnherr |
4
fda11de1826e
version left on Poseidon at end of P403
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
0
diff
changeset
|
7 |
# uE-Info: 15 48 NIL 0 0 72 2 2 8 NIL ofnI |
0 | 8 |
#====================================================================== |
9 |
||
10 |
# HISTORY: |
|
11 |
# Jun 19, 2004: - adapted from [endladcp1] |
|
12 |
# Nov 6, 2006: - adapted to old regsub |
|
13 |
# Nov 19, 2008: - added version |
|
4
fda11de1826e
version left on Poseidon at end of P403
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
0
diff
changeset
|
14 |
# Aug 25, 2010: - DEFAULTS.expect -> CRUISE_SETUP.expect |
fda11de1826e
version left on Poseidon at end of P403
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
0
diff
changeset
|
15 |
# - libBB.expect -> libRDI.expect |
0 | 16 |
|
17 |
#---------------------------------------------------------------------- |
|
18 |
# Setup |
|
19 |
#---------------------------------------------------------------------- |
|
20 |
||
21 |
log_user 0; |
|
4
fda11de1826e
version left on Poseidon at end of P403
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
0
diff
changeset
|
22 |
source CRUISE_SETUP.expect; |
fda11de1826e
version left on Poseidon at end of P403
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
0
diff
changeset
|
23 |
regsub {dir1} [exec which dir1] {libRDI.expect} path; |
0 | 24 |
source $path; |
25 |
||
26 |
print_version; |
|
27 |
||
28 |
if ![file isdirectory $raw_dir] { |
|
29 |
error "directory $raw_dir does not exist"; |
|
30 |
} |
|
31 |
||
32 |
#---------------------------------------------------------------------- |
|
33 |
# Get Station Number |
|
34 |
#---------------------------------------------------------------------- |
|
35 |
||
36 |
spawn bbabble -ms $tty0; |
|
37 |
||
38 |
set_color; |
|
39 |
send_user "Connecting to instrument..."; |
|
40 |
wait_for_startup; |
|
41 |
reset_instrument; |
|
42 |
||
43 |
send_user "\nGetting station number..."; |
|
44 |
set deployment_name [get_deployment_name]; |
|
45 |
if {[scan $deployment_name $master_deployment_name_fmt stn] != 1} { |
|
46 |
send_error "$deployment_name $master_deployment_name_fmt"; |
|
47 |
error "Can't get station number"; |
|
48 |
} |
|
49 |
set stnstr [format $stn_format $stn]; |
|
50 |
send_user "\[$stnstr\]"; |
|
51 |
||
52 |
send_user "\nPutting instrument to sleep..."; |
|
53 |
put_to_sleep; |
|
54 |
||
55 |
set cast_dir [format %s/%s $raw_dir $stnstr]; |
|
56 |
if {![file isdirectory $cast_dir]} { |
|
57 |
error "\ncast directory $cast_dir does not exist!"; |
|
58 |
} |
|
59 |
||
60 |
send_user "\nRenaming $cast_dir..." |
|
61 |
set attempt 1; # rename |
|
62 |
while {[file isdirectory $cast_dir.aborted$attempt]} { |
|
63 |
set attempt [expr $attempt + 1]; |
|
64 |
} |
|
65 |
exec mv $cast_dir $cast_dir.aborted$attempt; |
|
66 |
||
67 |
send_user "\nDone\n" |