0
|
1 |
#!/usr/bin/expect -f
|
|
2 |
#======================================================================
|
|
3 |
# I N T E R A C T 2
|
|
4 |
# doc: Mon Mar 8 02:57:35 2004
|
|
5 |
# dlm: Wed Nov 19 15:15:46 2008
|
|
6 |
# (c) 2004 A.M. Thurnherr
|
|
7 |
# uE-Info: 22 14 NIL 0 0 72 0 2 8 NIL ofnI
|
|
8 |
#======================================================================
|
|
9 |
|
|
10 |
# HISTORY:
|
|
11 |
# Mar 8, 2004: - incepted
|
|
12 |
# Jun 15, 2004: - BUG: 2nd instrument was not put to sleep correctly
|
|
13 |
# (forgot to wait after toggle)
|
|
14 |
# Nov 19, 2008: - added version
|
|
15 |
|
|
16 |
log_user 0;
|
|
17 |
|
|
18 |
regsub {dir1} [exec which dir1] {libBB.expect} path;
|
|
19 |
source $path;
|
|
20 |
source DEFAULTS.expect;
|
|
21 |
|
|
22 |
print_version;
|
|
23 |
|
|
24 |
set_color;
|
|
25 |
send_user "Connecting to instruments..."
|
|
26 |
spawn bbabble $tty0 $tty1
|
|
27 |
|
|
28 |
set CTRLD \004
|
|
29 |
interact {
|
|
30 |
"Instrument 0" {set_color 0;}
|
|
31 |
"Instrument 1" {set_color 1;}
|
|
32 |
$CTRLD {
|
|
33 |
set_color;
|
|
34 |
send_user "\nPutting instruments to sleep..."
|
|
35 |
send "CZ\r"; expect -timeout 2 "D";
|
|
36 |
toggle_instrument; expect -timeout 2 "end";
|
|
37 |
send "CZ\r"; expect -timeout 2 "D";
|
|
38 |
send_user "\nDone\n"
|
|
39 |
exit;
|
|
40 |
}
|
|
41 |
}
|