###################################
# RU OVERDEPTH.MI w/ CTD Sampling #
###################################

#   3/15/09 	dkaragon@marine 	initial, unfortunately can't easily use f_max_working_depth without resetting, so eliminated
#   2010_01_27  dkaragon@marine     only send header if have not used before
#	2011_08_11	dkaragon@marine		put c_science_send_all 0
#	2011_10_03	dkaragon@marine		added target_altitude to turn altimeter on during OD mission
#	2012_11_28	dkaragon@marine		doubled GPS wait to 120 seconds


sensor: c_science_send_all(bool)						0	# turn off just in case
sensor: c_science_all_on_enabled(bool)          		0   # control science individually
sensor: u_dbd_sensor_list_xmit_control(enum)    		3   # 3  = no header


behavior: abend
    b_arg: overdepth(m)						3.5 	# clipped to F_MAX_WORKING_DEPTH
    b_arg: overdepth_sample_time(s)			30.0

	# MS_ABORT_OVERTIME
    b_arg: overtime(s)						600.0

	# MS_ABORT_UNDERVOLTS
    b_arg: undervolts(V)					9.5
    b_arg: undervolts_sample_time(s)		60.0 

	# MS_ABORT_SAMEDEPTH_FOR
    b_arg: samedepth_for(s)					-1.0 	# <0 disables
    b_arg: samedepth_for_sample_time(s)		30.0 	# how often to check
	
	b_arg: use_thruster_for_ascent(bool)	1


behavior: dive_to
  b_arg: target_depth(m) 		10.0    # clips to f_max_working_depth
  b_arg: target_altitude(m)		3
  b_arg: use_pitch(enum) 		1       # 1  BattPos
  b_arg: pitch_value(X)  		1.0     # use_pitch == 1     in,  desired battpos, >0 to nose down

                                 
# SAMPLE : CTD
behavior: sample
    b_arg: sensor_type(enum)                    1   # 1 c_profile_on
    b_arg: sample_time_after_state_change(s)    0   # start sampling right away

    # Sampling Arguments
        b_arg: intersample_time(sec)    0    # if < 0 then off, if = 0 then fast as posible, > 0 secs
        b_arg: state_to_sample(enum)    15   # 15 diving|hovering|climbing|onsurface
        

behavior: prepare_to_dive
    b_arg: start_when(enum) 0   	# 0-immediately, 1-stack idle 2-depth idle
    b_arg: wait_time(s)    	120   	# how long to wait for gps
behavior: sensors_in       			# Turn all input sensors off
behavior: nop_cmds         			# We don't command heading
    b_arg: nop_heading(bool) 1   	# t-> cmd heading to _IGNORE to keep stack busy
