source /home/ventana/source/elem_prop2.tcl

#--------------------------------------------------
# initialize and set variable for the window name
#--------------------------------------------------

set head2 .head_input_list2
set altitude2 .altitude_list2

proc head_input_list2 { display } {

   #-------------------
   # Declare variable
   #-------------------
   global outh
   global head2

   if [winfo exists $head2] {
   	destroy $head2
   }

   #-------------------------------------------------------
   # Create a new window that contains the serial list
   #-------------------------------------------------------
   global env
   set env(DISPLAY) :0.1
   toplevel $head2
   set outh $display


   button $head2.in1 -relief flat -text "FOG GYRO" -command { head_selected2 $outh  "FOG GYRO"}
   button $head2.in2 -relief flat -text "BACKUP COMPASS" -command { head_selected2 $outh  "BACKUP COMPASS"}
   button $head2.in3 -relief flat -text "DVL" -command { head_selected2 $outh  "DVL"}


   for {set i 1 } {$i <= 3 } {incr i} {

   	pack $head2.in$i -side top


   }

  button $head2.b -text Close -command {destroy $head2}
  pack $head2.b

  #---------------------
  # helper procedure
  #---------------------

  proc head_selected2 { display text } {

      global head2

      $display configure -state normal
      $display delete 0 100
      $display insert 0 $text
      $display configure -state disabled


      # Close the output list after
      destroy $head2

  # end proc head_selected2
  }

#end of proc "head_input_list2"
}


proc altitude_list2 { display } {

   #-------------------
   # Declare variable
   #-------------------
   global outa2
   global altitude2

   if [winfo exists $altitude2] {
   	destroy $altitude2
   }

   #-------------------------------------------------------
   # Create a new window that contains the serial list
   #-------------------------------------------------------
   global env
   set env(DISPLAY) :0.1
   toplevel $altitude2
   set outa2 $display


   button $altitude2.in1 -relief flat -text "Mesotech" -command { altitude_selected2 $outa2  "MESOTECH"}
   button $altitude2.in2 -relief flat -text "Tritech" -command { altitude_selected2 $outa2  "TRITECH" }
   button $altitude2.in3 -relief flat -text "DVL" -command { altitude_selected2 $outa2  "DVL" }


   for {set i 1 } {$i <= 3 } {incr i} {

   	pack $altitude2.in$i -side top

   }

  button $altitude2.b -text Close -command {destroy $altitude2}
  pack $altitude2.b

  #---------------------
  # helper procedure
  #---------------------

  proc altitude_selected2 { display text } {

      global altitude2

      $display configure -state normal
      $display delete 0 100
      $display insert 0 $text
      $display configure -state disabled


      # Close the output list after
      destroy $altitude2
      send_down_auto_pilot
  # end proc altitude_selected2
  }

#end of proc "altitude_list2"
}
