Skip to content
Snippets Groups Projects
  • jacques.grelet_ird.fr's avatar
    3154b55d
    uncomment and repair contextual QC menu · 3154b55d
    jacques.grelet_ird.fr authored
    % Update the radio button corresponding to the selected
    % QC context menu (rbg : RadioButtonGroup)
    radioTag     = ['TAG_QC_RADIO_' char(key)];  
    
    add zoom out after each plot_Validation
    % Draw the 3 plots of the validation figure and unzoom as the new 
    % plot keep in memory the preceding zoom
    % -----------------------------------------
    plot_Validation( hMainFig, hPlotAxes, 1, tsg.plot.parameter{1} );
    zoom out;
    plot_Validation( hMainFig, hPlotAxes, 2, tsg.plot.parameter{2} );
    zoom out;
    plot_Validation( hMainFig, hPlotAxes, 3, tsg.plot.parameter{3} );
    zoom out;
    
    correct but in plot_Validation that display wrong vertical label, plot EXT var before VAR to get the rigth vertical label as SSPS instead of SSP_EXT_2
    
    
    undo:
    disable unknow plot_SalTempVel function
    3154b55d
    History
    uncomment and repair contextual QC menu
    jacques.grelet_ird.fr authored
    % Update the radio button corresponding to the selected
    % QC context menu (rbg : RadioButtonGroup)
    radioTag     = ['TAG_QC_RADIO_' char(key)];  
    
    add zoom out after each plot_Validation
    % Draw the 3 plots of the validation figure and unzoom as the new 
    % plot keep in memory the preceding zoom
    % -----------------------------------------
    plot_Validation( hMainFig, hPlotAxes, 1, tsg.plot.parameter{1} );
    zoom out;
    plot_Validation( hMainFig, hPlotAxes, 2, tsg.plot.parameter{2} );
    zoom out;
    plot_Validation( hMainFig, hPlotAxes, 3, tsg.plot.parameter{3} );
    zoom out;
    
    correct but in plot_Validation that display wrong vertical label, plot EXT var before VAR to get the rigth vertical label as SSPS instead of SSP_EXT_2
    
    
    undo:
    disable unknow plot_SalTempVel function
plot_Validation.m 3.27 KiB
function plot_Validation( hMainFig, hPlotAxes, nPlot, PARA )
% 
% $Id$

% Get tsg application data
% ------------------------
tsg    = getappdata( hMainFig, 'tsg_data');
SAMPLE = tsg.plot.sample;

% get lineType from popupmenu cell string
% ---------------------------------------
lineType = ...
  tsg.preference.plot_connected_string{tsg.preference.plot_connected_value};

switch nPlot
  
  % ---------------------------------------------------------------------
  case 1
    
    % erase all plpot with 'Tag'= ['TAG_PLOT' num2str(PlotNum) '_LINE_']
    % ------------------------------------------------------------------
    erase_Line( hPlotAxes, 1 );
    
    % if there is external data to plot
    % ---------------------------------
    if isfield(tsg,[SAMPLE '_EXT_TYPE']) && isfield(tsg,[SAMPLE '_EXT']) && ~isempty( tsg.([SAMPLE '_EXT']) )
      
      % Plot squares for WS data
      % -----------------------
      ind   = 1: length( tsg.([SAMPLE '_EXT']));
      indWS = strmatch( 'WS', tsg.([SAMPLE '_EXT_TYPE']), 'exact');
      if ~isempty(ind)
        plot_Tsg( hMainFig, hPlotAxes, 1,...
          tsg.DAYD_EXT(indWS), tsg.([SAMPLE '_EXT'])(indWS),...
          tsg.([SAMPLE '_EXT_QC'])(indWS), ...
          [SAMPLE '_EXT_1'], '', 'none', 'square', 5);
      end
      
      % Plot circles for CTD, ARGO, etc. data
      % -------------------------------------
      indEXT = setxor(ind, indWS);
      if ~isempty(indEXT)
        plot_Tsg( hMainFig, hPlotAxes, 1, tsg.DAYD_EXT(indEXT),...
          tsg.([SAMPLE '_EXT'])(indEXT),...
          tsg.([SAMPLE '_EXT_QC'])(indEXT),...
          [SAMPLE '_EXT_2'], '', 'none', 'o', 5);
      end
    end
    
    % if there is data to plot
    % ------------------------
    if ~isempty( tsg.(PARA) )
      
      % if lineType is selected from menu option/preferences and ne 'none'
      % -----------------------------------------------------------------
      if ~strcmp(lineType, 'none')
        
        % just plot data line and without QC & marker in black in first plot
        % -----------------------------------------------------------------
        plot_Tsg( hMainFig, hPlotAxes, 1, tsg.DAYD, tsg.(PARA), [],...
                  PARA, 'k', lineType, 'none', 1);
      end

      % plot data data with QC color
      % ----------------------------
      plot_Tsg( hMainFig, hPlotAxes, 1, tsg.DAYD, tsg.(PARA), ...
                tsg.([PARA '_QC']), PARA, '', 'none', '*', 2);
     
    end
  % ---------------------------------------------------------------------
  case 2
    
    erase_Line( hPlotAxes, 2 );
    if ~isempty( tsg.(PARA) )
%       if ~isempty( tsg.([PARA '_QC']) )
        plot_Tsg( hMainFig, hPlotAxes, 2, tsg.DAYD, tsg.(PARA),...
                  tsg.([PARA '_QC']), PARA,'', lineType, '*', 2);
%       else
%         plot_Tsg( hMainFig, hPlotAxes, 2, tsg.DAYD, tsg.(PARA),...
%                   [],PARA,'k','none','*',2);
%       end
    end
    
  % ---------------------------------------------------------------------
  case 3
    erase_Line( hPlotAxes, 3 );
%    if ~isempty( tsg.(PARA) )
      plot_Tsg( hMainFig, hPlotAxes, 3, tsg.DAYD, tsg.(PARA),[],...
                PARA, '', lineType, '*', 2);
 %   end
end

axesCommonProp( hPlotAxes );

end