%function [bunits,bnames] = behaviorUnits(behaviorsOnly)
function [bunits,bnames] = behaviorUnits(behaviorsOnly)

if ~nargin, behaviorsOnly = 0; end
if ~behaviorsOnly,

% Relative Waypoint
waypointrel.name = 'waypointrel';
waypointrel.range = 'meters';
waypointrel.azimuth = 'degrees';

% Compass Star
compassstar.name = 'compassstar';
compassstar.missionname = [];
compassstar.startlat = 'degrees';
compassstar.startlon = 'degrees';
compassstar.tracklength = 'meters';
compassstar.azimuth = 'degrees';
compassstar.depth = 'meters';
compassstar.rpm = 'revolutions/minute';
compassstar.gpsfixesperleg = '# of GPS fixes';
compassstar.numlegs = '# of survey legs';
compassstar.transittime = 'seconds';

% Compass Circle
compasscircle.name = 'compasscircle';
compasscircle.missionname = [];
compasscircle.startlat = 'degrees';
compasscircle.startlon = 'degrees';
compasscircle.tracklength = 'meters';
compasscircle.azimuth = 'degrees';
compasscircle.depth = 'meters';
compasscircle.rpm = 'revolutions/minute';
compasscircle.gpsfixesperleg = '# of GPS fixes';
compasscircle.numlegs = '# of survey legs';
compasscircle.transittime = 'seconds';

% Survey Criss Cross
crisscross.name = 'crisscross';
crisscross.missionname = [];
crisscross.lat0 = 'degrees';
crisscross.lon0 = 'degrees';
crisscross.lat1 = 'degrees';
crisscross.lon1 = 'degrees';
crisscross.lat2 = 'degrees';
crisscross.lon2 = 'degrees';
crisscross.sonarrange = 'meters';
crisscross.naverr = 'percent';
crisscross.depth = 'meters';
crisscross.rpm = 'revolutions/minute';
crisscross.gpsfixesperleg = '# of GPS fixes';
crisscross.transitdistance = 'meters';

% Survey
survey.name = 'survey';
survey.missionname = [];
survey.startlat = 'degrees';
survey.startlon = 'degrees';
survey.tracklead = 'meters';
survey.tracklength = 'meters';
survey.trackspacing1 = 'meters';
survey.trackspacing2 = 'meters';
survey.azimuth = 'degrees';
survey.depth = 'meters';
survey.rpm = 'revolutions/minute';
survey.gpsfixesperleg = '# of GPS fixes';
survey.numlegs = '# of survey legs';
survey.transittime = 'seconds';

% Survey Box
surveybox.name = 'surveybox';
surveybox.missionname = [];
surveybox.northwestlat = 'degrees';
surveybox.northwestlon = 'degrees';
surveybox.southeastlat = 'degrees';
surveybox.southeastlon = 'degrees';
surveybox.tracklead = 'meters';
surveybox.trackspacing1 = 'meters';
surveybox.trackspacing2 = 'meters';
surveybox.depth = 'meters';
surveybox.rpm = 'revolutions/minute';
surveybox.gpsfixesperleg = '# of GPS fixes';
surveybox.transittime = 'seconds';

% Survey Area
surveyarea.name = 'surveyarea';
surveyarea.missionname = [];
surveyarea.lat0 = 'degrees';
surveyarea.lon0 = 'degrees';
surveyarea.lat1 = 'degrees';
surveyarea.lon1 = 'degrees';
surveyarea.lat2 = 'degrees';
surveyarea.lon2 = 'degrees';
surveyarea.tracklead = 'meters';
surveyarea.trackspacing1 = 'meters';
surveyarea.trackspacing2 = 'meters';
surveyarea.depth = 'meters';
surveyarea.rpm = 'revolutions/minute';
surveyarea.gpsfixesperleg = '# of GPS fixes';
surveyarea.transittime = 'seconds';

% Survey Area EZ
surveyareaez.name = 'surveyareaez';
surveyareaez.missionname = [];
surveyareaez.lat0 = 'degrees';
surveyareaez.lon0 = 'degrees';
surveyareaez.lat1 = 'degrees';
surveyareaez.lon1 = 'degrees';
surveyareaez.lat2 = 'degrees';
surveyareaez.lon2 = 'degrees';
surveyareaez.sonarrange = 'meters';
surveyareaez.naverr = 'percent';
surveyareaez.depth = 'meters';
surveyareaez.rpm = 'revolutions/minute';
surveyareaez.gpsfixesperleg = '# of GPS fixes';
surveyareaez.transitdistance = 'meters';

