#---------------------------------------------------
# Include the source files
#---------------------------------------------------

source depthbar.tcl
source vehicle.tcl


#-------------------------------------------------------------------------------
# This procedure will check what kind of graph user wants to
# have it displayed after the user click 'OK'
# This procedure will be called from "elem_prop.tcl" when the "ok" button
# is clicked from the popup menu
#-------------------------------------------------------------------------------

proc check_graph_type { surveh diganal grtype x y name e_num} {

      # Only Vehicle Analog has graphic output
      if {$surveh != 0 || $diganal != 0} {
      	return
      }


      # if "Depth 1" graph is selected -> getting 25 data every 2 minutes

      if { $grtype == "Depth 1" } {

         get_depth_window_path_name $name
         set_depth_pos $x $y
         set_which_hist 1
         display_depth_or_not 1 $e_num


      # end if (grtype == "Depth")
      }


      # if "Depth 2" graph is selected -> getting 25 data every 30 minutes
      if { $grtype == "Depth 2"} {


         get_depth_window_path_name $name
         set_depth_pos $x $y
         set_which_hist 2
         display_depth_or_not 1 $e_num


      # end if (grtype == "Depth 2")
      }

      # if "Depth 3" graph is selected -> getting 25 data every 2 hour
      if { $grtype == "Depth 3" } {


         get_depth_window_path_name $name
         set_depth_pos $x $y
         set_which_hist 3
         display_depth_or_not 1 $e_num


      # end if (grtype == "Depth 3")
      }


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

      # if "Bar" graph is selected
      if { [string compare $grtype "Bar"] == 0 } {
         #get_bar_window_path_name $e_num $name
         #set_bar_pos $x $y
         bar_detail $e_num

      # end if (grtype == "Bar")
      }


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

      if { $grtype == "None" || $grtype == "" } {

           display_depth_or_not 0 $e_num
           display_bar_or_not 0 $e_num

      }



# end procedure "check_graph_type"
}

