##############################################################################
# Copyright 2003 MBARI.                                                      #
# Monterey Bay Aquarium Research Institute Proprietary Information.          #
# All rights reserved.                                                       #
##############################################################################

# uncomment package below if you use the udp package tests
#package require udp

#
# disable commands
#

proc disable_mode { } { 
    .pilot_interface.mode_frm.idle_btn configure -state disabled
    .pilot_interface.mode_frm.mid_water_btn configure -state disabled
    .pilot_interface.mode_frm.benthic_btn configure -state disabled
}

proc enable_mode { } { 
    .pilot_interface.mode_frm.idle_btn configure -state normal
    .pilot_interface.mode_frm.mid_water_btn configure -state normal
    .pilot_interface.mode_frm.benthic_btn configure -state normal
}

#
# mode button commands
#

proc idle_cmd {} { send_auto_rov_cmd "MODE IDLE" }
proc mid_water_cmd {} { send_auto_rov_cmd "MODE MIDWATER" }
proc benthic_cmd {} { send_auto_rov_cmd "MODE BENTHIC" }


##############################################################################
#                                                                            #
# udp package tests below, not using for now                                 #
#                                                                            #
##############################################################################

if { 0 } {

set s [udp_open]
udp_conf $s localhost 242

# commands for the various buttons

proc idle_cmd {} {
    global s
    set s [udp_open]
    udp_conf $s localhost 242
    fconfigure $s -remote [list localhost 242 ]
    puts -nonewline $s "IDLE CMD"
    puts $s "IDLE CMD"
    flush $s
    close $s
}

proc mid_water_cmd {} { 
    global s
    puts -nonewline $s "SNSR CMD"
    flush $s
}

proc benthic_cmd {} { 
    global s
    puts -nonewline $s "CTRL CMD"
    flush $s
}

}

