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

source depthbar2.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_type2 { surveh diganal grtype x y name e_num} {

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


      # if "Depth 1" graph is selected -> getting 25 data every 2 minutes
      if { [string compare $grtype "Depth 1"] == 0 } {


         get_depth2_window_path_name $name
         set_depth2_pos $x $y
         set_which_hist2 1
         display_depth2_or_not 1 $e_num


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


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


         get_depth2_window_path_name $name
         set_depth2_pos $x $y
         set_which_hist2 2
         display_depth2_or_not 1 $e_num


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

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


         get_depth2_window_path_name $name
         set_depth2_pos $x $y
         set_which_hist2 3
         display_depth2_or_not 1 $e_num


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


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

      # if "Bar" graph is selected
      if { [string compare $grtype "Bar"] == 0 } {
         get_bar2_window_path_name $e_num $name
         set_bar2_pos $x $y
         bar_detail2 $e_num

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


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

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

           display_depth2_or_not 0 $e_num
           display_bar2_or_not 0 $e_num

      }

# end procedure "check_graph_type"
}