% Survey Area Oneway
surveyareaoneway.name = 'surveyareaoneway';
surveyareaoneway.missionname = [];
surveyareaoneway.lat0 = 'degrees';
surveyareaoneway.lon0 = 'degrees';
surveyareaoneway.lat1 = 'degrees';
surveyareaoneway.lon1 = 'degrees';
surveyareaoneway.lat2 = 'degrees';	
surveyareaoneway.lon2 = 'degrees';
surveyareaoneway.tracklead = 'meters';
surveyareaoneway.trackspacing1 = 'meters';
surveyareaoneway.trackspacing2 = 'meters';
surveyareaoneway.depth = 'meters';
surveyareaoneway.rpm = 'revolutions/minute';
surveyareaoneway.gpsfixesperleg = '# of GPS fixes';
surveyareaoneway.transittime = 'seconds';

% Survey Area 4Leaf
surveyarea4leaf.name = 'surveyarea4leaf';
surveyarea4leaf.missionname = [];
surveyarea4leaf.lat0 = 'degrees';
surveyarea4leaf.lon0 = 'degrees';
surveyarea4leaf.az = 'degrees';
surveyarea4leaf.leglength = 'meters';
surveyarea4leaf.tracklead = 'meters';
surveyarea4leaf.depth = 'meters';
surveyarea4leaf.rpm = 'revolutions/minute';
surveyarea4leaf.transittime = 'seconds';

% Survey Area Raw
surveyarearaw.name = 'surveyarearaw';
surveyarearaw.missionname = [];

% Q Route
qroute.name = 'qroute';
qroute.missionname = [];
qroute.lat = 'degrees';
qroute.lon = 'degrees';
qroute.direction = 'along or cross';
qroute.tracklead = 'meters';
qroute.width = 'meters';
qroute.trackspacing1 = 'meters';
qroute.trackspacing2 = 'meters';
qroute.depth = 'meters';
qroute.rpm = 'revolutions/minute';
qroute.gpsfixesperleg = '# of GPS fixes';
qroute.transittime = 'seconds';

% Q Route Relative
qrouterelative.name = 'qrouterelative';
qrouterelative.missionname = [];
qrouterelative.initiallat = 'degrees';
qrouterelative.initiallong = 'degrees';
qrouterelative.offsetfromstart = 'meters';
qrouterelative.length = 'meters';
qrouterelative.azimuth = 'degrees';
qrouterelative.direction = 'along or cross';
qrouterelative.tracklead = 'meters';
qrouterelative.width = 'meters';
qrouterelative.trackspacing1 = 'meters';
qrouterelative.trackspacing2 = 'meters';
qrouterelative.depth = 'meters';
qrouterelative.rpm = 'revolutions/minute';
qrouterelative.gpsfixesperleg = '# of GPS fixes';
qrouterelative.transittime = 'seconds';

% Worksite
worksite.name = 'worksite';
worksite.latitude = 'degrees';
worksite.longitude = 'degrees';
worksite.magneticvariation = 'degrees';
worksite.utmzone = [];

end %if ~behaviorsOnly

%Ascend
ascend.name = 'ascend';
ascend.duration = 'seconds';
ascend.pitch = 'degrees';
ascend.enddepth = 'meters';
ascend.dropdescentweight = 'True or False';
ascend.dropascentweight = 'True or False';
ascend.speedblock = [];
ascend.horizontalblock = [];
ascend.debug = '0 to 5';

%AvoidObstacles
avoidobstacles.name = 'avoidobstacles';
avoidobstacles.abortrange = 'meters';
avoidobstacles.minrange = 'meters';
avoidobstacles.avoidmode = 'Off, Low, High, or NoPlane';
avoidobstacles.defrangeact = 'meters';
avoidobstacles.mydebug = '0 to 5';

%Chirpfin
chirpfin.name = 'chirpfin';
chirpfin.duration = 'seconds';
chirpfin.amplitude = 'degrees';
chirpfin.initialfreq = 'Hertz';
chirpfin.finalfreq = 'Hertz';
chirpfin.plane = 'horizontal or vertical';
chirpfin.debug = '0 to 5';

%CompassCal
compasscal.name = 'compasscal';
compasscal.crossbow = 'True or False';
compasscal.leica = 'True or False';
compasscal.start = 'True or False';
compasscal.stop = 'True or False';
compasscal.debug = '0 to 5';

%ControlModem
controlmodem.name = 'controlmodem';
controlmodem.allowcoms = 'True or False';
controlmodem.mydebug = '0 to 5';

%ControlPower
controlpower.name = 'controlpower';
controlpower.circuit0 = 'True or False';
controlpower.circuit1 = 'True or False';
controlpower.circuit2 = 'True or False';
controlpower.circuit3 = 'True or False';
controlpower.circuit4 = 'True or False';
controlpower.circuit5 = 'True or False';
controlpower.circuit6 = 'True or False';
controlpower.circuit7 = 'True or False';
controlpower.circuit8 = 'True or False';
controlpower.circuit9 = 'True or False';
controlpower.circuit10 = 'True or False';
controlpower.circuit11 = 'True or False';
controlpower.circuit12 = 'True or False';
controlpower.circuit13 = 'True or False';
controlpower.circuit15 = 'True or False';
controlpower.circuit16 = 'True or False';

