Changeset 710 for trunk/src/series.m
- Timestamp:
- Feb 16, 2014, 5:35:45 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.