interact2
author A.M. Thurnherr <ant@ldeo.columbia.edu>
Tue, 14 Sep 2010 13:34:39 -0400
changeset 4 fda11de1826e
parent 0 648bde652211
permissions -rwxr-xr-x
version left on Poseidon at end of P403

#!/usr/bin/expect -f
#======================================================================
#                    I N T E R A C T 2 
#                    doc: Mon Mar  8 02:57:35 2004
#                    dlm: Thu Aug 26 00:27:02 2010
#                    (c) 2004 A.M. Thurnherr
#                    uE-Info: 20 39 NIL 0 0 72 0 2 8 NIL ofnI
#======================================================================

# HISTORY:
#  Mar  8, 2004: - incepted
#  Jun 15, 2004: - BUG: 2nd instrument was not put to sleep correctly
#		       (forgot to wait after toggle)
#  Nov 19, 2008: - added version
#  Aug 25, 2010: - DEFAULTS.expect -> CRUISE_SETUP.expect
#		 - libBB.expect -> libRDI.expect

log_user 0;

regsub {dir1} [exec which dir1] {libRDI.expect} path;
source $path;
source CRUISE_SETUP.expect;

print_version;

set_color;
send_user "Connecting to instruments..."
spawn bbabble $tty0 $tty1

set CTRLD \004
interact {
	"Instrument 0" {set_color 0;}
	"Instrument 1" {set_color 1;}
	$CTRLD {
		set_color;
		send_user "\nPutting instruments to sleep..."
		send "CZ\r"; expect -timeout 2 "D";
		toggle_instrument; expect -timeout 2 "end";
		send "CZ\r"; expect -timeout 2 "D";
		send_user "\nDone\n"
		exit;
        }
}