Ignore:
Timestamp:
Nov 22, 2014, 12:15:53 AM (9 years ago)
Author:
sommeria
Message:

message

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series/civ_input.m

    r822 r824  
    20992099
    21002100% handles    structure with handles and user data (see GUIDATA)
     2101
     2102
     2103% --- Executes on button press in InportParam.
     2104function InportParam_Callback(hObject, eventdata, handles)
     2105hseries=findobj(allchild(0),'Tag','series');
     2106hhseries=guidata(hseries);
     2107InputTable=get(hhseries.InputTable,'Data');% read the input file(s) table in the GUI series
     2108oldfile=InputTable{1,1};
     2109if isempty(oldfile)
     2110    % use a file name stored in prefdir
     2111    dir_perso=prefdir;
     2112    profil_perso=fullfile(dir_perso,'uvmat_perso.mat');
     2113    if exist(profil_perso,'file')
     2114        h=load (profil_perso);
     2115        if isfield(h,'RootPath') && ischar(h.RootPath)
     2116            oldfile=h.RootPath;
     2117        end
     2118    end
     2119end
     2120filexml=uigetfile_uvmat('pick a xml parameter file for civ',oldfile,'.xml');% get the xml file containing processing parameters
     2121%proceed only if a file has been introduced by the browser
     2122if ~isempty(filexml)
     2123    Param=xml2struct(filexml);% read the input xml file as a Matlab structure
     2124
     2125   % Param.Action.RUN=0; %desactivate the input RUN=1
     2126    if ~isfield(Param,'InputTable')||~isfield(Param,'IndexRange')
     2127        msgbox_uvmat('ERROR','invalid config file: open a file in a folder ''/0_XML''')
     2128        return
     2129    end
     2130    check_input=0;
     2131    if isfield(Param,'ActionInput')
     2132        if isfield(Param.ActionInput,'Program')&& strcmp(Param.ActionInput.Program,'civ_series')
     2133            fill_GUI(Param.ActionInput,handles.civ_input)% fill the elements of the GUI series with the input parameters
     2134            check_input=1;
     2135            update_CivOptions(handles,0)
     2136               
     2137        end
     2138    end
     2139    if ~check_input
     2140        msgbox_uvmat('ERROR','invalid config file (not for civ_series')
     2141        return
     2142    end
     2143%     Param=rmfield(Param,'InputTable');% do not refresh Input files and index range
     2144%     Param=rmfield(Param,'IndexRange'); 
     2145%     fill_GUI(Param,handles.civ_input)% fill the elements of the GUI series with the input parameters
     2146% %     SeriesData=get(h,'UserData');
     2147%     if isfield(Param,'InputFields')
     2148%         ListField=Param.InputFields.FieldName;
     2149%         set(handles.FieldName,'String',[ListField;{'get-field...'}])
     2150%          set(handles.FieldName,'Value',1:numel(ListField))
     2151%     end       
     2152%     if isfield(Param,'ActionInput')%  introduce  parameters specific to an Action fct, for instance PIV parameters
     2153%         set(handles.ActionInput,'Visible','on')
     2154%         set(handles.ActionInput,'Value',0)
     2155%         Param.ActionInput.ConfigSource=filexml;% record the source of config for future info
     2156%         SeriesData.ActionInput=Param.ActionInput;
     2157%     end
     2158%     if isfield(Param,'ProjObject') %introduce projection object if relevant
     2159%         SeriesData.ProjObject=Param.ProjObject;
     2160%     end
     2161%     set(handles.series,'UserData',SeriesData)
     2162%     if isfield(Param,'CheckObject') && isequal(Param.CheckObject,1)
     2163%         set(handles.ProjObject,'String',Param.ProjObject.Name)
     2164%         set(handles.ViewObject,'Visible','on')
     2165%         set(handles.EditObject,'Visible','on')
     2166%         set(handles.DeleteObject,'Visible','on')
     2167%     else     
     2168%         set(handles.ProjObject,'String','')
     2169%         set(handles.ProjObject,'Visible','off')
     2170%         set(handles.ViewObject,'Visible','off')
     2171%         set(handles.EditObject,'Visible','off')
     2172%         set(handles.DeleteObject,'Visible','off')     
     2173%     end     
     2174%     set(handles.REFRESH,'BackgroundColor',[1 0 1]); %paint REFRESH button in magenta to indicate that it should be activated
     2175end
Note: See TracChangeset for help on using the changeset viewer.