source /home/ventana/source/submenu/update_button.tcl



#####################################################
# Create the menu for the "Instruments" button                           #
#####################################################

#--------------
# initially
#--------------
#set im1 1
#set im3 1





proc create_instrument_submenu { } {

   global im

   set instrument .ventana.bar.instrument.menu
   menu $instrument



   $instrument add check -label "MSC 2000" \
	-variable im(1) -command { instr_button 1 2 $im(1) }
   $instrument add check -label "FOG Power" \
	-variable im(2) -command { instr_button 1 3 $im(2) }
   $instrument add check -label "Mesotech Alt Power" \
	-variable im(3) -command {instr_button 1 4 $im(3) }
   $instrument add check -label "Imagenex Alt Power" \
	-variable im(4) -command {instr_button 1 5 $im(4) }
   $instrument add check -label "Science 120 VAC" \
	-variable im(5) -command {instr_button 1 6 $im(5) }
   $instrument add check -label "Core 120 VAC" \
	-variable im(6) -command {instr_button 1 7 $im(6) }
   $instrument add check -label "DVL Power" \
	-variable im(7) -command {instr_button 1 8 $im(7) }

   $instrument add check -label "Main Camera" \
	-variable fm(1) -command {instr_button 1 14 $fm(1) }
   $instrument add check -label "Still Camera" \
	-variable fm(2) -command {instr_button 1 15 $fm(2)}
   $instrument add check -label "Insite Camera" \
	-variable fm(3) -command {instr_button 1 16 $fm(3) }
   $instrument add check -label "Aux Camera 1" \
	-variable fm(4) -command {instr_button 1 17 $fm(4) }
   $instrument add check -label "Aux Camera 2" \
	-variable fm(5) -command {instr_button 1 18 $fm(5) }
   $instrument add check -label "Schiling" \
	-variable fm(6) -command {instr_button 1 20 $fm(6) }
   $instrument add check -label "Lasers" \
	-variable fm(7) -command {instr_button 1 21 $fm(7) }
   $instrument add check -label "CTD" \
	-variable fm(8) -command {instr_button 1 22 $fm(8) }
   $instrument add check -label "CTD Pump" \
	-variable fm(9) -command {instr_button 1 23 $fm(9) }
   $instrument add check -label "Homer Power" \
	-variable fm(10) -command {instr_button 1 24 $fm(10) }
   $instrument add check -label "Sonar Power" \
 	-variable fm(11) -command {instr_button 1 25 $fm(11) }
   $instrument add check -label "ACM Power" \
 	-variable fm(12) -command {instr_button 1 26 $fm(12) }
   $instrument add check -label "FO Science 24 Power" \
 	-variable fm(13) -command {instr_button 1 27 $fm(13) }
   $instrument add check -label "Stbd Science 24 Power" \
 	-variable fm(14) -command {instr_button 1 28 $fm(14) }
   $instrument add check -label "Port Science 24 Power" \
 	-variable fm(15) -command {instr_button 1 29 $fm(15) }
   $instrument add check -label "FO Science 12 Power" \
 	-variable fm(16) -command {instr_button 1 30 $fm(16) }
   $instrument add check -label "Stbd Science 12 Power" \
 	-variable fm(17) -command {instr_button 1 31 $fm(17) }
   $instrument add check -label "Port Science 12 Power" \
 	-variable fm(18) -command { instr_button 1 32 $fm(18) }

      	
}



proc instr_button { board elem_num state} {
	
	# If there is not button exist on the screen
	if { [send_alternate_but_down $board $elem_num ] == -1} {
		send_switches_down  $board $elem_num $state
	
	}
	update_button $board $elem_num

}



