Changeset 361 for trunk


Ignore:
Timestamp:
Jan 9, 2012, 8:26:06 AM (13 years ago)
Author:
sommeria
Message:

fill_GUI debugged: civ can open the xml file of a previous operation (instead of opening the saved GUI figure)

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/fill_GUI.m

    r360 r361  
    77for ifield=1:numel(fields)
    88    if isstruct(Param.(fields{ifield}))
    9         fields{ifield}
    109        if isfield(handles,fields{ifield})
    11         errormsg=fill_GUI(Param.(fields{ifield}),get(handles.(fields{ifield}),'children'));
     10            set(handles.(fields{ifield}),'Visible','on')
     11            children=get(handles.(fields{ifield}),'children');
     12            for ichild=1:numel(children)
     13                hchild.(get(children(ichild),'tag'))=children(ichild);
     14            end
     15            errormsg=fill_GUI(Param.(fields{ifield}),hchild);
    1216        end
    1317    else
    14         fields{ifield}
    15         num2str(Param.(fields{ifield}))
    16         if isnumeric(Param.(fields{ifield}))
    17             if isfield(handles,['num_' fields{ifield}])
    18             set(handles.(['num_' fields{ifield}]),'String',num2str(Param.(fields{ifield})))
     18        hh=[];
     19        if isfield(handles,fields{ifield})
     20            hh=handles.(fields{ifield});
     21            if strcmp(get(hh,'Type'),'uitable')
     22                set(hh,'Data',input)
     23                break
    1924            end
    20         else
    21             if isfield(handles,fields{ifield})
    22             set(handles.(fields{ifield}),'String',num2str(Param.(fields{ifield})))
     25        elseif isnumeric(input) && isfield(handles,['num_' fields{ifield}])
     26            hh=handles.(['num_' fields{ifield}]);
     27        end
     28        if ~isempty(hh)
     29            set(hh,'Visible','on')
     30            switch get(hh,'style')
     31                case {'checkbox','pushbutton','radiobutton','togglebutton'}
     32                    if isnumeric(input)
     33                        set(hh,'Value',input)
     34                    end
     35                case 'edit'
     36                    if isnumeric(input)
     37                        input=num2str(input);
     38                    end
     39                    set(hh,'String',input)
     40                case{'Listbox','popupmenu'}
     41                    if isnumeric(input)
     42                        input=num2str(input);
     43                    end
     44                    menu=get(hh,'String');
     45                    iline=find(strcmp(input,menu));
     46                    if isempty(iline)
     47                        iline=numel(menu)+1;
     48                        set(hh,'String',[menu;{input}])
     49                    end
     50                    set(hh,'Value',iline)
    2351            end
    2452        end
  • trunk/src/series/aver_stat.m

    r340 r361  
    1313%Series: Matlab structure containing information set by the series interface
    1414%
    15 function GUI_input=aver_stat(num_i1,num_i2,num_j1,num_j2,Series)
     15function GUI_input=aver_stat(Param)
    1616%----------------------------------------------------------------------
    1717% --- make average on a series of files
     
    2525%  Series.Time:
    2626%  Series.GeometryCalib:%requests for the visibility of input windows in the GUI series  (activated directly by the selection in the menu ACTION)
    27 if ~exist('num_i1','var')
     27if ~exist('Param','var')
    2828    GUI_input={'RootPath';'two';...%nbre of possible input series (options 'on'/'two'/'many', default:'one')
    2929        'SubDir';'on';... % subdirectory of derived files (PIV fields), ('on' by default)
     
    4343
    4444%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    45 hseries=guidata(Series.hseries);%handles of the GUI series
    46 WaitbarPos=get(hseries.waitbar_frame,'Position');
    47 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     45
     46%% Input parameters: read the xml file fior batch case
     47if ischar(Param) && ~isempty(find(regexp('Param','.xml$')))
     48    Param=xml2struct(Param);
     49    else
     50        hseries=guidata(Param.hseries);%handles of the GUI series
     51    WaitbarPos=get(hseries.waitbar_frame,'Position');
     52end
     53Param
     54Param.IndexRange
    4855
    4956%% projection object
     
    6067
    6168%% root input file and type
    62 if ~iscell(Series.RootPath)% case of a single input field series
    63     num_i1={num_i1};num_j1={num_j1};num_i2={num_i2};num_j2={num_j2};
    64     RootPath={Series.RootPath};
    65     RootFile={Series.RootFile};
    66     SubDir={Series.SubDir};
    67     FileExt={Series.FileExt};
    68     NomType={Series.NomType};
    69 else
    70     RootPath=Series.RootPath;
    71     RootFile=Series.RootFile;
    72     SubDir=Series.SubDir;
    73     NomType=Series.NomType;
    74     FileExt=Series.FileExt;
    75 end   
     69% if ~iscell(Series.RootPath)% case of a single input field series
     70%     num_i1={num_i1};num_j1={num_j1};num_i2={num_i2};num_j2={num_j2};
     71%     RootPath={Series.RootPath};
     72%     RootFile={Series.RootFile};
     73%     SubDir={Series.SubDir};
     74%     FileExt={Series.FileExt};
     75%     NomType={Series.NomType};
     76% else
     77%     RootPath=Series.RootPath;
     78%     RootFile=Series.RootFile;
     79%     SubDir=Series.SubDir;
     80%     NomType=Series.NomType;
     81%     FileExt=Series.FileExt;
     82% end   
     83    RootPath=Param.InputTable(:,1);
     84    RootFile=Param.InputTable(:,3);
     85    SubDir=Param.InputTable(:,2);
     86    NomType=Param.InputTable(:,4);
     87    FileExt=Param.InputTable(:,5);
    7688ext=FileExt{1};
    7789form=imformats(ext([2:end]));%test valid Matlab image formats
     
    134146
    135147%% number of slices
    136 NbSlice=Series.IndexRange.NbSlice;
     148NbSlice=Param.IndexRange.NbSlice;
    137149NbSlice_name=num2str(NbSlice);
    138150
     
    161173%% get the velocity type
    162174testcivx=0;
    163 FileExt=get(hseries.FileExt,'String');
     175% FileExt=get(hseries.FileExt,'String');
    164176if ~isequal(FieldName,{'get_field...'})
    165177    testcivx=isequal(FileType{1},'netcdf');
     
    297309transform_fct=[];%default
    298310if isfield(Series,'transform_fct')
    299     transform_fct=Series.transform_fct;
     311    transform_fct=Param.transform_fct;
    300312end
    301313
     
    456468        display([fileresult{i_slice} ' written']);
    457469    else %case of netcdf input file , determine global attributes
    458         DataMean.ListGlobalAttribute=[DataMean.ListGlobalAttribute {Series.Action}];
     470        DataMean.ListGlobalAttribute=[DataMean.ListGlobalAttribute {Param.Action}];
    459471        ActionKey='Action';
    460472        while isfield(DataMean,ActionKey)
    461473            ActionKey=[ActionKey '_1'];
    462474        end
    463         eval(['DataMean.' ActionKey '=Series.Action;'])
     475        eval(['DataMean.' ActionKey '=Param.Action;'])
    464476        DataMean.ListGlobalAttribute=[DataMean.ListGlobalAttribute {ActionKey}];
    465477        if isfield(DataMean,'Time')
  • trunk/src/series/check_data_files.m

    r340 r361  
    134134                    end
    135135                    Tabchar(1,i_slice)={['slice #' num2str(i_slice)]};
    136                     Tabchar(index+1,i_slice)={[file '   ' lastfield]};
     136                    Tabchar(index+1,i_slice)={[file '...' lastfield]};
    137137                end
    138138            end
     
    165165    set(hfig,'name',['view= ' num2str(iview)])
    166166   
    167     h=uicontrol('Style','listbox', 'Position', [20 20 500 300], 'String', Tabchar, 'Callback', @ncbrowser_uvmat);
     167    h=uicontrol('Style','listbox', 'Position', [20 20 500 300], 'String', Tabchar, 'Callback', {'open_uvmat'});
    168168    hh=uicontrol('Style','listbox', 'Position', [20 340 500 40], 'String', message);
    169169end
Note: See TracChangeset for help on using the changeset viewer.