From 0f33ccecaf4732d853ff4f4ba52c72240773b06d Mon Sep 17 00:00:00 2001 From: Jacques Grelet <jacques.grelet@ird.fr> Date: Tue, 3 Mar 2009 13:38:55 +0000 Subject: [PATCH] =?UTF-8?q?change=20l'intitul=C3=A9=20du=20masque=20des=20?= =?UTF-8?q?coefficients=20change=20le=20popup=20coefficients=20type=20dans?= =?UTF-8?q?=20=20menu=20option/preference=20avec=20use=20A-D=20et=20use=20?= =?UTF-8?q?G-J=20le=20choix=20de=20ce=20popup=20est=20pris=20en=20compte?= =?UTF-8?q?=20lors=20de=20la=20generation=20d'un=20masque=20de=20coeff=20v?= =?UTF-8?q?ide?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tsg_util/headerForm.m | 2 +- tsg_util/preferencesForm.m | 19 +++++++++------ tsg_util/tsg_preferences.m | 2 +- tsg_util/updateTsgStruct.m | 49 +++++++++++--------------------------- tsgqc.m | 4 ++-- 5 files changed, 30 insertions(+), 46 deletions(-) diff --git a/tsg_util/headerForm.m b/tsg_util/headerForm.m index c46b6ad..4b99fd9 100644 --- a/tsg_util/headerForm.m +++ b/tsg_util/headerForm.m @@ -78,7 +78,7 @@ platform_info = tsg_nc('tsg_platform.csv'); % --------------------------------- hHeaderFig = figure(... 'BackingStore','off',... - 'Name', 'TSG GLOBAL ATTRIBUTES', ... + 'Name', 'TSG GLOBAL ATTRIBUTES AND VARIABLES', ... 'NumberTitle', 'off', ... 'Resize', 'on', ... 'Menubar','none', ... diff --git a/tsg_util/preferencesForm.m b/tsg_util/preferencesForm.m index 5cb8a66..b9370e6 100644 --- a/tsg_util/preferencesForm.m +++ b/tsg_util/preferencesForm.m @@ -236,22 +236,27 @@ uiwait(hPreferencesFig); % Save tsg structure % ------------------ setappdata(hTsgGUI, 'tsg_data', tsg); - + % get the corresponding string from uicontrol using guihandles % and save value in tsg.preferences struct % ------------------------------------------------------------ tsg.preference.levitus_value = ... - get(prefs.PREFERENCES_LEVITUS_VALUE, 'value'); + get(prefs.PREFERENCES_LEVITUS_VALUE, 'value'); tsg.preference.levitus_depth_value = ... - get(prefs.PREFERENCES_LEVITUS_DEPTH, 'value'); + get(prefs.PREFERENCES_LEVITUS_DEPTH, '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 = ... - get(prefs.PREFERENCES_COEFF_TYPE, 'value'); - + get(prefs.PREFERENCES_COEFF_TYPE, 'value'); + % Save tsg structure % ------------------ setappdata(hTsgGUI, 'tsg_data', tsg); + + % fill tsg calibration variables + % ------------------------------ + updateTsgStructWithCalCoeff(hTsgGUI); + % close windows (replace call to uiresume(hHeaderFig)) % ---------------------------------------------------- @@ -264,7 +269,7 @@ uiwait(hPreferencesFig); % return with no error code (true) % -------------------------------- error = 1; - + return end diff --git a/tsg_util/tsg_preferences.m b/tsg_util/tsg_preferences.m index e1fbd87..8d3e695 100644 --- a/tsg_util/tsg_preferences.m +++ b/tsg_util/tsg_preferences.m @@ -138,7 +138,7 @@ end preference.ship_speed = 1; preference.plot_connected_string = {'none', '-', '--', ':', '-.'}; preference.plot_connected_value = 1; % 0, line not connected - preference.coeff_type_string = {'a,b,c,d,f0', 'g,h,i,k,m'}; + preference.coeff_type_string = {'use A-D', 'use G-J'}; preference.coeff_type_value = 2; % save preference struct to 'prefdir.mat' file diff --git a/tsg_util/updateTsgStruct.m b/tsg_util/updateTsgStruct.m index 320d3d1..9544a1d 100644 --- a/tsg_util/updateTsgStruct.m +++ b/tsg_util/updateTsgStruct.m @@ -86,30 +86,24 @@ for i = 1: length(names) end end -% initialise empty coefficients variables with type defined with preference -% ------------------------------------------------------------------------- -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',''}}; -lin_type = {'offset','slope'}; -lin_val = [0,1]; - -var = {'SSJT_CALCOEF', 'CNDC_CALCOEF', 'SSTP_CALCOEF'}; +% Save tsg structure +% ------------------ +setappdata( hMainFig, 'tsg_data', tsg); -pref = tsg.preference.coeff_type_value; +% fill tsg calibration variables +% ------------------------------ +updateTsgStructWithCalCoeff(hMainFig); -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 - end -end +% Get the data from the application GUI +% ------------------------------------- +tsg = getappdata( hMainFig, 'tsg_data'); +% Initialise 'variables_LINCOEF' +% in tsg_initialisation now +% ------------------------------- var ={'SSJT_LINCOEF', 'CNDC_LINCOEF', 'SSTP_LINCOEF'}; +lin_type = {'offset','slope'}; +lin_val = [0,1]; for i = 1:numel(var) if isempty(tsg.(var{i})) @@ -121,21 +115,6 @@ for i = 1:numel(var) end end -% Initialise 'variables_LINCOEF' -% in tsg_initialisation now -% ------------------------------- -% if isempty(tsg.SSJT_LINCOEF) -% tsg.SSJT_LINCOEF(1) = 1; -% tsg.SSJT_LINCOEF(2) = 0; -% end -% if isempty(tsg.CNDC_LINCOEF) -% tsg.CNDC_LINCOEF(1) = 1; -% tsg.CNDC_LINCOEF(2) = 0; -% end -% if isempty(tsg.SSTP_LINCOEF) -% tsg.SSTP_LINCOEF(1) = 1; -% tsg.SSTP_LINCOEF(2) = 0; -% end % Save tsg structure % ------------------ diff --git a/tsgqc.m b/tsgqc.m index 8105d0e..f29e855 100644 --- a/tsgqc.m +++ b/tsgqc.m @@ -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 = 0.9054; % -> 1.0RC5 -CHAR_VERSION = '1.0RC5_4'; +VERSION = 0.9055; % -> 1.0RC5 +CHAR_VERSION = '1.0RC5_5'; % netcdf file version, see DATA FORMAT TSG document: % CORTSG_format_gosud_1.5.doc -- GitLab