Skip to content
Snippets Groups Projects
Commit 1d4fb346 authored by jacques.grelet_ird.fr's avatar jacques.grelet_ird.fr
Browse files

patch gael Alory du 14 avril

parent b57bef8d
No related branches found
No related tags found
No related merge requests found
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
%
% Get the data from the application GUI
% -------------------------------------
tsg = getappdata( hMainFig, 'tsg_data');
% Get HARBOUR code value
% ----------------------
harbourCode = tsg.qc.hash.HARBOUR.code;
% get preference choice for ship speed test
% -----------------------------------------
test = tsg.preference.ship_speed_test;
if (test==2)
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));
% 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
end
% Save tsg structure
% ------------------
setappdata( hMainFig, 'tsg_data', tsg);
end
...@@ -108,6 +108,70 @@ if bottom < .1 ...@@ -108,6 +108,70 @@ if bottom < .1
left = left + inc_x; left = left + inc_x;
end end
% display ship speed test text
% ----------------------------
uicontrol(...
'Parent', hPreferencesFig, ...
'Units', 'normalized', ...
'Style', 'Text', ...
'Fontsize', tsg.fontSize-1, ...
'HorizontalAlignment', 'left', ...
'Position',[left, bottom, length, height], ...
'TooltipString', 'enable/disable ship speed test', ...
'String', 'Ship Speed Test');
% display ship speed test uicontrol
% ---------------------------------
uicontrol(...
'Parent', hPreferencesFig, ...
'Units', 'normalized', ...
'BackgroundColor', 'w', ...
'Style', 'popupmenu', ...
'Fontsize', tsg.fontSize-2, ...
'HorizontalAlignment', 'right', ...
'Position', [left + length, bottom, length, height], ...
'String', tsg.preference.ship_speed_test_string, ...
'Value', tsg.preference.ship_speed_test, ...
'Tag', 'PREFERENCES_SHIP_SPEED_TEST');
bottom = bottom - inc_y - height;
if bottom < .1
bottom = 0.95;
left = left + inc_x;
end
% display ship speed min text
% -----------------------------
uicontrol(...
'Parent', hPreferencesFig, ...
'Units', 'normalized', ...
'Style', 'Text', ...
'Fontsize', tsg.fontSize-1, ...
'HorizontalAlignment', 'left', ...
'Position',[left, bottom, length, height], ...
'TooltipString', 'select ship speed min (knots)', ...
'String', 'Ship Speed Min');
% display ship speed min uicontrol
% --------------------------------
uicontrol(...
'Parent', hPreferencesFig, ...
'Units', 'normalized', ...
'BackgroundColor', 'w', ...
'Style', 'popupmenu', ...
'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');
bottom = bottom - inc_y - height;
if bottom < .1
bottom = 0.95;
left = left + inc_x;
end
% display connected line text % display connected line text
% ------------------------- % -------------------------
uicontrol(... uicontrol(...
...@@ -152,8 +216,8 @@ if bottom < .1 ...@@ -152,8 +216,8 @@ if bottom < .1
left = left + inc_x; left = left + inc_x;
end end
% display connected line text % display coefficient type text
% ------------------------- % -----------------------------
uicontrol(... uicontrol(...
'Parent', hPreferencesFig, ... 'Parent', hPreferencesFig, ...
'Units', 'normalized', ... 'Units', 'normalized', ...
...@@ -164,8 +228,8 @@ uicontrol(... ...@@ -164,8 +228,8 @@ uicontrol(...
'TooltipString', 'select coefficients type', ... 'TooltipString', 'select coefficients type', ...
'String', 'Coefficients type'); 'String', 'Coefficients type');
% display connected line uicontrol % display coefficient type uicontrol
% -------------------------------- % ----------------------------------
uicontrol(... uicontrol(...
'Parent', hPreferencesFig, ... 'Parent', hPreferencesFig, ...
'Units', 'normalized', ... 'Units', 'normalized', ...
...@@ -244,6 +308,10 @@ uiwait(hPreferencesFig); ...@@ -244,6 +308,10 @@ uiwait(hPreferencesFig);
get(prefs.PREFERENCES_LEVITUS_VALUE, 'value'); get(prefs.PREFERENCES_LEVITUS_VALUE, 'value');
tsg.preference.levitus_depth_value = ... tsg.preference.levitus_depth_value = ...
get(prefs.PREFERENCES_LEVITUS_DEPTH, 'value'); get(prefs.PREFERENCES_LEVITUS_DEPTH, 'value');
tsg.preference.ship_speed_test = ...
get(prefs.PREFERENCES_SHIP_SPEED_TEST, 'value');
tsg.preference.ship_speed_min = ...
get(prefs.PREFERENCES_SHIP_SPEED_MIN, 'value');
tsg.preference.plot_connected_value = ... tsg.preference.plot_connected_value = ...
get(prefs.PREFERENCES_PLOT_CONNECTED_LINE, 'value'); get(prefs.PREFERENCES_PLOT_CONNECTED_LINE, 'value');
tsg.preference.coeff_type_value = ... tsg.preference.coeff_type_value = ...
...@@ -257,7 +325,11 @@ uiwait(hPreferencesFig); ...@@ -257,7 +325,11 @@ uiwait(hPreferencesFig);
% ------------------------------ % ------------------------------
updateTsgStructWithCalCoeff(hTsgGUI); updateTsgStructWithCalCoeff(hTsgGUI);
% apply ship speed QC
% -------------------
minSpeedQC(hTsgGUI);
% close windows (replace call to uiresume(hHeaderFig)) % close windows (replace call to uiresume(hHeaderFig))
% ---------------------------------------------------- % ----------------------------------------------------
close(hPreferencesFig); close(hPreferencesFig);
......
...@@ -135,7 +135,10 @@ end ...@@ -135,7 +135,10 @@ end
preference.levitus_value = 2; % WOA05 preference.levitus_value = 2; % WOA05
preference.levitus_depth_string = {'0','10'}; preference.levitus_depth_string = {'0','10'};
preference.levitus_depth_value = 1; preference.levitus_depth_value = 1;
preference.ship_speed = 1; preference.ship_speed_test_string= {'none','automatic'};
preference.ship_speed_test = 1; % no test on ship speed
preference.ship_speed_min_string = {'1','3','5'};
preference.ship_speed_min = 1;
preference.plot_connected_string = {'none', '-', '--', ':', '-.'}; preference.plot_connected_string = {'none', '-', '--', ':', '-.'};
preference.plot_connected_value = 1; % 0, line not connected preference.plot_connected_value = 1; % 0, line not connected
preference.coeff_type_string = {'use A-D', 'use G-J'}; preference.coeff_type_string = {'use A-D', 'use G-J'};
......
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