###########################
# Include source files    #
###########################

source /home/ventana/source/submenu/auto_cruise2.tcl
source /home/ventana/source/submenu/auto_pilot_popup2.tcl
source /home/ventana/source/submenu/arm_control_popup2.tcl
source /home/ventana/source/submenu/camera_popup2.tcl
source /home/ventana/source/submenu/log_field2.tcl

############################################
# Create the menu for the "Setting" button #
############################################

proc create_setting_submenu2 { } {

     set v2_setting .ventana2.bar.maintenance.menu.setting

menu $v2_setting




######################################
# Create window to enter Dive Number 	#
######################################

$v2_setting add command -label "Dive Number" \
	-command dive_popup2


######################################
# Create window to enter RPM Interval 	#
######################################

$v2_setting add command -label "RPM Interval" \
	-command rpm_popup2


######################################
# Create window to enter Latitude Value 	#
######################################

$v2_setting add command -label "Latitude" \
	-command latitude_popup2

	
	

###########################################
# Create the "Disk Logging" setup window  #
###########################################

$v2_setting add command -label "Disk Logging" \
	-command logging2

	
###########################################
# Create the "Auto Cruise" Window		         #
###########################################


$v2_setting add command -label "Auto Cruise" \
	-command auto_cruise2

	
	
###########################################
# Create the "Auto Pilot" submenu         #
###########################################

$v2_setting add command -label "Auto Pilot" \
	-command auto_pilot_popup2


###########################################
# Create the "Arm" submenu                #
###########################################

$v2_setting add command -label "Arm Control" \
	-command arm_control_popup2


	
	
###########################################
# Create the "Camera" submenu                #
###########################################

$v2_setting add command -label "Camera Control" \
	-command camera_popup2


	
# end of proc "create_setting_submenu"
}


proc dive_popup2 { } {
	
	global env
	set env(DISPLAY) :0.1


	# Kenny - Nov. 18, 2002
	global dive_num	
	set dive_num [get_dive_num]
	
	if [winfo exists .dive2] {destroy .dive2}	
	toplevel .dive2
	wm title .dive2 "Dive Number"
	
	label .dive2.label -text "Dive Number"
	entry .dive2.ent -bg white -width 10 -textvariable dive_num
	
	button .dive2.ok -text "Ok" \
		-command {set_dive_num $dive_num } -width 5 -height 2
	button .dive2.close -text "Close" \
		-command {destroy .dive2} -width 5 -height 2
	
	pack .dive2.label .dive2.ent  -pady 2m -padx 2m
	pack .dive2.ok .dive2.close -side left -pady 2m -padx 2m
	
	bind .dive2.ent <Return> { set_dive_num $dive_num }
	
}

proc rpm_popup2 { } {
	
	global env
	set env(DISPLAY) :0.1

	# Kenny - Nov. 18, 2002
	global rpm_interval	
	set rpm_interval [get_rpm_interval]

	
	if [winfo exists .rpm2] {destroy .rpm2}	
	toplevel .rpm2
	wm title .rpm2 "RPM Interval"
	
	label .rpm2.label -text "RPM Interval"
	entry .rpm2.ent -bg white -width 10 -textvariable rpm_interval
	
	button .rpm2.ok -text "Ok" \
		-command {set_rpm_num $rpm_num } -width 5 -height 2
	button .rpm2.close -text "Close" \
		-command {destroy .rpm2} -width 5 -height 2
	
	pack .rpm2.label .rpm2.ent  -pady 2m -padx 2m
	pack .rpm2.ok .rpm2.close -side left -pady 2m -padx 2m
	
	bind .rpm2.ent <Return> { set_rpm_interval $rpm_interval }
	
}


proc latitude_popup2 { } {
	
	global env
	set env(DISPLAY) :0.1

	# Kenny - Nov. 18, 2002
	global latitude_val	
	set latitude_val [get_latitude_val]
	
	if [winfo exists .latitude2] {destroy .latitude2}	
	toplevel .latitude2
	wm title .latitude2 "Latitude Value"
	
	label .latitude2.label -text "Latitude"
	entry .latitude2.ent -bg white -width 10 -textvariable latitude_val
	
	button .latitude2.ok -text "Ok" \
		-command {set_latitude_val $latitude_val } -width 5 -height 2
	button .latitude2.close -text "Close" \
		-command {destroy .latitude2} -width 5 -height 2
	
	pack .latitude2.label .latitude2.ent  -side top -pady 2m -padx 2m
	pack .latitude2.ok .latitude2.close -side left  -pady 2m -padx 2m
	
	bind .latitude2.ent <Return> { set_latitude_val $latitude_val }
	
}
	