%ControlSonar
controlsonar.name = 'controlsonar';
controlsonar.description = '*';
controlsonar.setmode = 'normal, standby, or lowpower';
controlsonar.logging = 'on or off';
controlsonar.setrange = 'meters';
controlsonar.setresolution = 'Normal or High';
controlsonar.snapshot = 'Time (distance) bins';
controlsonar.debug = '0 to 5';

%ControlSonarEdgeTech
controlsonaredgetech.name = 'controlsonaredgetech';
controlsonaredgetech.description = '*';
controlsonaredgetech.sonarsystempoweron  = 'True or False';
controlsonaredgetech.sonarsystempoweroff = 'True or False';
controlsonaredgetech.sonarsystemreboot   = 'True or False';
controlsonaredgetech.sonarsystemshutdown = 'True or False';
controlsonaredgetech.setmodesbp = 'on or off';
controlsonaredgetech.setmodessl = 'on or off';
controlsonaredgetech.setmodessh = 'on or off';
controlsonaredgetech.logging = 'on or off';
controlsonaredgetech.sbppingrate = 'Hz';
controlsonaredgetech.sslpingrate = 'Hz';
controlsonaredgetech.sshpingrate = 'Hz';
controlsonaredgetech.sslpingrange = 'meters';
controlsonaredgetech.sshpingrange = 'meters';
controlsonaredgetech.debug = '0 to 5';

%DepthEnvelope
depthenvelope.name = 'depthenvelope';
depthenvelope.mindepth = 'meters';
depthenvelope.maxdepth = 'meters';
depthenvelope.minaltitude = 'meters';
depthenvelope.abortdepth = 'meters';
depthenvelope.abortaltitude = 'meters';
depthenvelope.debug = '0 to 5';

%Descend
descend.name = 'descend';
descend.duration = 'seconds';
descend.pitch = 'degrees';
descend.maxdepth = 'meters';
descend.minaltitude = 'meters';
descend.dropdescentweight = 'True or False';
descend.dropascentweight = 'True or False';
descend.speedblock = [];
descend.horizontalblock = [];
descend.debug = '0 to 5';

%GetGps
getgps.name = 'getgps';
getgps.duration = 'seconds';
getgps.abortontimeout = 'True or False';
getgps.minhits = '# of GPS hits';
getgps.minsats = '# of GPS satellites';
getgps.maxhitvelocity = 'meters/second';
getgps.maxhitspacing = 'second';
getgps.debug = '0 to 5';

%Homing
homing.name = 'homing';
homing.duration = 'seconds';
homing.headinggain = 'absolute number';
homing.releasedepth = 'meters';
homing.releasedepthchange = 'meters';
homing.releasetime = 'seconds';
homing.latchedrangerate = 'meters/second';
homing.missedrangerate = 'meters/second';
homing.closingrangerate = 'meters/second';
homing.azimutherror = 'radians';
homing.headingrate = 'radians/second';
homing.pingperiod = 'seconds';
homing.startdelaytime = 'seconds';
homing.listentime = 'seconds';
homing.tolerancetime = 'seconds';
homing.runouttime = 'seconds';
homing.realigntime = 'seconds';
homing.searchtime = 'seconds';
homing.terminationtime = 'seconds';
homing.speedblock = [];
homing.horizontalblock = [];
homing.mydebug = '0 to 5';

%Launch
launch.name = 'launch';
launch.duration = 'seconds';
launch.elevator = 'degrees';
launch.finaldepth = 'meters';
launch.abortontimeout = 'True or False';
launch.initialelevator = 'degrees';
launch.initialrunout = 'seconds';
launch.speedblock = [];
launch.horizontalblock = [];
launch.debug = '0 to 5';

%MissionTime
missiontimer.name = 'missiontimer';
missiontimer.timeout = 'seconds';
missiontimer.debug = '0 to 5';

%SetDepth
setdepth.name = 'setdepth';
setdepth.duration = 'seconds';
setdepth.depth = 'meters';
setdepth.speedblock = [];
setdepth.debug = '0 to 5';

%SetElevator
setelevator.name = 'setelevator';
setelevator.duration = 'seconds';
setelevator.elevator = 'degrees';
setelevator.mindepth = 'meters';
setelevator.maxdepth = 'meters';
setelevator.maxpitch = 'degrees';
setelevator.speedblock = [];
setelevator.debug = '0 to 5';

