Changeset 824 for trunk/src/series.m
- Timestamp:
- Nov 22, 2014, 12:15:53 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series.m
r822 r824 2828 2828 2829 2829 % -------------------------------------------------------------------- 2830 function MenuImportParam_Callback(hObject, eventdata, handles)2831 % % use a starting file name for browserr2832 InputTable=get(handles.InputTable,'Data');2833 oldfile=InputTable{1,1};2834 if isempty(oldfile)2835 % use a file name stored in prefdir2836 dir_perso=prefdir;2837 profil_perso=fullfile(dir_perso,'uvmat_perso.mat');2838 if exist(profil_perso,'file')2839 h=load (profil_perso);2840 if isfield(h,'RootPath') && ischar(h.RootPath)2841 oldfile=h.RootPath;2842 end2843 end2844 end2845 filexml=uigetfile_uvmat('pick a xml parameter file',oldfile,'.xml');% get the xml file containing processing parameters2846 % proceed only if a file has been introduced by the browser2847 if ~isempty(filexml)2848 Param=xml2struct(filexml);% read the input xml file as a Matlab structure2849 % ask to stop current Action if button RUN is in action (another process is already running)2850 if isequal(get(handles.RUN,'Value'),1)2851 answer= msgbox_uvmat('INPUT_Y-N','stop current Action process?');2852 if strcmp(answer,'Yes')2853 STOP_Callback(hObject, eventdata, handles)2854 else2855 return2856 end2857 end2858 Param.Action.RUN=0; %desactivate the input RUN=12859 if ~isfield(Param,'InputTable')||~isfield(Param,'IndexRange')2860 msgbox_uvmat('ERROR','invalid config file: open a file in a folder ''/0_XML''')2861 return2862 end2863 Param=rmfield(Param,'InputTable');% do not refresh Input files and index range2864 Param=rmfield(Param,'IndexRange');2865 fill_GUI(Param,handles.series)% fill the elements of the GUI series with the input parameters2866 SeriesData=get(handles.series,'UserData');2867 if isfield(Param,'InputFields')2868 ListField=Param.InputFields.FieldName;2869 set(handles.FieldName,'String',[ListField;{'get-field...'}])2870 set(handles.FieldName,'Value',1:numel(ListField))2871 end2872 if isfield(Param,'ActionInput')% introduce parameters specific to an Action fct, for instance PIV parameters2873 set(handles.ActionInput,'Visible','on')2874 set(handles.ActionInput,'Value',0)2875 Param.ActionInput.ConfigSource=filexml;% record the source of config for future info2876 SeriesData.ActionInput=Param.ActionInput;2877 end2878 if isfield(Param,'ProjObject') %introduce projection object if relevant2879 SeriesData.ProjObject=Param.ProjObject;2880 end2881 set(handles.series,'UserData',SeriesData)2882 if isfield(Param,'CheckObject') && isequal(Param.CheckObject,1)2883 set(handles.ProjObject,'String',Param.ProjObject.Name)2884 set(handles.ViewObject,'Visible','on')2885 set(handles.EditObject,'Visible','on')2886 set(handles.DeleteObject,'Visible','on')2887 else2888 set(handles.ProjObject,'String','')2889 set(handles.ProjObject,'Visible','off')2890 set(handles.ViewObject,'Visible','off')2891 set(handles.EditObject,'Visible','off')2892 set(handles.DeleteObject,'Visible','off')2893 end2894 set(handles.REFRESH,'BackgroundColor',[1 0 1]); %paint REFRESH button in magenta to indicate that it should be activated2895 end2830 % function MenuImportParam_Callback(hObject, eventdata, handles) 2831 % %% use a starting file name for browserr 2832 % InputTable=get(handles.InputTable,'Data'); 2833 % oldfile=InputTable{1,1}; 2834 % if isempty(oldfile) 2835 % % use a file name stored in prefdir 2836 % dir_perso=prefdir; 2837 % profil_perso=fullfile(dir_perso,'uvmat_perso.mat'); 2838 % if exist(profil_perso,'file') 2839 % h=load (profil_perso); 2840 % if isfield(h,'RootPath') && ischar(h.RootPath) 2841 % oldfile=h.RootPath; 2842 % end 2843 % end 2844 % end 2845 % filexml=uigetfile_uvmat('pick a xml parameter file',oldfile,'.xml');% get the xml file containing processing parameters 2846 % %proceed only if a file has been introduced by the browser 2847 % if ~isempty(filexml) 2848 % Param=xml2struct(filexml);% read the input xml file as a Matlab structure 2849 % % ask to stop current Action if button RUN is in action (another process is already running) 2850 % if isequal(get(handles.RUN,'Value'),1) 2851 % answer= msgbox_uvmat('INPUT_Y-N','stop current Action process?'); 2852 % if strcmp(answer,'Yes') 2853 % STOP_Callback(hObject, eventdata, handles) 2854 % else 2855 % return 2856 % end 2857 % end 2858 % Param.Action.RUN=0; %desactivate the input RUN=1 2859 % if ~isfield(Param,'InputTable')||~isfield(Param,'IndexRange') 2860 % msgbox_uvmat('ERROR','invalid config file: open a file in a folder ''/0_XML''') 2861 % return 2862 % end 2863 % Param=rmfield(Param,'InputTable');% do not refresh Input files and index range 2864 % Param=rmfield(Param,'IndexRange'); 2865 % fill_GUI(Param,handles.series)% fill the elements of the GUI series with the input parameters 2866 % SeriesData=get(handles.series,'UserData'); 2867 % if isfield(Param,'InputFields') 2868 % ListField=Param.InputFields.FieldName; 2869 % set(handles.FieldName,'String',[ListField;{'get-field...'}]) 2870 % set(handles.FieldName,'Value',1:numel(ListField)) 2871 % end 2872 % if isfield(Param,'ActionInput')% introduce parameters specific to an Action fct, for instance PIV parameters 2873 % set(handles.ActionInput,'Visible','on') 2874 % set(handles.ActionInput,'Value',0) 2875 % Param.ActionInput.ConfigSource=filexml;% record the source of config for future info 2876 % SeriesData.ActionInput=Param.ActionInput; 2877 % end 2878 % if isfield(Param,'ProjObject') %introduce projection object if relevant 2879 % SeriesData.ProjObject=Param.ProjObject; 2880 % end 2881 % set(handles.series,'UserData',SeriesData) 2882 % if isfield(Param,'CheckObject') && isequal(Param.CheckObject,1) 2883 % set(handles.ProjObject,'String',Param.ProjObject.Name) 2884 % set(handles.ViewObject,'Visible','on') 2885 % set(handles.EditObject,'Visible','on') 2886 % set(handles.DeleteObject,'Visible','on') 2887 % else 2888 % set(handles.ProjObject,'String','') 2889 % set(handles.ProjObject,'Visible','off') 2890 % set(handles.ViewObject,'Visible','off') 2891 % set(handles.EditObject,'Visible','off') 2892 % set(handles.DeleteObject,'Visible','off') 2893 % end 2894 % set(handles.REFRESH,'BackgroundColor',[1 0 1]); %paint REFRESH button in magenta to indicate that it should be activated 2895 % end 2896 2896 2897 2897 … … 3333 3333 %------------------------------------------------------------------------ 3334 3334 Mode_Callback([],[]) 3335 3336
Note: See TracChangeset
for help on using the changeset viewer.