function minSpeedQC(hMainFig) % % This function is called after option/preferences menu has been activated % and flag salinity data where ship speed < min as HARBOUR if test is on % % Input % ----- % hMainFig ............ Handle to the main user interface % % problem: the QC flag counter in 'Validation Codes' window % is not updated after the test is applied % % $Id$ % Get the data from the application GUI % ------------------------------------- tsg = getappdata( hMainFig, 'tsg_data'); % Get HARBOUR code value % ---------------------- harbourCode = tsg.qc.hash.HARBOUR.code; speed_min = tsg.preference.ship_speed_min_string; % If necessary replace a comma by a point % --------------------------------------- speed_min = regexprep(speed_min, ',', '.'); % If bias not a numeric, str2double return a NaN % ---------------------------------------------- speed_min = str2double( speed_min ); if isnumeric( speed_min ) && ~isnan( speed_min ) % Set salinity QC to BAD for flow < flow_min % ----------------------------------------------------- ind = find(tsg.SPDC < speed_min); if ~isempty( ind ) tsg.SSPS_QC(ind) = castByteQC( harbourCode, ind ); end % Save tsg structure % ------------------ setappdata( hMainFig, 'tsg_data', tsg); else msgbox('Enter a numeric value in the REFERENCE menu', 'Speed QC',... 'error', 'modal'); end end