%Setpoint
setpoint.name = 'setpoint';
setpoint.duration = 'seconds';
setpoint.heading = 'degrees';
setpoint.legduration = 'seconds';
setpoint.maxlegs = '# of legs';
setpoint.headinginc = 'degrees';
setpoint.verticalblock = [];
setpoint.speedblock = [];
setpoint.debug = '0 to 5';

%SetRudder
setrudder.name = 'setrudder';
setrudder.duration = 'seconds';
setrudder.rudder = 'degrees';
setrudder.depth = 'meters';
setrudder.speedblock = [];
setrudder.debug = '0 to 5';

%Trackline Geo
tracklinegeo.name = 'tracklinegeo';
tracklinegeo.duration = 'seconds';
tracklinegeo.latitude = 'degrees';
tracklinegeo.longitude = 'degrees';
tracklinegeo.captureradius = 'meters';
tracklinegeo.circlemode = 'True or False';
tracklinegeo.initiallat = 'degrees';
tracklinegeo.initiallong = 'degrees';
tracklinegeo.crosstrackpgain = 'radian/meters';
tracklinegeo.crosstrackigain = 'radian/meters';
tracklinegeo.verticalblock = [];
tracklinegeo.speedblock = [];
tracklinegeo.debug = '0 to 5';

%Trackline Utm
tracklineutm.name = 'tracklineutm';
tracklineutm.duration = 'seconds';
tracklineutm.northing = 'meters';
tracklineutm.easting = 'meters';
tracklineutm.captureradius = 'meters';
tracklineutm.circlemode = 'True or False';
tracklineutm.initialn = 'meters';
tracklineutm.initiale = 'meters';
tracklineutm.crosstrackpgain = 'radian/meters';
tracklineutm.crosstrackigain = 'radian/meters';
tracklineutm.verticalblock = [];
tracklineutm.speedblock = [];
tracklineutm.debug = '0 to 5';

%Waypoint Geo
waypointgeo.name = 'waypointgeo';
waypointgeo.duration = 'seconds';
waypointgeo.latitude = 'degrees';
waypointgeo.longitude = 'degrees';
waypointgeo.captureradius = 'meters';
waypointgeo.circlemode = 'True or False';
waypointgeo.verticalblock = [];
waypointgeo.speedblock = [];
waypointgeo.debug = '0 to 5';

%Waypoint Utm
waypointutm.name = 'waypointutm';
waypointutm.duration = 'seconds';
waypointutm.northing = 'meters';
waypointutm.easting = 'meters';
waypointutm.captureradius = 'meters';
waypointutm.circlemode = 'True or False';
waypointutm.verticalblock = [];
waypointutm.speedblock = [];
waypointutm.debug = '0 to 5';

%Wiggle
wiggle.name = 'wiggle';
wiggle.duration = 'seconds';
wiggle.rudderperiod = 'seconds';
wiggle.elevatorperiod = 'seconds';
wiggle.rudderamplitude = 'degrees';
wiggle.elevatoramplitude = 'degrees';
wiggle.speedblock = [];
wiggle.debug = '0 to 5';

%Yoyo
yoyo.name = 'yoyo';
yoyo.duration = 'seconds';
yoyo.mindepth = 'meters';
yoyo.maxdepth = 'meters';
yoyo.minaltitude = 'meters';
yoyo.maxcycles = '# of cycles';
yoyo.debug = '0 to 5';

%YoyoLeicaCalibrate
yoyoleicacalibrate.name = 'yoyoleicacalibrate';
yoyoleicacalibrate.duration = 'seconds';
yoyoleicacalibrate.mindepth = 'meters';
yoyoleicacalibrate.maxdepth = 'meters';
yoyoleicacalibrate.pitchup = 'degrees';
yoyoleicacalibrate.pitchdown = 'degrees';
yoyoleicacalibrate.minaltitude = 'meters';
yoyoleicacalibrate.maxcycles = '# of cycles';
yoyoleicacalibrate.initialheading = 'degrees';
yoyoleicacalibrate.increment = 'degrees';
yoyoleicacalibrate.speedblock = [];
yoyoleicacalibrate.debug = '0 to 5';

% YoyoPitch					 
yoyopitch.name = 'yoyopitch';
yoyopitch.duration = 'seconds';
yoyopitch.mindepth = 'meters';
yoyopitch.maxdepth = 'meters';
yoyopitch.pitchup = 'degrees';
yoyopitch.pitchdown = 'degrees';
yoyopitch.minaltitude = 'meters';
yoyopitch.maxcycles = '# of cycles';
yoyopitch.debug = '0 to 5';

% create cell array
clear behaviorsOnly
s = whos;
n = {s.name};
bnames = '';
for i=1:length(n),
	eval(['bunits{i} = ' s(i).name ';']);
	bnames = strvcat(bnames,s(i).name);
end
