source /home/ventana/source/compass_popup.tcl
source /home/ventana/source/light_menu.tcl
source /home/ventana/source/vehicle_popup.tcl
source /home/ventana/source/ground.tcl



################################
# Create the "Vehicle" submenu         #
################################


proc create_vehicle_submenu { }  {

set v_veh .ventana.bar.maintenance.menu.element.vehicle

.ventana.bar.maintenance.menu.element add cascade -label "Vehicle" \
	-menu $v_veh

menu $v_veh

#------------------------------------------------------------------------------------

#-------------------------------------------#
# Submenu of Vehicle called "Compass" ,     #
# "Ground Fault", "Vehicle" and "Lights"    #
#  			            	    #
#-------------------------------------------#

$v_veh add command -label "Ground Fault" \
	-command ground_fault
$v_veh add command -label "Compass" \
	-command compass_popup
$v_veh add command -label "Lights" \
	-command light_menu
$v_veh add command -label "Vehicle" \
	-command vehicle_popup
#------------------------------------------------------------------------------------


#--------------------------------------------------------------#
# Another submenu of "Vehicle" called "Digital In"              #
# Create the "Digital In" Submenu that contains 32 elements    #
#--------------------------------------------------------------#

$v_veh add cascade -label "Digital In" \
	-menu $v_veh.digin

menu $v_veh.digin

#------------------------------------------------------------------------------------

# Add the elements of submenu "Digital In"
$v_veh.digin add cascade -label "1-16" \
	-menu $v_veh.digin.part1

menu $v_veh.digin.part1

# Adding the first 16 elements
$v_veh.digin.part1 add command -label "1 [get_element_name 0 1 1]" -command { popup 0 1 1 }
$v_veh.digin.part1 add command -label "2 [get_element_name 0 1 2]" -command { popup 0 1 2 }
$v_veh.digin.part1 add command -label "3 [get_element_name 0 1 3]" -command { popup 0 1 3 }
$v_veh.digin.part1 add command -label "4 [get_element_name 0 1 4]" -command { popup 0 1 4 }
$v_veh.digin.part1 add command -label "5 [get_element_name 0 1 5]" -command { popup 0 1 5 }
$v_veh.digin.part1 add command -label "6 [get_element_name 0 1 6]"  -command { popup 0 1 6 }
$v_veh.digin.part1 add command -label "7 [get_element_name 0 1 7]"  -command { popup 0 1 7 }
$v_veh.digin.part1 add command -label "8 [get_element_name 0 1 8]" -command { popup 0 1 8 }
$v_veh.digin.part1 add command -label "9 [get_element_name 0 1 9]" -command { popup 0 1 9 }
$v_veh.digin.part1 add command -label "10 [get_element_name 0 1 10]" -command { popup 0 1 10 }
$v_veh.digin.part1 add command -label "11 [get_element_name 0 1 11]"  -command { popup 0 1 11 }
$v_veh.digin.part1 add command -label "12 [get_element_name 0 1 12]" -command { popup 0 1 12 }
$v_veh.digin.part1 add command -label "13 [get_element_name 0 1 13]" -command { popup 0 1 13 }
$v_veh.digin.part1 add command -label "14 [get_element_name 0 1 14]" -command { popup 0 1 14 }
$v_veh.digin.part1 add command -label "15 [get_element_name 0 1 15]" -command { popup 0 1 15 }
$v_veh.digin.part1 add command -label "16 [get_element_name 0 1 16]" -command { popup 0 1 16 }



$v_veh.digin add cascade -label "17-32" \
	-menu $v_veh.digin.part2

menu $v_veh.digin.part2

# Adding the elements 17-32
$v_veh.digin.part2 add command -label "17 [get_element_name 0 1 17]" -command { popup 0 1 17 }
$v_veh.digin.part2 add command -label "18 [get_element_name 0 1 18]" -command { popup 0 1 18 }
$v_veh.digin.part2 add command -label "19 [get_element_name 0 1 19]"  -command { popup 0 1 19 }
$v_veh.digin.part2 add command -label "20 [get_element_name 0 1 20]"  -command { popup 0 1 20 }
$v_veh.digin.part2 add command -label "21 [get_element_name 0 1 21]"  -command { popup 0 1 21 }
$v_veh.digin.part2 add command -label "22 [get_element_name 0 1 22]"  -command { popup 0 1 22 }
$v_veh.digin.part2 add command -label "23 [get_element_name 0 1 23]"  -command { popup 0 1 23 }
$v_veh.digin.part2 add command -label "24 [get_element_name 0 1 24]" -command { popup 0 1 24 }
$v_veh.digin.part2 add command -label "25 [get_element_name 0 1 25]"  -command { popup 0 1 25 }
$v_veh.digin.part2 add command -label "26 [get_element_name 0 1 26]"  -command { popup 0 1 26}
$v_veh.digin.part2 add command -label "27 [get_element_name 0 1 27]"   -command { popup 0 1 27 }
$v_veh.digin.part2 add command -label "28 [get_element_name 0 1 28]"  -command { popup 0 1 28 }
$v_veh.digin.part2 add command -label "29 [get_element_name 0 1 29]"  -command { popup 0 1 29 }
$v_veh.digin.part2 add command -label "30 [get_element_name 0 1 30]"  -command { popup 0 1 30 }
$v_veh.digin.part2 add command -label "31 [get_element_name 0 1 31]"  -command { popup 0 1 31 }
$v_veh.digin.part2 add command -label "32 [get_element_name 0 1 32]"  -command { popup 0 1 32 }



#------------------------------------------------------------------------------------

############################################################
# Another submenu of "Vehicle" called "Analog In"                                #
# Create the "Analog In" Submenu that contains 48 elements                   #
############################################################



$v_veh add cascade -label "Analog In" \
	-menu $v_veh.anain

menu $v_veh.anain


# Add the elements of submenu "Analog In"
$v_veh.anain add cascade -label "1-16" \
	-menu $v_veh.anain.part1
	
menu $v_veh.anain.part1


# Add the first 16 elements
$v_veh.anain.part1 add command -label "1 [get_element_name 0 0 1]" -command { popup 0 0 1  }
$v_veh.anain.part1 add command -label "2 [get_element_name 0 0 2]" -command { popup 0 0 2  }
$v_veh.anain.part1 add command -label "3 [get_element_name 0 0 3]"  -command { popup 0 0 3  }
$v_veh.anain.part1 add command -label "4 [get_element_name 0 0 4]"  -command { popup 0 0 4  }
$v_veh.anain.part1 add command -label "5 [get_element_name 0 0 5]"  -command { popup 0 0 5  }
$v_veh.anain.part1 add command -label "6 [get_element_name 0 0 6]"  -command { popup 0 0 6  }
$v_veh.anain.part1 add command -label "7 [get_element_name 0 0 7]"  -command { popup 0 0 7  }
$v_veh.anain.part1 add command -label "8 [get_element_name 0 0 8]"  -command { popup 0 0 8  }
$v_veh.anain.part1 add command -label "9 [get_element_name 0 0 9]"  -command { popup 0 0 9  }
$v_veh.anain.part1 add command -label "10 [get_element_name 0 0 10]"  -command { popup 0 0 10  }
$v_veh.anain.part1 add command -label "11 [get_element_name 0 0 11]"   -command { popup 0 0 11  }
$v_veh.anain.part1 add command -label "12 [get_element_name 0 0 12]"   -command { popup 0 0 12  }
$v_veh.anain.part1 add command -label "13 [get_element_name 0 0 13]"   -command { popup 0 0 13  }
$v_veh.anain.part1 add command -label "14 [get_element_name 0 0 14]"  -command { popup 0 0 14 }
$v_veh.anain.part1 add command -label "15 [get_element_name 0 0 15]"  -command { popup 0 0 15  }
$v_veh.anain.part1 add command -label "16 [get_element_name 0 0 16]"  -command { popup 0 0 16  }




$v_veh.anain add cascade -label "17-32" \
	-menu $v_veh.anain.part2
	
menu $v_veh.anain.part2

# Add the elements 17-32	
$v_veh.anain.part2 add command -label "17 [get_element_name 0 0 17]"  -command { popup 0 0 17  }
$v_veh.anain.part2 add command -label "18 [get_element_name 0 0 18]" -command { popup 0 0 18  }
$v_veh.anain.part2 add command -label "19 [get_element_name 0 0 19]" -command { popup 0 0 19  }
$v_veh.anain.part2 add command -label "20 [get_element_name 0 0 20]"  -command { popup 0 0 20  }
$v_veh.anain.part2 add command -label "21 [get_element_name 0 0 21]"  -command { popup 0 0 21  }
$v_veh.anain.part2 add command -label "22 [get_element_name 0 0 22]"  -command { popup 0 0 22  }
$v_veh.anain.part2 add command -label "23 [get_element_name 0 0 23]"  -command { popup 0 0 23  }
$v_veh.anain.part2 add command -label "24 [get_element_name 0 0 24]"  -command { popup 0 0 24  }
$v_veh.anain.part2 add command -label "25 [get_element_name 0 0 25]"  -command { popup 0 0 25  }
$v_veh.anain.part2 add command -label "26 [get_element_name 0 0 26]"  -command { popup 0 0 26  }
$v_veh.anain.part2 add command -label "27 [get_element_name 0 0 27]" -command { popup 0 0 27  }
$v_veh.anain.part2 add command -label "28 [get_element_name 0 0 28]"  -command { popup 0 0 28  }
$v_veh.anain.part2 add command -label "29 [get_element_name 0 0 29]"  -command { popup 0 0 29  }
$v_veh.anain.part2 add command -label "30 [get_element_name 0 0 30]"  -command { popup 0 0 30  }
$v_veh.anain.part2 add command -label "31 [get_element_name 0 0 31]"   -command { popup 0 0 31  }
$v_veh.anain.part2 add command -label "32 [get_element_name 0 0 32]"  -command { popup 0 0 32  }




$v_veh.anain add cascade -label "33-48" \
	-menu $v_veh.anain.part3

menu $v_veh.anain.part3

	
# Add the elements 33-48	
$v_veh.anain.part3 add command -label "33 [get_element_name 0 0 33]" -command { popup 0 0 33  }
$v_veh.anain.part3 add command -label "34 [get_element_name 0 0 34]"  -command { popup 0 0 34  }
$v_veh.anain.part3 add command -label "35 [get_element_name 0 0 35]"  -command { popup 0 0 35  }
$v_veh.anain.part3 add command -label "36 [get_element_name 0 0 36]"   -command { popup 0 0 36  }
$v_veh.anain.part3 add command -label "37 [get_element_name 0 0 37]"  -command { popup 0 0 37  }
$v_veh.anain.part3 add command -label "38 [get_element_name 0 0 38]"  -command { popup 0 0 38  }
$v_veh.anain.part3 add command -label "39 [get_element_name 0 0 39]" -command { popup 0 0 39  }
$v_veh.anain.part3 add command -label "40 [get_element_name 0 0 40]" -command { popup 0 0 40  }
$v_veh.anain.part3 add command -label "41 [get_element_name 0 0 41]"  -command { popup 0 0 41  }
$v_veh.anain.part3 add command -label "42 [get_element_name 0 0 42]"  -command { popup 0 0 42  }
$v_veh.anain.part3 add command -label "43 [get_element_name 0 0 43]"  -command { popup 0 0 43  }
$v_veh.anain.part3 add command -label "44 [get_element_name 0 0 44]"    -command { popup 0 0 44  }
$v_veh.anain.part3 add command -label "45 [get_element_name 0 0 45]"  -command { popup 0 0 45  }
$v_veh.anain.part3 add command -label "46 [get_element_name 0 0 46]" -command { popup 0 0 46  }
$v_veh.anain.part3 add command -label "47 [get_element_name 0 0 47]"  -command { popup 0 0 47  }
$v_veh.anain.part3 add command -label "48 [get_element_name 0 0 48]"   -command { popup 0 0 48  }



}





