Changeset 664 for trunk/src/fill_GUI.m


Ignore:
Timestamp:
Jul 11, 2013, 11:56:47 PM (11 years ago)
Author:
sommeria
Message:

a few bugs corrected: import and retrival of parameters in series. mask in civ_series

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/fill_GUI.m

    r607 r664  
    77% INPUT:
    88% Param: matlab structure containing the information to display in the GUI
    9 % handles: Matlab structure containing the handles of the GUI elements
     9% GUI_handle: handle of the GUI to be filled
    1010%
    1111% see also the reverse function read_GUI.m
     
    1414%------------------------------------------------------------------------
    1515errormsg='';
    16 %handles=guidata(GUI_handle);
    17             children=get(GUI_handle,'children');
    18              handles=[];
    19             for ichild=1:numel(children)
    20                 handles.(get(children(ichild),'tag'))=children(ichild);
    21             end
     16if ~isstruct(Param)
     17    errormsg='first input parmaeter of fill_GUI must be a structure';
     18    return
     19end
     20children=get(GUI_handle,'children');
     21handles=[];
     22for ichild=1:numel(children)
     23    handles.(get(children(ichild),'tag'))=children(ichild);
     24end
    2225UserData=get(GUI_handle,'UserData');
    2326fields=fieldnames(Param);%list of fields in Param
     
    2831        if isfield(handles,fields{ifield})
    2932            set(handles.(fields{ifield}),'Visible','on')
    30             %             children=get(handles.(fields{ifield}),'children');
    31             %             for ichild=1:numel(children)
    32             %                 hchild.(get(children(ichild),'tag'))=children(ichild);
    33             %             end
    34             %   errormsg=fill_GUI(Param.(fields{ifield}),hchild);% apply the function to the substructure
    3533            errormsg=fill_GUI(Param.(fields{ifield}),handles.(fields{ifield}));% apply the function to the substructure
    36             % if the input sub-structure fits with a tag name of the GUI and a
    37             % substructure of UserData
    3834        elseif isfield(UserData,fields{ifield})&& isfield(handles,fields{ifield})&&isfield(Param.(fields{ifield}),'Name')
    3935            UserData.(fields{ifield})=Param.(fields{ifield});
     
    115111    end
    116112end
    117  
Note: See TracChangeset for help on using the changeset viewer.