function minPressQC(hMainFig)
%
% This function is called after option/preferences menu has been activated
% and flag salinity data where PRESS < min as BAD if test is on
%
% Input
% -----
% hMainFig ............ Handle to the main user interface
%

% Get the data from the application GUI
% -------------------------------------
tsg = getappdata( hMainFig, 'tsg_data');

% Get BAD code value
% ----------------------
badCode = tsg.qc.hash.BAD.code;

press_min = tsg.preference.press_min_string;

% If necessary replace a comma by a point
% ---------------------------------------
press_min = regexprep(press_min, ',', '.');

% If bias not a numeric, str2double return a NaN
% ----------------------------------------------
press_min = str2double( press_min );

if isnumeric( press_min ) && ~isnan( press_min )

  % Set salinity QC to BAD for flow < flow_min
  % -----------------------------------------------------
  ind = find(tsg.PRESS < press_min);
  if ~isempty( ind )
    tsg.PRESS_QC(ind) = castByteQC( badCode, ind );
  end

  % Save tsg structure
  % ------------------
  setappdata( hMainFig, 'tsg_data', tsg);
  
else
  
  msgbox('Enter a numeric value in the REFERENCE menu', 'Press QC',...
         'error', 'modal');

end

end
