- Timestamp:
- Feb 22, 2014, 5:11:04 PM (11 years ago)
- Location:
- trunk/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/fullfile_uvmat.m
r589 r714 37 37 function filename=fullfile_uvmat(RootPath,SubDir,RootFile,FileExt,NomType,i1,i2,j1,j2) 38 38 39 %% display help and test function in the absence of input ar ument39 %% display help and test function in the absence of input argument 40 40 if ~exist('RootPath','var') 41 41 help fullfile_uvmat; … … 115 115 end 116 116 end 117 % if ~isempty(i2_str)||~isempty(j2_str) 118 filename=fullfile(RootPath,SubDir,RootFile); 119 % else 120 % filename=fullfile(RootPath,RootFile); 121 % end 117 filename=fullfile(RootPath,SubDir,RootFile); 122 118 filename=[filename sep1 i1_str sep2 i2_str sep3 j1_str sep4 j2_str]; 123 119 filename=[regexprep(filename,'_$','') FileExt];%suppress possible '_' at the end of the string and add the extension -
trunk/src/mouse_down.m
r713 r714 31 31 else 32 32 hCurrentGUI=hObject; % handle of the current GUI: usual plot 33 end 34 if strcmp(get(hCurrentGUI,'Pointer'),'watch') 35 return % no action if a calculation is running 33 36 end 34 37 hhCurrentGUI=guidata(hCurrentGUI);% tags of the children of the current GUI -
trunk/src/mouse_motion.m
r701 r714 25 25 function mouse_motion(hObject,eventdata,handles) 26 26 27 if ~exist('handles','var')28 set(hCurrentFig,'Pointer','arrow');29 return30 end27 % if ~exist('handles','var') 28 % set(hCurrentFig,'Pointer','arrow'); 29 % return 30 % end 31 31 FigData=get(hObject,'UserData'); 32 32 if ishandle(FigData)% case of a zoom plot, the handle of the parent rectangle is stored in UserData, its parent is the plotting axes of the rectangle … … 34 34 else 35 35 hCurrentFig=hObject;%usual plot 36 end 37 if strcmp(get(hCurrentFig,'Pointer'),'watch') 38 return % no action if a calculation is running 36 39 end 37 40 hhCurrentFig=guidata(hCurrentFig);%handles of the elements in the GUI containing the current figure (uvmat or view_field) -
trunk/src/mouse_up.m
r701 r714 127 127 %% stop drawing and plot the projected field if the object manipulation is finished 128 128 if check_multiple==0 || isequal(get(hcurrentfig,'SelectionType'),'alt') 129 pointer=get(hcurrentfig,'Pointer');%memorize the current pointer shape 130 set(hcurrentfig,'Pointer','watch')% set the pointer shape to watch to prevent further mouse action 129 131 AxeData.CurrentOrigin=[]; %suppress the current origin 130 132 hobject=UvData.ProjObject{IndexObj}.DisplayHandle.(FigTag); … … 175 177 UvData.ProjObject{IndexObj}=rmfield(UvData.ProjObject{IndexObj},'CreateMode');%remove createMode to mark the object as finished 176 178 end 179 set(hcurrentfig,'Pointer',pointer)% % revert the pointer shape to allow further mouse action 177 180 else 178 181 test_drawing=1;%allow continuation of drawing object -
trunk/src/series.m
r711 r714 303 303 %------------------------------------------------------------------------ 304 304 function MenuBrowse_Callback(hObject, eventdata, handles) 305 306 305 %% look for the previously opened file 'oldfile' 307 oldfile=''; %default 308 if get(handles.CheckAppend,'Value') 309 % case 'checkappend': new series appended to the input table 310 InputTable=get(handles.InputTable,'Data'); 311 RootPathCell=InputTable(:,1); 312 SubDirCell=InputTable(:,3); 313 oldfile=''; %default 314 if ~(isempty(RootPathCell) || isequal(RootPathCell,{''}))%loads the previously stored file name and set it as default in the file_input box 315 oldfile=fullfile(RootPathCell{1},SubDirCell{1}); 316 end 317 else 318 % case refresh the input table by a new series 319 SeriesData=get(handles.series,'UserData'); 320 if isfield(SeriesData,'RefFile') 321 oldfile=SeriesData.RefFile{1}; 322 end 323 end 306 InputTable=get(handles.InputTable,'Data'); 307 oldfile=InputTable{1,1}; 308 if isempty(oldfile) 309 % use a file name stored in prefdir 310 dir_perso=prefdir; 311 profil_perso=fullfile(dir_perso,'uvmat_perso.mat'); 312 if exist(profil_perso,'file') 313 h=load (profil_perso); 314 if isfield(h,'RootPath') && ischar(h.RootPath) 315 oldfile=h.RootPath; 316 end 317 end 318 end 319 %% launch the browser 320 fileinput=uigetfile_uvmat('pick a file to append in the input table',oldfile); 321 if ~isempty(fileinput) 322 display_file_name(handles,fileinput,'one') 323 end 324 325 % -------------------------------------------------------------------- 326 function MenuBrowseAppend_Callback(hObject, eventdata, handles) 327 328 %% look for the previously opened file 'oldfile' 329 InputTable=get(handles.InputTable,'Data'); 330 RootPathCell=InputTable(:,1); 331 if isempty(RootPathCell{1})% no input file in the table 332 MenuBrowse_Callback(hObject, eventdata, handles)%refresh the input table, not append 333 return 334 end 335 SubDirCell=InputTable(:,2); 336 oldfile=fullfile(RootPathCell{1},SubDirCell{1}); 324 337 325 338 %% use a file name stored in prefdir … … 336 349 fileinput=uigetfile_uvmat('pick a file to append in the input table',oldfile); 337 350 if ~isempty(fileinput) 338 % if get(handles.CheckAppend,'Value')339 % display_file_name(handles,fileinput,'append')340 % else341 display_file_name(handles,fileinput,'one')342 % end343 end344 345 % --------------------------------------------------------------------346 function MenuBrowseAppend_Callback(hObject, eventdata, handles)347 348 %% look for the previously opened file 'oldfile'349 InputTable=get(handles.InputTable,'Data');350 RootPathCell=InputTable(:,1);351 if isempty(RootPathCell{1})% no input file in the table352 MenuBrowse_Callback(hObject, eventdata, handles)%refresh the input table, not append353 return354 end355 SubDirCell=InputTable(:,2);356 % oldfile=''; %default357 % if ~(isempty(RootPathCell) || isequal(RootPathCell,{''}))%loads the previously stored file name and set it as default in the file_input box358 oldfile=fullfile(RootPathCell{1},SubDirCell{1});359 % end360 361 %% use a file name stored in prefdir362 dir_perso=prefdir;363 profil_perso=fullfile(dir_perso,'uvmat_perso.mat');364 if exist(profil_perso,'file')365 h=load (profil_perso);366 if isfield(h,'RootPath') && ischar(h.RootPath)367 oldfile=h.RootPath;368 end369 end370 371 %% launch the browser372 fileinput=uigetfile_uvmat('pick a file to append in the input table',oldfile);373 if ~isempty(fileinput)374 351 display_file_name(handles,fileinput,'append') 375 352 end … … 380 357 function MenuFile_Callback(hObject, eventdata, handles) 381 358 382 display_file_name(handles,get(hObject,'Label'),'one') 359 errormsg=display_file_name(handles,get(hObject,'Label'),'one'); 360 if ~isempty(errormsg) 361 set(hObject,'Label','') 362 MenuFile=[{get(handles.MenuFile_1,'Label')};{get(handles.MenuFile_2,'Label')};... 363 {get(handles.MenuFile_3,'Label')};{get(handles.MenuFile_4,'Label')};{get(handles.MenuFile_5,'Label')}]; 364 str_find=strcmp(get(hObject,'Label'),MenuFile); 365 MenuFile(str_find)=[];% suppress the input file to the list 366 for ifile=1:numel(MenuFile) 367 set(handles.(['MenuFile_' num2str(ifile)]),'Label',MenuFile{ifile}); 368 end 369 end 383 370 384 371 %------------------------------------------------------------------------ … … 546 533 if ~exist(RootPath,'dir') 547 534 i1_series=[]; 548 RootPath=fileparts(RootPath); %will try the uppe dfolder549 else 535 RootPath=fileparts(RootPath); %will try the upper folder 536 else %scan the input folder 550 537 [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,tild,FileType,FileInfo,MovieObject]=... 551 538 find_file_series(fullfile(InputTable{iview,1},InputTable{iview,2}),[InputTable{iview,3} InputTable{iview,4} InputTable{iview,5}]); 552 539 end 540 % if no file is found, open a browser 553 541 if isempty(i1_series) 554 542 fileinput=uigetfile_uvmat(['wrong input at line ' num2str(iview) ':pick a new input file'],RootPath); … … 567 555 %------------------------------------------------------------------------ 568 556 % --- Function called when a new file is opened, either by series_OpeningFcn or by the browser 569 function display_file_name(handles,fileinput,iview)557 function errormsg=display_file_name(handles,fileinput,iview) 570 558 %------------------------------------------------------------------------ 571 559 % … … 576 564 % or 'one': refresh the list 577 565 % 'append': add a new line to the input table 578 566 set(handles.REFRESH,'BackgroundColor',[1 1 0])% set REFRESH button to yellow color (indicate activation) 567 drawnow 568 errormsg='';%default 579 569 %% get the input root name, indices, file extension and nomenclature NomType 580 570 if ~exist(fileinput,'file') 581 msgbox_uvmat('ERROR',['input file ' fileinput ' does not exist']) 571 errormsg=['input file ' fileinput ' does not exist']; 572 msgbox_uvmat('ERROR',errormsg) 573 set(handles.REFRESH,'BackgroundColor',[1 0 0])% set REFRESH button to red color (end of activation) 582 574 return 583 575 end … … 590 582 if isempty(RootFile)&&isempty(i1_series) 591 583 errormsg='no input file in the series'; 584 msgbox_uvmat('ERROR',errormsg) 585 set(handles.REFRESH,'BackgroundColor',[1 0 0])% set REFRESH button to red color (end of activation) 592 586 return 593 587 end 594 588 if strcmp(FileType,'txt') 595 589 edit(fileinput) 590 set(handles.REFRESH,'BackgroundColor',[1 0 0])% set REFRESH button to red color (end of activation) 596 591 return 597 592 elseif strcmp(FileType,'xml') 598 593 editxml(fileinput) 594 set(handles.REFRESH,'BackgroundColor',[1 0 0])% set REFRESH button to red color (end of activation) 599 595 return 600 596 elseif strcmp(FileType,'figure') 601 597 open(fileinput) 598 set(handles.REFRESH,'BackgroundColor',[1 0 0])% set REFRESH button to red color (end of activation) 602 599 return 603 600 end … … 670 667 set(handles.num_ref_j,'String',num2str(ref_j)); 671 668 669 %% update first and last indices if they do not exist 670 Param=read_GUI(handles.series); 671 first_j=[]; 672 if isfield(Param.IndexRange,'first_j'); first_j=Param.IndexRange.first_j; end 673 last_j=[]; 674 if isfield(Param.IndexRange,'last_j'); last_j=Param.IndexRange.last_j; end 675 [i1,i2,j1,j2] = get_file_index(Param.IndexRange.first_i,first_j,Param.IndexRange.PairString); 676 FirstFileName=fullfile_uvmat(Param.InputTable{1,1},Param.InputTable{1,2},Param.InputTable{1,3},... 677 Param.InputTable{1,5},Param.InputTable{1,4},i1,i2,j1,j2); 678 if ~exist(FirstFileName,'file') 679 set(handles.num_first_i,'String',num2str(ref_i)) 680 set(handles.num_first_j,'String',num2str(ref_j)) 681 end 682 [i1,i2,j1,j2] = get_file_index(Param.IndexRange.last_i,last_j,Param.IndexRange.PairString); 683 LastFileName=fullfile_uvmat(Param.InputTable{1,1},Param.InputTable{1,2},Param.InputTable{1,3},... 684 Param.InputTable{1,5},Param.InputTable{1,4},i1,i2,j1,j2); 685 if ~exist(LastFileName,'file') 686 set(handles.num_last_i,'String',num2str(ref_i)) 687 set(handles.num_last_j,'String',num2str(ref_j)) 688 end 689 672 690 %% update the list of recent files in the menubar and save it for future opening 673 691 MenuFile=[{get(handles.MenuFile_1,'Label')};{get(handles.MenuFile_2,'Label')};... … … 699 717 %% initiate input file series and refresh the current field view: 700 718 update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileType,FileInfo,MovieObject,iview); 719 set(handles.REFRESH,'BackgroundColor',[1 0 0])% set REFRESH button to red color (end of activation) 701 720 702 721 %------------------------------------------------------------------------ … … 722 741 diff_j_max=diff(ref_j); 723 742 diff_i_max=diff(ref_i); 724 725 % pair_max=squeeze(max(i1_series,[],1)); %max on pair index726 % j_max=max(pair_max,[],1);727 % MinIndex_i=find(j_max, 1 )-1;% min ref index i detected in the series (corresponding to the first non-zero value of i1_series, except for zero index)728 % MaxIndex_i=find(j_max, 1, 'last' )-1;% max ref index i detected in the series (corresponding to the first non-zero value of i1_series, except for zero index)729 % diff_i_max=diff(j_max);730 743 if ~isempty(diff_i_max) && isequal (diff_i_max,diff_i_max(1)*ones(size(diff_i_max))) 731 744 set(handles.num_incr_i,'String',num2str(diff_i_max(1)))% detect an increment to dispaly by default 732 745 end 733 % i_max=max(pair_max,[],2);734 % MinIndex_j=min(find(i_max))-1;% min ref index j735 % MaxIndex_j=max(find(i_max))-1;% max ref index j736 % diff_j_max=diff(i_max);737 746 if isequal (diff_j_max,diff_j_max(1)*ones(size(diff_j_max))) 738 747 set(handles.num_incr_j,'String',num2str(diff_j_max(1))) … … 973 982 ind_select=find(file_indices<=numel(j_max{iview})); 974 983 LineData(ind_select)=j_max{iview}(file_select)~=0; 975 % LineData=zeros(1,range_index);976 % x_index=find(j_max{iview}>0)-MinIndex_i;977 % LineData(x_index)=1;978 % if numel(x)>1979 % LineData980 %LineData=interp1(x,LineData,xI,'nearest');981 984 CData(ind_y,:)=ones(size(ind_y'))*LineData; 982 % end983 985 end 984 986 CData=cat(3,zeros(size(CData)),CData,zeros(size(CData)));%make color images r=0,g,b=0 … … 1088 1090 %------------------------------------------------------------------------ 1089 1091 SeriesData=get(handles.series,'UserData');% 1090 ref_i=[str2num(get(handles.num_first_i,'String')) str2num(get(handles.num_last_i,'String'))]; 1091 ref_j=[str2num(get(handles.num_first_j,'String')) str2num(get(handles.num_last_j,'String'))]; 1092 PairString=get(handles.PairString,'Data'); 1093 ref_i_1=str2num(get(handles.num_first_i,'String'));%first reference index 1094 ref_i_2=str2num(get(handles.num_last_i,'String'));%last reference index 1095 ref_j_1=[];ref_j_2=[]; 1096 if strcmp(get(handles.num_first_j,'Visible'),'on') 1097 ref_j_1=str2num(get(handles.num_first_j,'String')); 1098 ref_j_2=str2num(get(handles.num_last_j,'String')); 1099 end 1100 [i1_1,i2_1,j1_1,j2_1] = get_file_index(ref_i_1,ref_j_1,PairString); 1101 [i1_2,i2_2,j1_2,j2_2] = get_file_index(ref_i_2,ref_j_2,PairString); 1092 1102 TimeTable=get(handles.TimeTable,'Data'); 1093 Pairs=get(handles.PairString,'Data'); 1103 1104 %Pairs=get(handles.PairString,'Data'); 1094 1105 for iview=1:size(TimeTable,1) 1095 1106 if size(SeriesData.Time,1)<iview 1096 1107 break 1097 1108 end 1098 i1=ref_i;1099 j1=ref_j;1100 i2=ref_i;1101 j2=ref_j;1102 % case of pairs1103 if ~isempty(Pairs{iview,1})1104 r=regexp(Pairs{iview,1},'(?<mode>(Di=)|(Dj=)) -*(?<num1>\d+)\|(?<num2>\d+)','names');1105 if isempty(r)1106 r=regexp(Pairs{iview,1},'(?<num1>\d+)(?<mode>-)(?<num2>\d+)','names');1107 end1108 switch r.mode1109 case 'Di=' % case 'series(Di)')1110 i1=ref_i-str2num(r.num1);1111 i2=ref_i+str2num(r.num2);1112 case 'Dj=' % case 'series(Dj)'1113 j1=ref_j-str2num(r.num1);1114 j2=ref_j+str2num(r.num2);1115 case '-' % case 'bursts'1116 j1=str2num(r.num1)*ones(size(ref_i));1117 j2=str2num(r.num2)*ones(size(ref_i));1118 end1119 end1120 1109 TimeTable{iview,2}=[]; 1121 1110 TimeTable{iview,3}=[]; 1122 if size(SeriesData.Time{iview},1)>=i2 (2)+1&&size(SeriesData.Time{iview},2)>=j2(2)+11123 if isempty(ref_j )1124 time_first=(SeriesData.Time{iview}(i1 (1)+1)+SeriesData.Time{iview}(i2(1)+1))/2;1125 time_last=(SeriesData.Time{iview}(i1 (2)+1)+SeriesData.Time{iview}(i2(2))+1)/2;1111 if size(SeriesData.Time{iview},1)>=i2_2+1 && (isempty(ref_j_1)||size(SeriesData.Time{iview},2)>=j2_2+1) 1112 if isempty(ref_j_1) 1113 time_first=(SeriesData.Time{iview}(i1_1+1,2)+SeriesData.Time{iview}(i2_1+1,2))/2; 1114 time_last=(SeriesData.Time{iview}(i1_2+1,2)+SeriesData.Time{iview}(i2_2+1,2))/2; 1126 1115 else 1127 time_first=(SeriesData.Time{iview}(i1 (1)+1,j1(1)+1)+SeriesData.Time{iview}(i2(1)+1,j2(1)+1))/2;1128 time_last=(SeriesData.Time{iview}(i1 (2)+1,j1(2)+1)+SeriesData.Time{iview}(i2(2)+1,j2(2)+1))/2;1116 time_first=(SeriesData.Time{iview}(i1_1+1,j1_1+1)+SeriesData.Time{iview}(i2_1+1,j2_1+1))/2; 1117 time_last=(SeriesData.Time{iview}(i1_2+1,j1_2+1)+SeriesData.Time{iview}(i2_2+1,j2_1+1))/2; 1129 1118 end 1130 1119 TimeTable{iview,2}=time_first; %TODO: take into account pairs … … 1137 1126 MinIndex_i=min(get(handles.MinIndex_i,'Data')); 1138 1127 MaxIndex_i=max(get(handles.MaxIndex_i,'Data')); 1139 pos_first=(ref_i (1)-MinIndex_i)/(MaxIndex_i-MinIndex_i+1);1140 pos_last=(ref_i (2)-MinIndex_i+1)/(MaxIndex_i-MinIndex_i+1);1128 pos_first=(ref_i_1-MinIndex_i)/(MaxIndex_i-MinIndex_i+1); 1129 pos_last=(ref_i_2-MinIndex_i+1)/(MaxIndex_i-MinIndex_i+1); 1141 1130 Position=get(handles.Waitbar,'Position');% position of the waitbar:= [ x,y, width, height] 1142 1131 Position_status=get(handles.FileStatus,'Position'); … … 1145 1134 set(handles.Waitbar,'Position',Position) 1146 1135 update_waitbar(handles.Waitbar,0) 1147 1148 % for iview=1:numel(SeriesData.i1_series)1149 % pair_max{iview}=squeeze(max(SeriesData.i1_series{iview},[],1)); %max on pair index1150 % if (strcmp(get(handles.num_first_j,'Visible'),'off')&& size(pair_max{iview},2)~=1)1151 % pair_max{iview}=squeeze(max(pair_max{iview},[],1)); % consider only the i index1152 % end1153 % pair_max{iview}=reshape(pair_max{iview},1,[]);1154 % index_min(iview)=find(pair_max{iview}>0, 1 );1155 % index_max(iview)=find(pair_max{iview}>0, 1, 'last' );1156 % end1157 % [index_min,iview_min]=min(index_min);1158 % [index_max,iview_max]=min(index_max);1159 % if size(SeriesData.i1_series{iview_min},2)==1% movie1160 % index_first=ref_i(1);1161 % index_last=ref_i(2);1162 % else1163 % index_first=(ref_i(1)-1)*(size(SeriesData.i1_series{iview_min},1))+ref_j(1)+1;1164 % index_last=(ref_i(2)-1)*(size(SeriesData.i1_series{iview_max},1))+ref_j(2)+1;1165 % end1166 % range=index_max-index_min+1;1167 % coeff_min=(index_first-index_min)/range;1168 % coeff_max=(index_last-index_min+1)/range;1169 % Position=get(handles.Waitbar,'Position');% position of the waitbar:= [ x,y, width, height]1170 % Position_status=get(handles.FileStatus,'Position');1171 % Position(1)=coeff_min*Position_status(3)+Position_status(1);1172 % Position(3)=Position_status(3)*(coeff_max-coeff_min);1173 % set(handles.Waitbar,'Position',Position)1174 % update_waitbar(handles.Waitbar,0)1175 1136 1176 1137 %------------------------------------------------------------------------ … … 2028 1989 %% Activate the Action fct 2029 1990 Param=read_GUI_series(handles);% read the parameters from the GUI series 2030 ParamOut=h_fun(Param); 1991 ParamOut=h_fun(Param);%run the selected Action function to get the relevant input 2031 1992 2032 1993 %% Put the first line of the selected Action fct as tooltip help … … 2041 2002 SeriesData=get(handles.series,'UserData'); 2042 2003 iview_civ=[];nb_netcdf=0; 2043 if ~isempty(SeriesData) 2004 if ~isempty(SeriesData)&&isfield(SeriesData,'FileType') 2044 2005 iview_civ=find(strcmp('civx',SeriesData.FileType)|strcmp('civdata',SeriesData.FileType)); 2045 2006 nb_netcdf=numel(find(strcmp('netcdf',SeriesData.FileType))); … … 2117 2078 InputFieldsVisible='off';%visibility of the frame Fields 2118 2079 if isfield(ParamOut,'VelType') 2119 if strcmp( ParamOut.VelType,'on e')||strcmp( ParamOut.VelType,'two')2080 if strcmp( ParamOut.VelType,'on')||strcmp(ParamOut.VelType,'one')||strcmp( ParamOut.VelType,'two') 2120 2081 if numel(iview_civ)>=1 2121 2082 VelTypeVisible='on'; … … 2138 2099 FieldName_1Visible='off'; %hidden by default 2139 2100 if isfield(ParamOut,'FieldName') 2140 if strcmp( ParamOut.FieldName,'on e')||strcmp( ParamOut.FieldName,'two')2101 if strcmp( ParamOut.FieldName,'on') || strcmp(ParamOut.FieldName,'one')||strcmp( ParamOut.FieldName,'two') 2141 2102 if (numel(iview_civ)+nb_netcdf)>=1 2142 2103 InputFieldsVisible='on'; … … 2250 2211 function ActionInput_Callback(hObject, eventdata, handles) 2251 2212 %------------------------------------------------------------------------ 2252 if get(handles.ActionInput,'Value')2253 2254 end2213 % if get(handles.ActionInput,'Value') 2214 ActionName_Callback(hObject, eventdata, handles) 2215 % end 2255 2216 2256 2217 %------------------------------------------------------------------------ … … 2307 2268 set(handles.TimeName,'String',['var:' GetFieldData.Time.TimeName]) 2308 2269 set(handles.NomType,'String','*') 2309 set(handles.RootFile,'String',[get(handles.RootFile,'String') get(handles.FileIndex,'String')]) 2270 set(handles.RootFile,'String',[get(handles.RootFile,'String') get(handles.FileIndex,'String')])% A VERIFIER !!!!!! 2310 2271 set(handles.FileIndex,'String','') 2311 2272 ParamIn.TimeVarName=GetFieldData.Time.TimeName; … … 2696 2657 %------------------------------------------------------------------------ 2697 2658 function MenuImportConfig_Callback(hObject, eventdata, handles) 2698 2659 % SeriesData=get(handles.series,'UserData'); 2660 % if isfield(SeriesData,'RefFile') 2661 % oldfile=SeriesData.RefFile{1}; 2662 % end 2663 %% use a strating file name for browserr 2699 2664 InputTable=get(handles.InputTable,'Data'); 2700 filexml=uigetfile_uvmat('pick a xml parameter file',InputTable{1,1},'.xml');% get the xml file containing processing parameters 2665 oldfile=InputTable{1,1}; 2666 if isempty(oldfile) 2667 % use a file name stored in prefdir 2668 dir_perso=prefdir; 2669 profil_perso=fullfile(dir_perso,'uvmat_perso.mat'); 2670 if exist(profil_perso,'file') 2671 h=load (profil_perso); 2672 if isfield(h,'RootPath') && ischar(h.RootPath) 2673 oldfile=h.RootPath; 2674 end 2675 end 2676 end 2677 filexml=uigetfile_uvmat('pick a xml parameter file',oldfile,'.xml');% get the xml file containing processing parameters 2701 2678 %proceed only if a file has been introduced by the browser 2702 2679 if ~isempty(filexml) … … 2715 2692 SeriesData=get(handles.series,'UserData'); 2716 2693 if isfield(Param,'ActionInput')% introduce parameters specific to an Action fct, for instance PIV parameters 2717 % set(handles.ActionInput,'Visible','on')2718 % set(handles.ActionInput_title,'Visible','on')2719 2694 set(handles.ActionInput,'Visible','on') 2720 2695 set(handles.ActionInput,'Value',0) … … 2737 2712 set(handles.DeleteObject,'Visible','off') 2738 2713 end 2739 % set(handles.REFRESH,'Visible','on')2740 2714 set(handles.REFRESH,'BackgroundColor',[1 0 1]); %paint REFRESH button in magenta to indicate that it should be activated 2741 % REFRESH_Callback([],[],handles)% refresh data relative to the input files2742 2715 end 2743 2716 … … 2802 2775 OutputSubDir=[Param.OutputSubDir Param.OutputDirExt];% subdirectory for output files 2803 2776 OutputDir=fullfile(RootPath,OutputSubDir); 2804 uigetfile_uvmat('status_display',OutputDir) 2777 if exist(OutputDir,'dir') 2778 uigetfile_uvmat('status_display',OutputDir) 2779 else 2780 msgbox_uvmat('ERROR','output folder not created yet: calculation did not start') 2781 set(handles.status,'BackgroundColor',[0 1 0]) 2782 end 2805 2783 else 2806 2784 %% delete current display fig if selection is off -
trunk/src/uigetfile_uvmat.m
r664 r714 122 122 %------------------------------------------------------------------------ 123 123 function OK_Callback(option,filter_ext,hObject,event) 124 set(hObject,'backgroundColor',[1 1 0])% indicate button activation 124 125 hfig=get(hObject,'parent');%handle of the fig 125 126 htitlebox=findobj(hfig,'tag','titlebox'); % display the current dir name … … 159 160 end 160 161 end 161 162 set(hObject,'backgroundColor',[0 1 0])% indicate end button activation 162 163 uiresume(get(hObject,'parent')) 163 164 -
trunk/src/uvmat.m
r713 r714 474 474 %------------------------------------------------------------------------ 475 475 fileinput=get(hObject,'Label'); 476 set(handles.SubField,'Value',0) 477 desable_subfield(handles) 478 display_file_name( handles,fileinput) 479 476 set(handles.SubField,'Value',0) 477 desable_subfield(handles) 478 errormsg=display_file_name( handles,fileinput); 479 if ~isempty(errormsg) 480 set(hObject,'Label','') 481 MenuFile=[{get(handles.MenuFile_1,'Label')};{get(handles.MenuFile_2,'Label')};... 482 {get(handles.MenuFile_3,'Label')};{get(handles.MenuFile_4,'Label')};{get(handles.MenuFile_5,'Label')}]; 483 str_find=strcmp(get(hObject,'Label'),MenuFile); 484 MenuFile(str_find)=[];% suppress the input file to the list 485 for ifile=1:numel(MenuFile) 486 set(handles.(['MenuFile_' num2str(ifile)]),'Label',MenuFile{ifile}); 487 end 488 end 480 489 481 490 % ----------------------------------------------------------------------- … … 616 625 %------------------------------------------------------------------------ 617 626 set(handles.InputFileREFRESH,'BackgroundColor',[1 1 0])% set button color to yellow to indicate that refresh is under action 627 set(handles.uvmat,'Pointer','watch') % set the mouse pointer to 'watch' 628 drawnow 618 629 % read the current input file name: 619 630 [RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes(handles); … … 640 651 641 652 if isempty(errormsg) 642 set(handles.InputFileREFRESH,'BackgroundColor',[1 0 0])% set button color to red to indicate that refresh has been updated653 % set(handles.InputFileREFRESH,'BackgroundColor',[1 0 0])% set button color to red to indicate that refresh has been updated 643 654 else 644 655 set(handles.InputFileREFRESH,'BackgroundColor',[1 0 1])% keep button color magenta, input not succesfull 645 656 end 657 set(handles.uvmat,'Pointer','arrow')% set back the mouse pointer to arrow 646 658 647 659 %------------------------------------------------------------------------ 648 660 % --- Fills the edit boxes RootPath, RootFile,NomType...from an input file name 'fileinput' 649 function display_file_name(handles,fileinput,index)661 function errormsg=display_file_name(handles,fileinput,index) 650 662 %------------------------------------------------------------------------ 651 663 %% look for the input file existence 664 errormsg='';%default 652 665 if ~exist(fileinput,'file') 653 msgbox_uvmat('ERROR',['input file ' fileinput ' does not exist']) 666 errormsg=['input file ' fileinput ' does not exist']; 667 msgbox_uvmat('ERROR',errormsg) 654 668 return 655 669 end … … 917 931 NbSlice=1;%default 918 932 ImaDoc_str=''; 919 set(handles.InputFileREFRESH,'BackgroundColor',[1 1 0])920 933 if ~isempty(XmlFileName) 921 934 set(handles.view_xml,'Visible','on') … … 1148 1161 set(handles.j2,'Visible',state_j) 1149 1162 set(handles.MaxIndex_j,'Visible',state_j); 1150 %set(handles.frame_j,'Visible',state_j);1151 1163 set(handles.j_text,'Visible',state_j); 1152 1164 if ~isempty(i2_series)||~isempty(j2_series) … … 1161 1173 set(handles.TransformName,'value',2); % set transform to sub_field if the current fct doe not accept two input fields 1162 1174 end 1163 TransformName_Callback([],[],handles) 1175 set(handles.InputFileREFRESH,'BackgroundColor',[1 0 0])% set button color to red to indicate that refresh has been updated 1176 TransformName_Callback([],[],handles)% callback for the selection of transform function, then refresh the current plot 1164 1177 mask_test=get(handles.CheckMask,'value'); 1165 1178 if mask_test … … 2016 2029 if ~isempty(errormsg) 2017 2030 msgbox_uvmat('ERROR',errormsg); 2031 set(handles.InputFileREFRESH,'BackgroundColor',[1 0 1])% keep button color magenta, input not succesfull 2018 2032 else 2019 2033 set(handles.i1,'BackgroundColor',[1 1 1]) … … 2023 2037 set(handles.FileIndex,'BackgroundColor',[1 1 1]) 2024 2038 set(handles.FileIndex_1,'BackgroundColor',[1 1 1]) 2025 set(handles.REFRESH,'BackgroundColor',[1 0 0]) 2039 set(handles.REFRESH,'BackgroundColor',[1 0 0])% set button color to red, update successfull 2026 2040 end 2027 2041 … … 2040 2054 2041 2055 %% initialisation 2056 pointer=get(handles.uvmat,'Pointer'); 2057 set(handles.uvmat,'Pointer','watch') 2058 drawnow 2042 2059 if ~exist('Field','var') 2043 2060 Field={}; … … 2740 2757 end 2741 2758 ResizeFcn(handles.uvmat,[],handles) 2759 set(handles.uvmat,'Pointer',pointer) 2742 2760 2743 2761 %------------------------------------------------------------------------ … … 3579 3597 set(handles.CheckEditObject,'Value',0) 3580 3598 set(handles.CheckZoom,'Value',0) 3581 % set(handles.CheckZoom,'BackgroundColor',[0.7 0.7 0.7])3582 % set(handles.CheckEditObject,'BackgroundColor',[0.7 0.7 0.7])3583 3599 set(gcf,'Pointer','arrow') 3584 3600 else … … 3680 3696 function TransformName_Callback(hObject, eventdata, handles) 3681 3697 %------------------------------------------------------------------------ 3698 set(handles.TransformName,'backgroundColor',[1 1 0])% indicate activation of the menu 3699 drawnow 3682 3700 UvData=get(handles.uvmat,'UserData'); 3683 3701 menu=get(handles.TransformName,'String');%refresh … … 3751 3769 [fid,errormsg] =fopen([fullfile(list_path{ichoice},transform_name) '.m']); 3752 3770 InputText=textscan(fid,'%s',1,'delimiter','\n'); 3753 fclose(fid) 3771 fclose(fid); 3754 3772 set(handles.TransformName,'ToolTipString',['transform_fct: ' InputText{1}{1}])% put the first line of the selected function as tooltip help 3755 3773 end … … 3818 3836 end 3819 3837 set(handles.uvmat,'UserData',UvData) 3838 set(handles.TransformName,'backgroundColor',[1 1 1])% indicate desactivation of the menu 3839 drawnow 3820 3840 3821 3841 %% inputfilerefresh the current plot
Note: See TracChangeset
for help on using the changeset viewer.