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

maj de DATE_UPDATE, passe tsg.DATA_ACQUISITION et tsg.PROCESSING_CENTRE en...

maj de DATE_UPDATE, passe tsg.DATA_ACQUISITION et tsg.PROCESSING_CENTRE en popupmenu, utilisation de deblank pour supprimer les espaces dans les chaines de char des popupmenus
parent 3731a570
No related branches found
No related tags found
No related merge requests found
...@@ -31,4 +31,4 @@ integer;char;char;char;char;char;integer;integer;integer;char;char; ...@@ -31,4 +31,4 @@ integer;char;char;char;char;char;integer;integer;integer;char;char;
26;DATA_CENTRE;DATA CENTRE:;;edit;;;;;right;Code for data center (2 char); 26;DATA_CENTRE;DATA CENTRE:;;edit;;;;;right;Code for data center (2 char);
27;DATA_ACQUISITION;DATA ACQUISITION:;;popupmenu;IRD|GENAVIR|SHOM|CNRS;1;.1;.02;right;Acquisition data centre, ex: SHOM,IRD,GENAVIR,CNRS,...; 27;DATA_ACQUISITION;DATA ACQUISITION:;;popupmenu;IRD|GENAVIR|SHOM|CNRS;1;.1;.02;right;Acquisition data centre, ex: SHOM,IRD,GENAVIR,CNRS,...;
28;PROCESSING_CENTRE;PROCESSING CENTRE:;;popupmenu;ORE-SSS|CORIOLIS/IRD|CORIOLIS/SISMER;1;.1;.02;right;Processing data centre, ex: ORE-SSS,CORIOLIS,SISMER,...; 28;PROCESSING_CENTRE;PROCESSING CENTRE:;;popupmenu;ORE-SSS|CORIOLIS/IRD|CORIOLIS/SISMER;1;.1;.02;right;Processing data centre, ex: ORE-SSS,CORIOLIS,SISMER,...;
29;PROCESSING_STATES;PROCESSING STATES:;;edit;;;;;right;Need to be defined, IRD action,...; 29;PROCESSING_STATES;PROCESSING STATES:;;popupmenu;0A|1A|2B|2B+|2C|2C+|3B;1;.1;.02;right;0A: DONNEE BRUTE|1A: DONNEE LOCALISEE;
...@@ -28,6 +28,9 @@ inc_y = 0.03; ...@@ -28,6 +28,9 @@ inc_y = 0.03;
default_height = 0.018; default_height = 0.018;
default_length = .1; default_length = .1;
% get actual date
% ---------------
date = datestr(now,30);
% Get global attributes list from class tsg_nc with file 'tsg_ncattr.csv' % Get global attributes list from class tsg_nc with file 'tsg_ncattr.csv'
% ----------------------------------------------------------------------- % -----------------------------------------------------------------------
...@@ -55,19 +58,29 @@ hHeaderFig = figure(... ...@@ -55,19 +58,29 @@ hHeaderFig = figure(...
% Display fields from class % Display fields from class
% ------------------------- % -------------------------
for i=1:numel(nca_keys) for i=1:numel(nca_keys)
% get key, use {} for cell % get key, use {} for cell
% ------------------------
key = nca_keys{i}; key = nca_keys{i};
% get all structure for the key % get all structure for the key
% -----------------------------
s = get(nca, key); s = get(nca, key);
% set tsg.DATE_UPDATE
% -------------------
if strcmp(key, 'DATE_UPDATE')
tsg.(key) = [date(1:8) date(10:15)];
end
% check for empty field and replace them by default value % check for empty field and replace them by default value
% ------------------------------------------------------- % -------------------------------------------------------
if isempty(s.length), s.length = default_length; end; if isempty(s.length), s.length = default_length; end;
if isempty(s.height), s.height = default_height; end; if isempty(s.height), s.height = default_height; end;
% display dynamic uicontrol text % display dynamically uicontrol text
% use of char function prevent error when field is empty [] => '' % use of char function to prevent error when field is empty [] => ''
% --------------------------------------------------------------- % ------------------------------------------------------------------
uicontrol(... uicontrol(...
'Parent', hHeaderFig, ... 'Parent', hHeaderFig, ...
'Units', 'normalized', ... 'Units', 'normalized', ...
...@@ -103,8 +116,8 @@ for i=1:numel(nca_keys) ...@@ -103,8 +116,8 @@ for i=1:numel(nca_keys)
'Position',[left+.22, bottom, .1, s.height], ... 'Position',[left+.22, bottom, .1, s.height], ...
'String', char(s.conventions) ); 'String', char(s.conventions) );
% set dynamically uicontrol % set dynamically uicontrol from tsg struct
% ------------------------- % -----------------------------------------
switch s.uicontrolType switch s.uicontrolType
case 'popupmenu' case 'popupmenu'
str = cellstr(get(ui,'String')); str = cellstr(get(ui,'String'));
...@@ -207,15 +220,16 @@ uiwait(hHeaderFig); ...@@ -207,15 +220,16 @@ uiwait(hHeaderFig);
tsg.PROCESSING_CENTRE = get(data.PROCESSING_CENTRE, 'string'); tsg.PROCESSING_CENTRE = get(data.PROCESSING_CENTRE, 'string');
tsg.PROCESSING_STATES = get(data.PROCESSING_STATES, 'string'); tsg.PROCESSING_STATES = get(data.PROCESSING_STATES, 'string');
% for popupmenu only % for popupmenu only, deblank remove all trailling whitespace char
% ------------------ % ----------------------------------------------------------------
tsg.TSG_TYPE = tsg.TSG_TYPE(get(data.TSG_TYPE, 'value'),:); tsg.TSG_TYPE = deblank(tsg.TSG_TYPE(get(data.TSG_TYPE, 'value'),:));
tsg.TINT_TYPE = tsg.TINT_TYPE(get(data.TINT_TYPE, 'value'),:); tsg.TINT_TYPE = deblank(tsg.TINT_TYPE(get(data.TINT_TYPE, 'value'),:));
tsg.DATA_MODE = tsg.DATA_MODE(get(data.DATA_MODE, 'value'),:); tsg.DATA_MODE = deblank(tsg.DATA_MODE(get(data.DATA_MODE, 'value'),:));
tsg.PI_NAME = tsg.PI_NAME(get(data.PI_NAME, 'value'),:); tsg.PI_NAME = deblank(tsg.PI_NAME(get(data.PI_NAME, 'value'),:));
tsg.DATA_ACQUISITION = tsg.DATA_ACQUISITION(get(data.DATA_ACQUISITION, 'value'),:); tsg.DATA_ACQUISITION = deblank(tsg.DATA_ACQUISITION(get(data.DATA_ACQUISITION, 'value'),:));
tsg.PROCESSING_CENTRE = tsg.PROCESSING_CENTRE(get(data.PROCESSING_CENTRE, 'value'),:); tsg.PROCESSING_CENTRE = deblank(tsg.PROCESSING_CENTRE(get(data.PROCESSING_CENTRE, 'value'),:));
tsg.PROCESSING_STATES = deblank(tsg.PROCESSING_STATES(get(data.PROCESSING_STATES, 'value'),:));
% Save tsg structure % Save tsg structure
% ------------------ % ------------------
setappdata( hTsgGUI, 'tsg_data', tsg); setappdata( hTsgGUI, 'tsg_data', tsg);
......
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