%
% PURPOSE: Plot measured (azimuth) angle to transponder, and other relevant
%          docking data.
%
% LOG:     Feb 25 2019, rsm initial.
%
lstr={};
if exist( 'position' ) ~= 1
  MonitorPositions = get(0,'MonitorPositions');
  position = MonitorPositions(end,:);
  npposition(1:2) = position(1:2) + round([position(3)*.02 position(4)*.04]);
  npposition(3:4) = round([position(3)*.95 position(4)*.90]);
  position = npposition;
end
if exist( 'lrAzFigPtr' ) ~= 1
  lrAzFigPtr= figure;
  set( lrAzFigPtr, 'Name', 'LR Azimuth', 'DeleteFcn', 'clear lrAzFigPtr' );
  set(gcf,'position',position)
  if(exist('fontsize')) 
    lrAzFontsize=fontsize;
  else
    lrAzFontsize=20;
  end
  lrAzFontweight='normal';
  set(gca,'fontsize',lrAzFontsize,'fontweigh',lrAzFontweight)
  set(gcf,'defaultaxesfontsize',lrAzFontsize,'defaulttextfontsize', ...
      lrAzFontsize)
else
  figure(lrAzFigPtr);
end
lrAzAxesPtr = gca;

%subplot(4,1,1)
if( exist('data') && isfield( data.DAT, 'azimuth_vehicleCoordinates' ) )
  %DAT usbl
  plot(DAT.azimuth_vehicleCoordinates.time, DAT.azimuth_vehicleCoordinates.value,'bx');
  grid on
  dynamicDateTicks
  hold on;
  rhand=plot(DAT.homing_target_range.time, DAT.homing_target_range.value,'gx');
  dhand=plot(depth.time, -depth.value*10,'r');
  hhand=plot(platform_orientation.time, platform_orientation.value*180/pi,'m')
  legend('Azimuth, Deg','Range, m','Depth, m/10','Heading, Deg');
  set(lrAzAxesPtr,'ylim',[-180 180])
elseif(exist('data') && isfield(data,'acoustic_contact_range') )
  %Whoi line-array usbl
  plot(data.TrackAcousticContact.azimuth_to_contact_vehicle_frame.time, ...
       data.TrackAcousticContact.azimuth_to_contact_vehicle_frame.value*180/pi,'b-x','linewidth',2);
  grid on
  dynamicDateTicks
  hold on;
  rhand=plot(data.acoustic_contact_range.time, data.acoustic_contact_range.value,'g-x','linewidth',2);
  dhand=plot(data.depth.time, data.depth.value,'r');
  hhand=plot(data.platform_orientation.time, data.platform_orientation.value*180/pi,'m');
  legend('Azimuth, Deg','Range, m','Depth, m','Heading, Deg');
  %set(lrAzAxesPtr,'ylim',[-180 180])
end
  
str='201306061439 201306062133';
title(str)
