Changeset 710 for trunk/src/series.m


Ignore:
Timestamp:
Feb 16, 2014, 5:35:45 PM (10 years ago)
Author:
sommeria
Message:

various improvements.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series.m

    r709 r710  
    123123set(hObject,'WindowButtonDownFcn',{'mouse_down'})%allows mouse action with right button (zoom for uicontrol display)
    124124set(handles.InputTable,'KeyPressFcn',{@key_press_fcn,handles})%set keyboard action function (allow action on uvmat when set_object is in front)
     125set(hObject,'DeleteFcn',{@closefcn})%
    125126
    126127% check default input data
     
    266267function varargout = series_OutputFcn(hObject, eventdata, handles)
    267268%------------------------------------------------------------------------
    268 % varargout  cell array for returning output args (see VARARGOUT);
    269 % hObject    handle to figure
    270 % eventdata  reserved - to be defined in a future version of MATLAB
    271 % handles    structure with handles and user data (see GUIDATA)
    272 % Get default command line output from handles structure
    273269varargout{1} = handles.output;
     270
     271%------------------------------------------------------------------------
     272% --- executed when closing uvmat: delete or desactivate the associated figures if exist
     273function closefcn(gcbo,eventdata)
     274%------------------------------------------------------------------------
     275
     276% delete set_object_series if detected
     277hh=findobj(allchild(0),'name','view_object_series');
     278if ~isempty(hh)
     279    delete(hh)
     280end
     281hh=findobj(allchild(0),'name','edit_object_series');
     282if ~isempty(hh)
     283    delete(hh)
     284end
     285
     286%delete the bowser if detected
     287hh=findobj(allchild(0),'tag','browser');
     288if ~isempty(hh)
     289    delete(hh)
     290end
     291
    274292
    275293%------------------------------------------------------------------------
     
    474492function InputTable_CellEditCallback(hObject, eventdata, handles)
    475493%------------------------------------------------------------------------
    476 set(handles.REFRESH,'Visible','on')
     494set(handles.REFRESH,'BackgroundColor',[1 0 1])% set REFRESH button to magenta color to indicate that input refresh is needed
    477495% set(handles.REFRESH_title,'Visible','on')
    478496iview=eventdata.Indices(1);
     
    516534%------------------------------------------------------------------------
    517535InputTable=get(handles.InputTable,'Data');
    518 % view_set=get(handles.REFRESH,'UserData');% list of lines to refresh
    519536set(handles.REFRESH,'BackgroundColor',[1 1 0])% set REFRESH  button to yellow color (indicate activation)
    520537drawnow
     
    546563    end
    547564end
    548 set(handles.REFRESH,'Visible','off')
    549 %set(handles.REFRESH_title,'Visible','off')
     565set(handles.REFRESH,'BackgroundColor',[1 0 0])% set REFRESH  button to red color (indicate activation finished)
    550566
    551567%------------------------------------------------------------------------
     
    21632179set(handles.DeleteObject,'Visible',ProjObjectVisible)
    21642180set(handles.ViewObject,'Visible',ProjObjectVisible)
    2165 
     2181set(handles.EditObject,'Visible',ProjObjectVisible)
    21662182
    21672183%% Visibility of mask input
     
    23962412%------------------------------------------------------------------------
    23972413% --- Executes on button press in CheckObject.
    2398 %------------------------------------------------------------------------
    23992414function CheckObject_Callback(hObject, eventdata, handles)
    2400 
     2415%------------------------------------------------------------------------
    24012416hset_object=findobj(allchild(0),'tag','set_object');%find the set_object interface handle
    24022417if get(handles.CheckObject,'Value')
     
    24162431            end
    24172432            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
    24262437            %read the file
    24272438            data=xml2struct(fileinput);
    24282439            if ~isfield(data,'Type')
    24292440                msgbox_uvmat('ERROR',[fileinput ' is not an object xml file'])
     2441                set(handles.CheckObject,'Value',0)
    24302442                return
    24312443            end
     
    24502462    set(handles.ViewObject,'Visible','off');
    24512463    if ~ishandle(hset_object)
    2452     set(handles.ViewObject,'Value',0);
     2464        set(handles.ViewObject,'Value',0);
    24532465    end
    24542466    set(handles.ProjObject,'Visible','off');
     
    24712483%------------------------------------------------------------------------
    24722484% --- Executes on button press in EditObject.
    2473 %------------------------------------------------------------------------
    24742485function EditObject_Callback(hObject, eventdata, handles)
    2475 
     2486%------------------------------------------------------------------------
    24762487if get(handles.EditObject,'Value')
    24772488    set(handles.ViewObject,'Value',0)
     
    24892500%------------------------------------------------------------------------
    24902501% --- Executes on button press in DeleteObject.
    2491 %------------------------------------------------------------------------
    24922502function 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%------------------------------------------------------------------------
     2504SeriesData=get(handles.series,'UserData');
     2505SeriesData.ProjObject=[];
     2506set(handles.series,'UserData',SeriesData)
     2507set(handles.ProjObject,'String','')
     2508set(handles.ProjObject,'Visible','off')
     2509set(handles.CheckObject,'Value',0)
     2510set(handles.ViewObject,'Visible','off')
     2511set(handles.EditObject,'Visible','off')
     2512hset_object=findobj(allchild(0),'Tag','set_object');
     2513if ~isempty(hset_object)
     2514    delete(hset_object)
     2515end
     2516set(handles.DeleteObject,'Visible','off')
    25092517
    25102518%------------------------------------------------------------------------
     
    26762684
    26772685%------------------------------------------------------------------------
    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)
    26792688%------------------------------------------------------------------------
    26802689function MenuImportConfig_Callback(hObject, eventdata, handles)
     
    26822691InputTable=get(handles.InputTable,'Data');
    26832692filexml=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
     2694if ~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)
    26872697    if isequal(get(handles.RUN,'Value'),1)
    26882698        answer= msgbox_uvmat('INPUT_Y-N','stop current Action process?');
     
    26932703        end
    26942704    end
    2695     Param.Action.RUN=0; %deactivate the RUN button
     2705    Param.Action.RUN=0; %desactivate the input RUN=1
    26962706    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
    26982722    SeriesData=get(handles.series,'UserData');
    26992723    if isfield(Param,'ActionInput')%  introduce  parameters specific to an Action fct, for instance PIV parameters
     
    27082732    end
    27092733    set(handles.series,'UserData',SeriesData)
    2710     %ActionName_Callback([],[],handles)
    27112734end
    27122735
     
    29883011function series_WindowButtonMotionFcn(hObject, eventdata, handles)
    29893012set(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 MATLAB
    2996 % handles    structure with handles and user data (see GUIDATA)
    2997 
    2998 % Hints: get(hObject,'String') returns contents of TimeName as text
    2999 %        str2double(get(hObject,'String')) returns contents of TimeName as a double
    3000 
    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 MATLAB
    3006 % handles    empty - handles not created until after all CreateFcns called
    3007 
    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.