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

ajout de tsg_util/updateTsgStructWithCalCoeff.m

parent 0f33ccec
No related branches found
No related tags found
No related merge requests found
function updateTsgStructWithCalCoeff(hMainFig)
%
% This function is called after change option/parameter calibrations coeff
% type or when initialize tsgStruct
%
% Input
% -----
% hMainFig ............ Handle to the main user interface
%
% $Id$
% Get the data from the application GUI
% -------------------------------------
tsg = getappdata( hMainFig, 'tsg_data');
% define coefficients variables
% -----------------------------
var = {'SSJT_CALCOEF', 'CNDC_CALCOEF', 'SSTP_CALCOEF'};
% define coefficients names
% -------------------------
coeff_type = {{'DATE','A','B','C','D','F0',''},{'DATE','A','B','C','D','M','CPCOR'},...
{'DATE','A','B','C','D','F0',''}; ...
{'DATE','G','H','I','J','F0',''},{'DATE','G','H','I','J','CTCOR','CPCOR'},...
{'DATE','G','H','I','J','F0',''}};
% get preference choice for cabrations type popup
% -----------------------------------------------
pref = tsg.preference.coeff_type_value;
% dynamically fill variables
% --------------------------
for i = 1:numel(var)
if isempty(tsg.(var{i}))
for j = 1:tsg.dim.CALCOEF
tsg.(var{i})(j) = NaN;
tsg.([var{i} '_CONV']) = ...
[tsg.([var{i} '_CONV']); padding(coeff_type{pref,i}{j}, tsg.dim.COEF_CONV_SIZE)];
end
elseif isnan(tsg.(var{i}))
tsg.([var{i} '_CONV']) = [];
for j = 1:tsg.dim.CALCOEF
tsg.(var{i})(j) = NaN;
tsg.([var{i} '_CONV']) = ...
[tsg.([var{i} '_CONV']); padding(coeff_type{pref,i}{j}, tsg.dim.COEF_CONV_SIZE)];
end
end
end
% Save tsg structure
% ------------------
setappdata( hMainFig, 'tsg_data', tsg);
end
\ No newline at end of file
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