Changeset 824 for trunk/src/series.m


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.m

    r822 r824  
    28282828
    28292829% --------------------------------------------------------------------
    2830 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
     2830% 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
    28962896
    28972897
     
    33333333%------------------------------------------------------------------------
    33343334Mode_Callback([],[])
    3335 
    3336 
Note: See TracChangeset for help on using the changeset viewer.