- Timestamp:
- Feb 16, 2014, 5:35:45 PM (11 years ago)
- Location:
- trunk/src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/check_files.m
r709 r710 163 163 svn_info.rep_rev=0;svn_info.cur_rev=0; 164 164 [tild,result]=system(['svn info ' dir_fct]); %get info fromn the svn server 165 t=regexp(result,'R.vision\s*:\s*(?<rev>\d+)','names');%detect 'r évision' or 'Revision' in the text165 t=regexp(result,'R.vision\s*:\s*(?<rev>\d+)','names');%detect 'rï¿œvision' or 'Revision' in the text 166 166 if ~isempty(t) 167 167 svn_info.cur_rev=str2double(t.rev); %version nbre of the current package 168 168 end 169 [tild,result]=system(['svn info -r ''HEAD'' ' pathuvmat ' &']);169 [tild,result]=system(['svn info -r ''HEAD'' ' pathuvmat]); 170 170 t=regexp(result,'R.vision\s*:\s*(?<rev>\d+)','names'); 171 171 if ~isempty(t) 172 172 svn_info.rep_rev=str2double(t.rev); % version nbre available on the svn repository 173 173 end 174 [tild,result]=system(['svn status ' pathuvmat ' &']);% '&' prevents the program to stop when the system asks password174 [tild,result]=system(['svn status ' pathuvmat]);% '&' prevents the program to stop when the system asks password 175 175 svn_info.status=result; 176 176 checkmsg =[checkmsg {['SVN revision : ' num2str(svn_info.cur_rev)]}];%display version nbre of the current uvmat package -
trunk/src/fill_GUI.m
r671 r710 25 25 end 26 26 end 27 UserData=get(GUI_handle,'UserData'); 27 UserData=get(GUI_handle,'UserData');% additional information stored in 'UserData' of the GUI 28 28 fields=fieldnames(Param);%list of fields in Param 29 29 … … 33 33 for ifield=1:numel(fields) 34 34 if isstruct(Param.(fields{ifield}))% case of a sub-structure 35 %% case of a sub-structure --> fill a panel 35 %% case of a sub-structure 36 % if a panel in the GUI has the tag fields{ifield}, fill it with the sub-structure content 36 37 if isfield(handles,fields{ifield}) 37 38 set(handles.(fields{ifield}),'Visible','on') 38 39 errormsg=fill_GUI(Param.(fields{ifield}),handles.(fields{ifield}));% recursively apply the function to the substructure 39 elseif isfield(UserData,fields{ifield})&& isfield(handles,fields{ifield})&&isfield(Param.(fields{ifield}),'Name')40 UserData.(fields{ifield})=Param.(fields{ifield});41 set(handles.(fields{ifield}),'String',Param.(fields{ifield}).Name)40 % elseif isfield(UserData,fields{ifield}) && isfield(handles,fields{ifield}) && isfield(Param.(fields{ifield}),'Name') 41 % UserData.(fields{ifield})=Param.(fields{ifield}); 42 % set(handles.(fields{ifield}),'String',Param.(fields{ifield}).Name) 42 43 end 43 44 else -
trunk/src/keyboard_callback.m
r681 r710 5 5 xx=double(get(hObject,'CurrentCharacter')); %get the keyboard character 6 6 if ~isempty(xx) 7 switch xx 8 case {29,28,30,31} %arrows for displacement 9 AxeData=get(cur_axes,'UserData'); 10 if isfield(AxeData,'ZoomAxes')&&ishandle(AxeData.ZoomAxes) 11 cur_axes=AxeData.ZoomAxes;% move the field of the zoom sub-plot instead of the main axes if it exsits 12 axes(cur_axes) 13 end 14 if ~isempty(cur_axes) 15 xlimit=get(cur_axes,'XLim'); 16 ylimit=get(cur_axes,'Ylim'); 17 dx=(xlimit(2)-xlimit(1))/10; 18 dy=(ylimit(2)-ylimit(1))/10; 19 if isequal(xx,29)%move arrow right 20 xlimit=xlimit+dx; 21 elseif isequal(xx,28)%move arrow left 22 xlimit=xlimit-dx; 23 elseif isequal(xx,30)%move arrow up 24 ylimit=ylimit+dy; 25 elseif isequal(xx,31)%move arrow down 26 ylimit=ylimit-dy; 7 switch xx 8 case {29,28,30,31} %arrows for displacement 9 AxeData=get(cur_axes,'UserData'); 10 if isfield(AxeData,'ZoomAxes')&&ishandle(AxeData.ZoomAxes) 11 cur_axes=AxeData.ZoomAxes;% move the field of the zoom sub-plot instead of the main axes if it exsits 12 axes(cur_axes) 27 13 end 28 set(cur_axes,'XLim',xlimit) 29 set(cur_axes,'YLim',ylimit) 30 hfig=hObject; %master figure 31 AxeData=get(cur_axes,'UserData'); 32 if isfield(AxeData,'ParentRect')% update the position of the parent rectangle representing the field 33 hparentrect=AxeData.ParentRect; 34 rect([1 2])=[xlimit(1) ylimit(1)]; 35 rect([3 4])=[xlimit(2)-xlimit(1) ylimit(2)-ylimit(1)]; 36 set(hparentrect,'Position',rect) 37 elseif isfield(AxeData,'LimEditBox')&& isequal(AxeData.LimEditBox,1)% update display of the GUI containing the axis (uvmat or view_field) 38 hh=guidata(hfig); 39 if isfield(hh,'num_MinX') 40 set(hh.num_MinX,'String',num2str(xlimit(1))) 41 set(hh.num_MaxX,'String',num2str(xlimit(2))) 42 set(hh.num_MinY,'String',num2str(ylimit(1))) 43 set(hh.num_MaxY,'String',num2str(ylimit(2))) 14 if ~isempty(cur_axes) 15 xlimit=get(cur_axes,'XLim'); 16 ylimit=get(cur_axes,'Ylim'); 17 dx=(xlimit(2)-xlimit(1))/10; 18 dy=(ylimit(2)-ylimit(1))/10; 19 if isequal(xx,29)%move arrow right 20 xlimit=xlimit+dx; 21 elseif isequal(xx,28)%move arrow left 22 xlimit=xlimit-dx; 23 elseif isequal(xx,30)%move arrow up 24 ylimit=ylimit+dy; 25 elseif isequal(xx,31)%move arrow down 26 ylimit=ylimit-dy; 27 end 28 set(cur_axes,'XLim',xlimit) 29 set(cur_axes,'YLim',ylimit) 30 hfig=hObject; %master figure 31 AxeData=get(cur_axes,'UserData'); 32 if isfield(AxeData,'ParentRect')% update the position of the parent rectangle representing the field 33 hparentrect=AxeData.ParentRect; 34 rect([1 2])=[xlimit(1) ylimit(1)]; 35 rect([3 4])=[xlimit(2)-xlimit(1) ylimit(2)-ylimit(1)]; 36 set(hparentrect,'Position',rect) 37 elseif isfield(AxeData,'LimEditBox')&& isequal(AxeData.LimEditBox,1)% update display of the GUI containing the axis (uvmat or view_field) 38 hh=guidata(hfig); 39 if isfield(hh,'num_MinX') 40 set(hh.num_MinX,'String',num2str(xlimit(1))) 41 set(hh.num_MaxX,'String',num2str(xlimit(2))) 42 set(hh.num_MinY,'String',num2str(ylimit(1))) 43 set(hh.num_MaxY,'String',num2str(ylimit(2))) 44 end 44 45 end 45 46 end 46 end 47 % case {8, 127} %if the delete or suppr key is pressed, delete the current object 48 % currentobject=gco; 49 % huvmat=findobj(allchild(0),'tag','uvmat'); 50 % hlist_object=findobj(huvmat,'Tag','list_object_1'); 51 % ObjIndex=get(hlist_object,'Value'); 52 % if ObjIndex>1 53 % delete_object(ObjIndex) 54 % end 55 % if ishandle(currentobject) 56 % tag=get(currentobject,'Tag');%tag of the current selected object 57 % if isequal(tag,'proj_object') 58 % delete_object(currentobject) 59 % end 60 % end 61 case 112% key 'p' 62 uvmat('runplus_Callback',hObject,eventdata,handleshaxes) 63 case 109% key 'm' 64 uvmat('runmin_Callback',hObject,eventdata,handleshaxes) 65 otherwise 66 set(handleshaxes.run0,'BackgroundColor',[1 0 1])%indicat that Run must be activated (todo: rplace by REFRESH) 47 case 112% key 'p' 48 uvmat('runplus_Callback',hObject,eventdata,handleshaxes) 49 case 109% key 'm' 50 uvmat('runmin_Callback',hObject,eventdata,handleshaxes) 51 otherwise 52 switch get(gco,'tag')% tag of the current edit box 53 case {'RootPath', 'SubDir','RootFile','FileExt','RootPath_1', 'SubDir_1','RootFile_1','FileExt_1'} 54 set(handleshaxes.REFRESH,'BackgroundColor',[1 0 1])%indicat that REFRESH must be activated (intyroduce the whole series) 55 otherwise 56 set(handleshaxes.run0,'BackgroundColor',[1 0 1])%indicat that run0 must be activated 57 end 58 end 67 59 end 68 end -
trunk/src/mouse_down.m
r691 r710 150 150 hhchildren=get(hchild,'Children');%handles of all objects in the selected panel 151 151 check_visible=strcmp(get(hhchildren,'Visible'),'on');%=1 if visible='on', =0 otherwise 152 hhchildren=hhchildren(check_visible); %keep only the visible children 152 hhchildren=hhchildren(check_visible); %keep only the visible children 153 153 PosChildren=get(hhchildren,'Position'); 154 154 PosLength=cellfun('length',PosChildren); … … 165 165 display_str=get(hhchild,'TooltipString'); 166 166 msgbox_uvmat(['uicontrol: ' get(hhchild,'Tag')],display_str,get(hhchild,'String'),msg_pos); 167 else 168 set(hObject,'CurrentObject',hhchild) 167 169 end 168 170 end 169 end 171 end 170 172 end 171 173 end … … 187 189 if strcmp(get(hObject,'SelectionType'),'alt') && strcmp(htype,'axes') && ~test_edit && ~test_create 188 190 set(0,'Unit','pixels') 189 GUISize=get(0,'ScreenSize');% get the size of the screen, to put the fig on the upper right191 %GUISize=get(0,'ScreenSize');% get the size of the screen, to put the fig on the upper right 190 192 Width=300;% fig width in points (1/72 inch) 191 193 Height=200; 192 194 Left=GUI_pos(1)+GUI_pos(3)-Width; %right edge close to the right, with margin=40 193 195 Bottom=GUI_pos(2)+GUI_pos(4)-Height; %put fig at top right 194 hfig_text=figure('Name','text_display','MenuBar','none','NumberTitle','off','Position',[Left,Bottom,Width,Height]);196 % hfig_text=figure('Name','text_display','MenuBar','none','NumberTitle','off','Position',[Left,Bottom,Width,Height]); 195 197 AxeData.htext_display=uicontrol('Style','edit','Units','normalized', 'Position', [0.05 0.05 0.9 0.9],'Max',2,'BackgroundColor',[1 1 1],... 196 198 'FontUnits','points','FontSize',14); -
trunk/src/series.m
r709 r710 123 123 set(hObject,'WindowButtonDownFcn',{'mouse_down'})%allows mouse action with right button (zoom for uicontrol display) 124 124 set(handles.InputTable,'KeyPressFcn',{@key_press_fcn,handles})%set keyboard action function (allow action on uvmat when set_object is in front) 125 set(hObject,'DeleteFcn',{@closefcn})% 125 126 126 127 % check default input data … … 266 267 function varargout = series_OutputFcn(hObject, eventdata, handles) 267 268 %------------------------------------------------------------------------ 268 % varargout cell array for returning output args (see VARARGOUT);269 % hObject handle to figure270 % eventdata reserved - to be defined in a future version of MATLAB271 % handles structure with handles and user data (see GUIDATA)272 % Get default command line output from handles structure273 269 varargout{1} = handles.output; 270 271 %------------------------------------------------------------------------ 272 % --- executed when closing uvmat: delete or desactivate the associated figures if exist 273 function closefcn(gcbo,eventdata) 274 %------------------------------------------------------------------------ 275 276 % delete set_object_series if detected 277 hh=findobj(allchild(0),'name','view_object_series'); 278 if ~isempty(hh) 279 delete(hh) 280 end 281 hh=findobj(allchild(0),'name','edit_object_series'); 282 if ~isempty(hh) 283 delete(hh) 284 end 285 286 %delete the bowser if detected 287 hh=findobj(allchild(0),'tag','browser'); 288 if ~isempty(hh) 289 delete(hh) 290 end 291 274 292 275 293 %------------------------------------------------------------------------ … … 474 492 function InputTable_CellEditCallback(hObject, eventdata, handles) 475 493 %------------------------------------------------------------------------ 476 set(handles.REFRESH,' Visible','on')494 set(handles.REFRESH,'BackgroundColor',[1 0 1])% set REFRESH button to magenta color to indicate that input refresh is needed 477 495 % set(handles.REFRESH_title,'Visible','on') 478 496 iview=eventdata.Indices(1); … … 516 534 %------------------------------------------------------------------------ 517 535 InputTable=get(handles.InputTable,'Data'); 518 % view_set=get(handles.REFRESH,'UserData');% list of lines to refresh519 536 set(handles.REFRESH,'BackgroundColor',[1 1 0])% set REFRESH button to yellow color (indicate activation) 520 537 drawnow … … 546 563 end 547 564 end 548 set(handles.REFRESH,'Visible','off') 549 %set(handles.REFRESH_title,'Visible','off') 565 set(handles.REFRESH,'BackgroundColor',[1 0 0])% set REFRESH button to red color (indicate activation finished) 550 566 551 567 %------------------------------------------------------------------------ … … 2163 2179 set(handles.DeleteObject,'Visible',ProjObjectVisible) 2164 2180 set(handles.ViewObject,'Visible',ProjObjectVisible) 2165 2181 set(handles.EditObject,'Visible',ProjObjectVisible) 2166 2182 2167 2183 %% Visibility of mask input … … 2396 2412 %------------------------------------------------------------------------ 2397 2413 % --- Executes on button press in CheckObject. 2398 %------------------------------------------------------------------------2399 2414 function CheckObject_Callback(hObject, eventdata, handles) 2400 2415 %------------------------------------------------------------------------ 2401 2416 hset_object=findobj(allchild(0),'tag','set_object');%find the set_object interface handle 2402 2417 if get(handles.CheckObject,'Value') … … 2416 2431 end 2417 2432 fileinput=uigetfile_uvmat('pick a xml object file (or use uvmat to create it)',defaultname,'.xml'); 2418 % [FileName, PathName] = uigetfile( ... 2419 % {'*.xml;*.mat', ' (*.xml,*.mat)'; 2420 % '*.xml', '.xml files '; ... 2421 % '*.mat', '.mat matlab files '}, ... 2422 % 'Pick an xml object file (or use uvmat to create it)',defaultname); 2423 % fileinput=[PathName FileName];%complete file name 2424 % sizf=size(fileinput); 2425 if isempty(fileinput),return;end 2433 if isempty(fileinput)% exit if no object file is selected 2434 set(handles.CheckObject,'Value',0) 2435 return 2436 end 2426 2437 %read the file 2427 2438 data=xml2struct(fileinput); 2428 2439 if ~isfield(data,'Type') 2429 2440 msgbox_uvmat('ERROR',[fileinput ' is not an object xml file']) 2441 set(handles.CheckObject,'Value',0) 2430 2442 return 2431 2443 end … … 2450 2462 set(handles.ViewObject,'Visible','off'); 2451 2463 if ~ishandle(hset_object) 2452 set(handles.ViewObject,'Value',0);2464 set(handles.ViewObject,'Value',0); 2453 2465 end 2454 2466 set(handles.ProjObject,'Visible','off'); … … 2471 2483 %------------------------------------------------------------------------ 2472 2484 % --- Executes on button press in EditObject. 2473 %------------------------------------------------------------------------2474 2485 function EditObject_Callback(hObject, eventdata, handles) 2475 2486 %------------------------------------------------------------------------ 2476 2487 if get(handles.EditObject,'Value') 2477 2488 set(handles.ViewObject,'Value',0) … … 2489 2500 %------------------------------------------------------------------------ 2490 2501 % --- Executes on button press in DeleteObject. 2491 %------------------------------------------------------------------------2492 2502 function DeleteObject_Callback(hObject, eventdata, handles) 2493 2494 % if get(handles.DeleteObject,'Value') 2495 SeriesData=get(handles.series,'UserData'); 2496 SeriesData.ProjObject=[]; 2497 set(handles.series,'UserData',SeriesData) 2498 set(handles.ProjObject,'String','') 2499 set(handles.CheckObject,'Value',0) 2500 set(handles.ViewObject,'Visible','off') 2501 set(handles.EditObject,'Visible','off') 2502 hset_object=findobj(allchild(0),'Tag','set_object'); 2503 if ~isempty(hset_object) 2504 delete(hset_object) 2505 end 2506 set(handles.DeleteObject,'Visible','off') 2507 % set(handles.DeleteObject,'Value',0) 2508 % end 2503 %------------------------------------------------------------------------ 2504 SeriesData=get(handles.series,'UserData'); 2505 SeriesData.ProjObject=[]; 2506 set(handles.series,'UserData',SeriesData) 2507 set(handles.ProjObject,'String','') 2508 set(handles.ProjObject,'Visible','off') 2509 set(handles.CheckObject,'Value',0) 2510 set(handles.ViewObject,'Visible','off') 2511 set(handles.EditObject,'Visible','off') 2512 hset_object=findobj(allchild(0),'Tag','set_object'); 2513 if ~isempty(hset_object) 2514 delete(hset_object) 2515 end 2516 set(handles.DeleteObject,'Visible','off') 2509 2517 2510 2518 %------------------------------------------------------------------------ … … 2676 2684 2677 2685 %------------------------------------------------------------------------ 2678 % --- fct activated by the upper bar menu InportConfig 2686 % --- fct activated by the upper bar menu InportConfig: import 2687 % menu settings from an xml file (stored in /0_XML for each run) 2679 2688 %------------------------------------------------------------------------ 2680 2689 function MenuImportConfig_Callback(hObject, eventdata, handles) … … 2682 2691 InputTable=get(handles.InputTable,'Data'); 2683 2692 filexml=uigetfile_uvmat('pick a xml parameter file',InputTable{1,1},'.xml');% get the xml file containing processing parameters 2684 if ~isempty(filexml)%abandon if no file is introduced by the browser 2685 Param=xml2struct(filexml); 2686 % stop current Action if button RUN has been activated 2693 %proceed only if a file has been introduced by the browser 2694 if ~isempty(filexml) 2695 Param=xml2struct(filexml);% read the input xml file as a Matlab structure 2696 % ask to stop current Action if button RUN is in action (another process is already running) 2687 2697 if isequal(get(handles.RUN,'Value'),1) 2688 2698 answer= msgbox_uvmat('INPUT_Y-N','stop current Action process?'); … … 2693 2703 end 2694 2704 end 2695 Param.Action.RUN=0; %de activate the RUN button2705 Param.Action.RUN=0; %desactivate the input RUN=1 2696 2706 fill_GUI(Param,handles.series)% fill the elements of the GUI series with the input parameters 2697 REFRESH_Callback([],[],handles)% refresh data relative to the input files 2707 if isfield(Param,'CheckObject') && isequal(Param.CheckObject,1) 2708 set(handles.ProjObject,'String',Param.ProjObject.Name) 2709 set(handles.ViewObject,'Visible','on') 2710 set(handles.EditObject,'Visible','on') 2711 set(handles.DeleteObject,'Visible','on') 2712 else 2713 set(handles.ProjObject,'String','') 2714 set(handles.ProjObject,'Visible','off') 2715 set(handles.ViewObject,'Visible','off') 2716 set(handles.EditObject,'Visible','off') 2717 set(handles.DeleteObject,'Visible','off') 2718 end 2719 % set(handles.REFRESH,'Visible','on') 2720 set(handles.REFRESH,'BackgroundColor',[1 0 1]); %paint REFRESH button in magenta to indicate that it should be activated 2721 % REFRESH_Callback([],[],handles)% refresh data relative to the input files 2698 2722 SeriesData=get(handles.series,'UserData'); 2699 2723 if isfield(Param,'ActionInput')% introduce parameters specific to an Action fct, for instance PIV parameters … … 2708 2732 end 2709 2733 set(handles.series,'UserData',SeriesData) 2710 %ActionName_Callback([],[],handles)2711 2734 end 2712 2735 … … 2988 3011 function series_WindowButtonMotionFcn(hObject, eventdata, handles) 2989 3012 set(hObject,'Pointer','arrow'); 2990 2991 2992 2993 function TimeName_Callback(hObject, eventdata, handles)2994 % hObject handle to TimeName (see GCBO)2995 % eventdata reserved - to be defined in a future version of MATLAB2996 % handles structure with handles and user data (see GUIDATA)2997 2998 % Hints: get(hObject,'String') returns contents of TimeName as text2999 % str2double(get(hObject,'String')) returns contents of TimeName as a double3000 3001 3002 % --- Executes during object creation, after setting all properties.3003 function TimeName_CreateFcn(hObject, eventdata, handles)3004 % hObject handle to TimeName (see GCBO)3005 % eventdata reserved - to be defined in a future version of MATLAB3006 % handles empty - handles not created until after all CreateFcns called3007 3008 % Hint: edit controls usually have a white background on Windows.3009 % See ISPC and COMPUTER.3010 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))3011 set(hObject,'BackgroundColor','white');3012 end -
trunk/src/series/civ_input.m
r707 r710 103 103 if ~strcmp(Param.Action.ActionName,'civ_series') 104 104 msgbox_uvmat('ERROR','bad input data file: open an image or a nc file from civ_series') 105 return105 %return 106 106 end 107 107 NomTypeNc=NomTypeInput; … … 109 109 if isempty(regexp(NomTypeInput,'[ab|AB|-]', 'once')) 110 110 set(handles.ListCompareMode,'Value',2) %mode displacement advised if the nomencalture does not involve index pairs 111 set(handles.RootFile_1,'Visible','On');111 % set(handles.RootFile_1,'Visible','On'); 112 112 else 113 113 set(handles.ListCompareMode,'Value',1) 114 % set(handles.RootFile_1,'Visible','Off');115 114 end 116 115 imageinput=''; -
trunk/src/uvmat.m
r709 r710 210 210 set(hObject,'DeleteFcn',{@closefcn})% 211 211 set(hObject,'ResizeFcn',{@ResizeFcn,handles})% 212 % set(handles.RootPath,'ButtonDownFcn',{'@mouse_down_control'})%set mouse click action function 212 213 213 214 %% initialisation … … 319 320 % --- Outputs from this function are returned to the command menuline. 320 321 function varargout = uvmat_OutputFcn(hObject, eventdata, handles) 322 %------------------------------------------------------------------------ 321 323 varargout{1} = handles.output;% the only output argument is the handle to the GUI figure 322 324 … … 325 327 function closefcn(gcbo,eventdata) 326 328 %------------------------------------------------------------------------ 329 % delete GUI 'view_field' if detected 327 330 hh=findobj(allchild(0),'tag','view_field'); 328 331 if ~isempty(hh) 329 332 delete(hh) 330 333 end 334 % delete GUI 'geometry_calib' if detected 331 335 hh=findobj(allchild(0),'tag','geometry_calib'); 332 336 if ~isempty(hh) 333 337 delete(hh) 334 338 end 339 % desable set_object editing action if detected 335 340 hh=findobj(allchild(0),'tag','set_object'); 336 341 if ~isempty(hh) 337 342 hhh=findobj(hh,'tag','PLOT'); 338 343 set(hhh,'enable','off') 344 end 345 %delete the bowser if detected 346 hh=findobj(allchild(0),'tag','browser'); 347 if ~isempty(hh) 348 delete(hh) 339 349 end 340 350 … … 450 460 else 451 461 452 %% display the selected field and related information453 if ~isempty(fileinput)454 set(handles.SubField,'Value',0)455 desable_subfield(handles)456 display_file_name(handles,fileinput)457 end462 %% display the selected field and related information 463 if ~isempty(fileinput) 464 set(handles.SubField,'Value',0) 465 desable_subfield(handles) 466 display_file_name(handles,fileinput) 467 end 458 468 end 459 469 … … 564 574 565 575 %------------------------------------------------------------------------ 566 % --- Called by action in RootPath edit box567 function RootPath_Callback(hObject,eventdata,handles)568 %------------------------------------------------------------------------569 % read the current input file name:570 [RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes(handles);571 if ~exist(fullfile(RootPath,SubDir),'dir')572 msgbox_uvmat('ERROR',['directory ' fullfile(RootPath,SubDir) ' does not exist'])573 return574 end575 % detect the file type, get the movie object if relevant, and look for the corresponding file series:576 [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,tild,FileType,FileInfo,MovieObject]=find_file_series(fullfile(RootPath,SubDir),[RootFile FileIndices FileExt]);577 % initiate the input file series and refresh the current field view:578 update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileType,MovieObject,1);579 580 %-----------------------------------------------------------------------581 % --- Called by action in RootPath_1 edit box582 function RootPath_1_Callback(hObject,eventdata,handles)583 % -----------------------------------------------------------------------584 % update_rootinfo_1(hObject,eventdata,handles)585 [RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes_1(handles);586 if ~exist(fullfile(RootPath,SubDir),'dir')587 msgbox_uvmat('ERROR',['directory ' fullfile(RootPath,SubDir) ' does not exist'])588 return589 end590 % detect the file type, get the movie object if relevant, and look for the corresponding file series:591 [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,tild,FileType,MovieObject]=find_file_series(fullfile(RootPath,SubDir),[RootFile FileIndices FileExt]);592 % initiate the input file series and refresh the current field view:593 update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileType,MovieObject,2);594 595 %------------------------------------------------------------------------596 % --- Called by action in RootFile edit box597 function SubDir_Callback(hObject, eventdata, handles)598 %------------------------------------------------------------------------599 %refresh the menu of input fieldname600 FieldName_Callback(hObject, eventdata, handles);601 % refresh the current field view602 run0_Callback(hObject, eventdata, handles);603 604 %------------------------------------------------------------------------605 % --- Called by action in RootFile edit box606 function RootFile_Callback(hObject, eventdata, handles)607 %------------------------------------------------------------------------608 RootPath_Callback(hObject,eventdata,handles)609 610 %-----------------------------------------------------------------------611 % --- Called by action in RootFile_1 edit box612 function RootFile_1_Callback(hObject, eventdata, handles)613 % -----------------------------------------------------------------------614 RootPath_1_Callback(hObject,eventdata,handles)615 616 %------------------------------------------------------------------------617 576 % --- Called by action in FileIndex edit box 618 577 function FileIndex_Callback(hObject, eventdata, handles) … … 624 583 set(handles.j2,'String',num2str(j2)); 625 584 626 % refresh the current field view627 run0_Callback(hObject, eventdata, handles)628 629 %------------------------------------------------------------------------630 % --- Called by action in FileIndex_1 edit box631 function FileIndex_1_Callback(hObject, eventdata, handles)632 %------------------------------------------------------------------------633 run0_Callback(hObject, eventdata, handles)634 585 635 586 %------------------------------------------------------------------------ … … 658 609 % refresh the current settings and refresh the field view 659 610 RootPath_1_Callback(hObject,eventdata,handles) 611 612 %------------------------------------------------------------------------ 613 % --- Executes on button press in REFRESH. 614 function REFRESH_Callback(hObject, eventdata, handles) 615 %------------------------------------------------------------------------ 616 set(handles.REFRESH,'BackgroundColor',[1 1 0])% set button color to yellow to indicate that refresh is under action 617 % read the current input file name: 618 [RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes(handles); 619 % if ~exist(fullfile(RootPath,SubDir),'dir') 620 % msgbox_uvmat('ERROR',['directory ' fullfile(RootPath,SubDir) ' does not exist']) 621 % return 622 % end 623 % detect the file type, get the movie object if relevant, and look for the corresponding file series: 624 [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,tild,FileType,FileInfo,MovieObject]=find_file_series(fullfile(RootPath,SubDir),[RootFile FileIndices FileExt]); 625 % initiate the input file series and refresh the current field view: 626 errormsg=update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileType,MovieObject,1); 627 % refresh the second series if selected 628 if get(handles.SubField,'Value') 629 [RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes_1(handles); 630 if ~exist(fullfile(RootPath,SubDir),'dir') 631 msgbox_uvmat('ERROR',['directory ' fullfile(RootPath,SubDir) ' does not exist']) 632 return 633 end 634 % detect the file type, get the movie object if relevant, and look for the corresponding file series: 635 [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,tild,FileType,MovieObject]=find_file_series(fullfile(RootPath,SubDir),[RootFile FileIndices FileExt]); 636 % initiate the input file series and refresh the current field view: 637 errormsg=update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileType,MovieObject,2); 638 end 639 640 if isempty(errormsg) 641 set(handles.REFRESH,'BackgroundColor',[1 0 0])% set button color to red to indicate that refresh has been updated 642 else 643 set(handles.REFRESH,'BackgroundColor',[1 0 1])% keep button color magenta, input not succesfull 644 end 660 645 661 646 %------------------------------------------------------------------------ … … 696 681 set(handles.TimeValue_1,'Visible','on') 697 682 end 698 set(handles _RootPath,'BackgroundColor',[1 1 0])% paint edit boxto yellow to visualise root file input683 set(handles.REFRESH,'BackgroundColor',[1 1 0])% paint REFRESH button to yellow to visualise root file input 699 684 set(handles.uvmat,'Pointer','watch') % set the mouse pointer to 'watch' 700 685 drawnow … … 840 825 end 841 826 842 set(handles _RootPath,'BackgroundColor',[1 1 1])% paint back edit box to white to visualise end of root file input827 set(handles.REFRESH,'BackgroundColor',[1 0 0])% paint back button to red to indicate update is finished 843 828 set(handles.uvmat,'Pointer','arrow')% set back the mouse pointer to arrow 844 829 … … 847 832 % --- Update information about a new field series (indices to scan, timing, 848 833 % calibration from an xml file, then refresh current plots 849 850 function update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileType,VideoObject,index) 851 %------------------------------------------------------------------------ 834 function errormsg=update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileType,VideoObject,index) 835 %------------------------------------------------------------------------ 836 errormsg=''; %default error msg 852 837 %% define the relevant handles depending on the index (1=first file series, 2= second file series) 853 838 if ~exist('index','var') … … 878 863 FileBase=fullfile(RootPath,RootFile); 879 864 if ~exist(FileName,'file') 880 msgbox_uvmat('ERROR',['input file ' FileName ' not found']); 865 errormsg=['input file ' FileName ' not found']; 866 msgbox_uvmat('ERROR',errormsg); 881 867 return 882 868 end … … 930 916 NbSlice=1;%default 931 917 ImaDoc_str=''; 932 set(handles.R ootPath,'BackgroundColor',[1 1 1])918 set(handles.REFRESH,'BackgroundColor',[1 1 0]) 933 919 if ~isempty(XmlFileName) 934 920 set(handles.view_xml,'Visible','on') … … 1370 1356 end 1371 1357 Mask.Path=MaskPath; 1372 Mask.File=MaskFile{1}; 1358 if isempty(MaskFile) 1359 Mask.File=''; 1360 else 1361 Mask.File=MaskFile{1}; 1362 end 1373 1363 Mask.Ext=MaskExt; 1374 1364 Mask.NomType=MaskNomType; … … 1980 1970 set(handles.j2,'BackgroundColor',[1 1 1])% mark the edit box in white to indicate its use as input 1981 1971 set(handles.FileIndex,'BackgroundColor',[1 1 1])% mark the edit box in white to indicate its use as input 1982 while get(handles.speed,'Value')~=0 && isequal(get(handles.movie_pair,'BusyAction'),'queue') %isequal(get(handles.run0,'BusyAction'),'queue');% enable STOP command1972 while get(handles.speed,'Value')~=0 && isequal(get(handles.movie_pair,'BusyAction'),'queue') % enable STOP command 1983 1973 % read and plot the series of images in non erase mode 1984 1974 set(hima,'CData',Field_b.A); … … 4841 4831 [RootPath,SubDir,RootFile,FileIndex,FileExt]=read_file_boxes(handles); 4842 4832 FileName=[fullfile(RootPath,SubDir,RootFile) FileIndex FileExt]; 4843 set(handles.view_xml,'Backgroundcolor',[1 1 0])%indicate the reading of the current xml file by geometry_calib 4844 % pos_uvmat=get(handles.uvmat,'Position'); 4845 % pos_cal(1)=pos_uvmat(1)+UvData.OpenParam.PosGeometryCalib(1)*pos_uvmat(3); 4846 % pos_cal(2)=pos_uvmat(2)+UvData.OpenParam.PosGeometryCalib(2)*pos_uvmat(4); 4847 % pos_cal(3:4)=UvData.OpenParam.PosGeometryCalib(3:4).* pos_uvmat(3:4); 4833 set(handles.view_xml,'BackgroundColor',[1 1 0])%indicate the reading of the current xml file by geometry_calib 4848 4834 geometry_calib(FileName);% call the geometry_calib interface 4849 set(handles.view_xml,'Background color',[1 1 1])%indicate the end of reading of the current xml file by geometry_calib4835 set(handles.view_xml,'BackgroundColor',[1 1 1])%indicate the end of reading of the current xml file by geometry_calib 4850 4836 set(handles.MenuCalib,'checked','on')% indicate that MenuCalib is activated, test used by mouse action 4851 4837 … … 4879 4865 ObjectData=UvData.ProjObject(val); 4880 4866 for iobj=1:length(ObjectData) 4881 % if isfield(ObjectData{iobj},'Coord')4882 4867 xA(iobj)=ObjectData{iobj}.Coord(1,1); 4883 4868 yA(iobj)=ObjectData{iobj}.Coord(1,2); 4884 4869 xB(iobj)=ObjectData{iobj}.Coord(2,1); 4885 4870 yB(iobj)=ObjectData{iobj}.Coord(2,2); 4886 % end4887 4871 end 4888 4872 end … … 5065 5049 end 5066 5050 end 5067 % end5068 5051 %mask name 5069 5052 RootPath=get(handles.RootPath,'String'); … … 5076 5059 masknumber=num2str(length(list)); 5077 5060 maskindex=get(handles.masklevel,'Value'); 5078 % mask_name=fullfile_uvmat(RootPath,'',[RootFile '_' masknumber 'mask'],'.png','_1',maskindex);5079 5061 mask_name=fullfile_uvmat(RootPath,[SubDir '.mask'],'mask','.png','_1',maskindex); 5080 5062 imflag=uint8(255*(0.392+0.608*flag));% =100 for flag=0 (vectors not computed when 20<imflag<200) … … 5110 5092 set(handles.edit_vect,'Value',0) 5111 5093 edit_vect_Callback(hObject, eventdata, handles) 5112 % set(handles.CheckEditObject,'BackgroundColor',[0.7 0.7 0.7])5113 5094 set(handles.ListObject,'Value',1) 5114 5095
Note: See TracChangeset
for help on using the changeset viewer.