- Timestamp:
- May 23, 2014, 7:36:25 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/uvmat.m
r773 r778 636 636 % --- Executes on button press in InputFileREFRESH. 637 637 function InputFileREFRESH_Callback(hObject, eventdata, handles) 638 %------------------------------------------------------------------------ 638 %------------------------------------------------------------------------ 639 639 set(handles.InputFileREFRESH,'BackgroundColor',[1 1 0])% set button color to yellow to indicate that refresh is under action 640 640 set(handles.uvmat,'Pointer','watch') % set the mouse pointer to 'watch' … … 642 642 % read the current input file name: 643 643 [RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes(handles); 644 % if ~exist(fullfile(RootPath,SubDir),'dir')645 % msgbox_uvmat('ERROR',['directory ' fullfile(RootPath,SubDir) ' does not exist'])646 % return647 % end648 644 % detect the file type, get the movie object if relevant, and look for the corresponding file series: 649 645 [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,tild,FileType,FileInfo,MovieObject]=find_file_series(fullfile(RootPath,SubDir),[RootFile FileIndices FileExt]); 650 % initiate the input file series and inputfilerefresh the current field view: 651 errormsg=update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileInfo,MovieObject,1); 652 % inputfilerefresh the second series if selected 653 if get(handles.SubField,'Value') 646 if isempty(i1_series) 647 fileinput=uigetfile_uvmat('pick an input file',fullfile(RootPath,SubDir)); 648 hh=dir(fileinput); 649 if numel(hh)>1 650 msgbox_uvmat('ERROR','invalid input, probably a broken link'); 651 else 652 %% display the selected field and related information 653 if isempty(fileinput) 654 errormsg='aborted'; 655 else 656 display_file_name(handles,fileinput,1) 657 end 658 end 659 else 660 % initiate the input file series and refresh the current field view: 661 errormsg=update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileInfo,MovieObject,1); 662 end 663 664 %% refresh the second series if relevant 665 if ~isempty(errormsg) && get(handles.SubField,'Value') 654 666 [RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes_1(handles); 655 if ~exist(fullfile(RootPath,SubDir),'dir')656 msgbox_uvmat('ERROR',['directory ' fullfile(RootPath,SubDir) ' does not exist'])657 return658 end659 667 % detect the file type, get the movie object if relevant, and look for the corresponding file series: 660 668 [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,tild,FileType,FileInfo,MovieObject]=find_file_series(fullfile(RootPath,SubDir),[RootFile FileIndices FileExt]); 661 % initiate the input file series and inputfilerefresh the current field view: 662 errormsg=update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileInfo,MovieObject,2); 663 end 664 665 if isempty(errormsg) 666 % set(handles.InputFileREFRESH,'BackgroundColor',[1 0 0])% set button color to red to indicate that refresh has been updated 667 else 668 set(handles.InputFileREFRESH,'BackgroundColor',[1 0 1])% keep button color magenta, input not succesfull 669 if isempty(i1_series) 670 fileinput=uigetfile_uvmat('pick an input file for the second line',fullfile(RootPath,SubDir)); 671 hh=dir(fileinput); 672 if numel(hh)>1 673 msgbox_uvmat('ERROR','invalid input, probably a broken link'); 674 else 675 %% display the selected field and related information 676 if isempty(fileinput) 677 errormsg='aborted'; 678 else 679 display_file_name(handles,fileinput,2) 680 end 681 end 682 else 683 % initiate the input file series and inputfilerefresh the current field view: 684 errormsg=update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileInfo,MovieObject,2); 685 end 686 end 687 if ~isempty(errormsg) 688 set(handles.InputFileREFRESH,'BackgroundColor',[1 0 1])% put back button color to magenta, input not succesfull 669 689 end 670 690 set(handles.uvmat,'Pointer','arrow')% set back the mouse pointer to arrow … … 4696 4716 set(handles.MenuExportMovie,'BusyAction','queue')% activate the button 4697 4717 huvmat=get(handles.InputFileREFRESH,'parent'); 4698 UvData=get(huvmat,'UserData');4718 % UvData=get(huvmat,'UserData'); 4699 4719 %[xx,xx,FileBase]=read_file_boxes(handles); 4700 4720 [RootPath,SubDir,RootFile,FileIndex,FileExt]=read_file_boxes(handles); … … 4738 4758 msgbox_uvmat('INPUT_Y-N',{['adjust figure ' num2str(newfig) ' with its matlab edit menu '] ;... 4739 4759 ['then press OK to get the avi movie as a copy of figure ' num2str(newfig) ' display']}); 4740 UvData.plotaxes=newaxes;% the axis in the new figure becomes the current main plotting axes4741 set(huvmat,'UserData',UvData);4760 % UvData.plotaxes=newaxes;% the axis in the new figure becomes the current main plotting axes 4761 % set(huvmat,'UserData',UvData); 4742 4762 increment=str2num(get(handles.num_IndexIncrement,'String')); %get the field increment d 4743 4763 set(handles.STOP,'Visible','on') … … 4756 4776 set(htitle,'String',['t=' time_str]) 4757 4777 set(handles.speed,'Value',1) 4778 AxesPos=get(newaxes,'Position'); 4779 handles.PlotAxes=newaxes;% the axis in the new figure becomes the current main plotting axes 4758 4780 for i=1:imax 4759 4781 if get(handles.speed,'Value')~=0 && isequal(get(handles.MenuExportMovie,'BusyAction'),'queue') % enable STOP command 4760 4782 runpm(hObject,eventdata,handles,increment)% run plus 4783 set(newaxes,'Position',AxesPos) 4761 4784 drawnow 4762 4785 time_str=get(handles.TimeValue,'String'); … … 4769 4792 end 4770 4793 aviobj=close(aviobj); 4771 UvData=rmfield(UvData,'plotaxes');4772 set(huvmat,'UserData',UvData);4794 % UvData=rmfield(UvData,'plotaxes'); 4795 % set(huvmat,'UserData',UvData); 4773 4796 msgbox_uvmat('CONFIRMATION',{['movie ' aviname ' created '];['with ' num2str(imax) ' frames']}) 4774 4797
Note: See TracChangeset
for help on using the changeset viewer.