%function instruct = addBlockDefaults(bstruct,instruct,whichval)
function instruct = addBlockDefaults(bstruct,instruct,whichval)


switch whichval

	case {'notes'}
		if isfield(bstruct,'speedmode')
			instruct = setfield(instruct,'speedmode','SpeedBlock'); end
		if isfield(bstruct,'verticalmode')
			instruct = setfield(instruct,'verticalmode','VerticalBlock'); end
		if isfield(bstruct,'horizontalmode')
			instruct = setfield(instruct,'horizontalmode','HorizontalBlock'); end			
		if isfield(bstruct,'rpm')
			instruct = setfield(instruct,'rpm','SpeedBlock'); end
		if isfield(bstruct,'speed')
			instruct = setfield(instruct,'speed','SpeedBlock'); end
		if isfield(bstruct,'depth')
			instruct = setfield(instruct,'depth','VerticalBlock'); end
		if isfield(bstruct,'pitch')
			instruct = setfield(instruct,'pitch','VerticalBlock'); end
		if isfield(bstruct,'elevator')
			instruct = setfield(instruct,'elevator','VerticalBlock'); end
        if isfield(bstruct,'altitude')
			instruct = setfield(instruct,'altitude','VerticalBlock'); end
		if isfield(bstruct,'rudder')
			instruct = setfield(instruct,'rudder','HorizontalBlock'); end
		if isfield(bstruct,'heading')
			instruct = setfield(instruct,'heading','HorizontalBlock'); end

	case {'types'}

		if isfield(bstruct,'rpm')
			instruct = setfield(instruct,'rpm','float'); end
		if isfield(bstruct,'speed')
			instruct = setfield(instruct,'speed','float'); end
		if isfield(bstruct,'depth')
			instruct = setfield(instruct,'depth','float'); end
		if isfield(bstruct,'pitch')
			instruct = setfield(instruct,'pitch','angle'); end	
		if isfield(bstruct,'elevator')
			instruct = setfield(instruct,'elevator','angle'); end
        if isfield(bstruct,'altitude')
			instruct = setfield(instruct,'altitude','float'); end
		if isfield(bstruct,'rudder')
			instruct = setfield(instruct,'rudder','angle'); end
		if isfield(bstruct,'heading')
			instruct = setfield(instruct,'heading','angle'); end

	case {'units'}
	
		if isfield(bstruct,'rpm')
			instruct = setfield(instruct,'rpm','rpm'); end
		if isfield(bstruct,'speed')
			instruct = setfield(instruct,'speed','meters/second'); end
		if isfield(bstruct,'depth')
			instruct = setfield(instruct,'depth','meters'); end 
		if isfield(bstruct,'pitch')
			instruct = setfield(instruct,'pitch','degrees'); end 	
		if isfield(bstruct,'elevator')
			instruct = setfield(instruct,'elevator','degrees'); end
        if isfield(bstruct,'altitude')
			instruct = setfield(instruct,'altitude','meters'); end
		if isfield(bstruct,'rudder')
			instruct = setfield(instruct,'rudder','degrees'); end
		if isfield(bstruct,'heading')
			instruct = setfield(instruct,'heading','degrees'); end		
			
end