Skip to content
Snippets Groups Projects
Commit 24981b34 authored by Yves Gouriou's avatar Yves Gouriou
Browse files

La valeur du test de vitesse se fait maintenant via un uicontrol EDIT dans le menu PREFERENCE

parent 71a67336
No related branches found
No related tags found
No related merge requests found
......@@ -9,8 +9,6 @@ function minSpeedQC(hMainFig)
%
% problem: the QC flag counter in 'Validation Codes' window
% is not updated after the test is applied
%
% Get the data from the application GUI
% -------------------------------------
......@@ -20,27 +18,33 @@ tsg = getappdata( hMainFig, 'tsg_data');
% ----------------------
harbourCode = tsg.qc.hash.HARBOUR.code;
% get preference choice for ship speed test
% -----------------------------------------
test = tsg.preference.ship_speed_test;
speed_min = tsg.preference.ship_speed_min_string;
if (test==2)
% If necessary replace a comma by a point
% ---------------------------------------
speed_min = regexprep(speed_min, ',', '.');
speed_min_string = tsg.preference.ship_speed_min_string;
speed_min_choice = tsg.preference.ship_speed_min;
speed_min=str2double(speed_min_string(speed_min_choice));
% If bias not a numeric, str2double return a NaN
% ----------------------------------------------
speed_min = str2double( speed_min );
% Set salinity QC to HARBOUR for ship speed < speed_min
% -----------------------------------------------------
ind = find(tsg.SPDC < speed_min);
if ~isempty( ind )
tsg.SSPS_QC(ind) = castByteQC( harbourCode, ind );
end
if isnumeric( speed_min ) && ~isnan( speed_min )
end
% 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);
% Save tsg structure
% ------------------
setappdata( hMainFig, 'tsg_data', tsg);
else
msgbox('Enter a numeric value in the REFERENCE menu', 'Speed QC',...
'error', 'modal');
end
end
......@@ -271,25 +271,20 @@ end
uicontrol(...
'Parent', hPreferencesFig, ...
'Units', 'normalized', ...
'Style', 'Text', ...
'Fontsize', tsg.fontSize-1, ...
'HorizontalAlignment', 'left', ...
'Style', 'Text','Fontsize', tsg.fontSize-1,'HorizontalAlignment', 'left', ...
'Position',[left, bottom, length, height], ...
'TooltipString', 'select ship speed min (knots)', ...
'TooltipString', 'Select ship speed min (knots)', ...
'String', 'Ship Speed Min (knots)');
% display ship speed min uicontrol
% --------------------------------
uicontrol(...
'Parent', hPreferencesFig, ...
'Units', 'normalized', ...
'BackgroundColor', 'w', ...
'Style', 'popupmenu', ...
'Fontsize', tsg.fontSize-2, ...
'HorizontalAlignment', 'right', ...
'Units', 'normalized', 'Style', 'Edit', 'BackgroundColor', 'w', ...
'Fontsize', tsg.fontSize-2, 'HorizontalAlignment', 'right', ...
'Position', [left + length, bottom, length, height], ...
'String', tsg.preference.ship_speed_min_string, ...
'Value', tsg.preference.ship_speed_min, 'Tag', 'PREFERENCES_SHIP_SPEED_MIN');
'Tag', 'PREFERENCES_SHIP_SPEED_MIN');
bottom = bottom - inc_y - height;
if bottom < .1
......@@ -519,8 +514,8 @@ uiwait(hPreferencesFig);
get(prefs.PREFERENCES_FLOW_MIN, 'string');
tsg.preference.press_min_string = ...
get(prefs.PREFERENCES_PRESS_MIN, 'string');
tsg.preference.ship_speed_min = ...
get(prefs.PREFERENCES_SHIP_SPEED_MIN, 'value');
tsg.preference.ship_speed_min_string = ...
get(prefs.PREFERENCES_SHIP_SPEED_MIN, 'string');
tsg.preference.ssps_min_string = ...
get(prefs.PREFERENCES_SSPS_MIN, 'string');
tsg.preference.ssps_max_string = ...
......
......@@ -146,8 +146,7 @@ end
% QC test
preference.flow_min_string = {'1'};
preference.press_min_string = {'1'};
preference.ship_speed_min_string = {'1','3','5'};
preference.ship_speed_min = 1;
preference.ship_speed_min_string = {'1'};
preference.ssps_min_string = {'0'};
preference.ssps_max_string = {'50'};
preference.sstp_min_string = {'-3'};
......
......@@ -36,8 +36,8 @@ global NETCDF_FORMAT_VERSION
% version number, may be used to initialize some files when it change
% 0.90x -> 1.0RCx
% -------------------------------------------------------------------
VERSION = 1.02; % -> 1.02
CHAR_VERSION = '1.02';
VERSION = 1.03; % -> 1.03
CHAR_VERSION = '1.03';
% netcdf file version, see DATA FORMAT TSG document:
% CORTSG_format_gosud_1.5.doc
......@@ -276,7 +276,7 @@ hQCMenu = uimenu(...
'Label', 'QCauto');
hFlowMenu = uimenu(...
'Parent', hQCMenu, 'Label','Flow', 'HandleVisibility', handleVisibility,...
'UserData', 'off','Enable', 'off','Callback', {@QCMenuCallback,'Flow'});
'UserData', 'off', 'Callback', {@QCMenuCallback,'Flow'});
hPressMenu = uimenu(...
'Parent', hQCMenu, 'Label','Press', 'HandleVisibility', handleVisibility,...
'UserData', 'off', 'Callback', {@QCMenuCallback,'Press'});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment