Changeset 688 for trunk/src/uvmat.m


Ignore:
Timestamp:
Sep 27, 2013, 11:20:34 AM (7 years ago)
Author:
sommeria
Message:

bug correction on xml time reading
some cleaning of the GUI uvmat
improvement of option 'contours' in plot_field

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/uvmat.m

    r686 r688  
    696696
    697697if strcmp(FileType,'txt')
    698     edit(fileinput)
     698    try
     699        edit(fileinput)
     700    catch ME
     701        msgbox_uvmat('ERROR','invalid intput file')
     702    end
    699703    return
    700704elseif strcmp(FileType,'xml')
     
    922926    drawnow
    923927    [XmlDataRead,warntext]=imadoc2struct(XmlFileName);
     928    if ~isempty(warntext)
     929        msgbox_uvmat('WARNING',warntext)
     930    end
    924931    if ~isempty(XmlDataRead)
    925         ImaDoc_str=['view ' DocExt];  % DocExt= '.xml' or .civ (obsolete case)   
    926             if isfield(XmlDataRead,'TimeUnit')&& ~isempty(XmlDataRead.TimeUnit)
    927                 TimeUnit=XmlDataRead.TimeUnit;
    928             end
    929                     if isfield(XmlDataRead,'Time')&& ~isempty(XmlDataRead.Time)
    930                 XmlData.Time=XmlDataRead.TimeUnit;
    931             end
     932        ImaDoc_str=['view ' DocExt];  % DocExt= '.xml' or .civ (obsolete case)
     933        %XmlData=XmlDataRead;
     934        if isfield(XmlDataRead,'TimeUnit')&& ~isempty(XmlDataRead.TimeUnit)
     935            TimeUnit=XmlDataRead.TimeUnit;
     936        end
     937        if isfield(XmlDataRead,'Time')&& ~isempty(XmlDataRead.Time)
     938            XmlData.Time=XmlDataRead.Time;
     939        end
    932940        set(handles.view_xml,'BackgroundColor',[1 1 1])% paint back to white
    933941        drawnow
     
    937945                set (handles.slices,'String','volume')
    938946            end
    939             % check whether the GUI geometry_calib is opened 
     947            % check whether the GUI geometry_calib is opened
    940948            hgeometry_calib=findobj('tag','geometry_calib');
    941949            if ~isempty(hgeometry_calib) % check whether the display of the GUI geometry_calib is consistent with the current calib param
     
    10461054if ~isempty(TimeUnit)
    10471055    if index==2 && isfield(UvData,'TimeUnit') && ~strcmp(UvData.TimeUnit,TimeUnit)
    1048         warntext=['time unit for second file series ' TimeUnit ' inconsistent with first series'];
     1056        msgbox_uvmat('WARNING',['time unit for second file series ' TimeUnit ' inconsistent with first series'])
    10491057    else
    10501058        UvData.TimeUnit=TimeUnit;
     
    10551063
    10561064%display warning message
    1057 if ~isempty(warntext)
     1065if ~isequal(warntext,'')
    10581066    msgbox_uvmat('WARNING',warntext);
    10591067end
     
    37753783%-------------------------------------------------------------------
    37763784val=get(handles.ListContour,'Value');
    3777 if val==2
     3785if val==2% option 'contours'
    37783786    set(handles.interval_txt,'Visible','on')
    37793787    set(handles.num_IncrA,'Visible','on')
    3780 else
     3788    set(handles.num_IncrA,'String','')% refresh contour interval
     3789%     set(handles.opacity_txt,'Visible','off')
     3790%     set(handles.num_Opacity,'Visible','off')
     3791else % option 'image'
    37813792    set(handles.interval_txt,'Visible','off')
    37823793    set(handles.num_IncrA,'Visible','off')
     3794%     set(handles.opacity_txt,'Visible','on')
     3795%     set(handles.num_Opacity,'Visible','on')
    37833796end
    37843797update_plot(handles);
     
    38133826function CheckFixVectors_Callback(hObject, eventdata, handles)
    38143827%-------------------------------------------------------------------
    3815 test=get(handles.CheckFixVectors,'Value');
    3816 if test
    3817 %     set(handles.CheckFixVectors,'BackgroundColor',[1 1 0])
    3818 else
     3828if ~get(handles.CheckFixVectors,'Value')
    38193829    update_plot(handles);
    3820     %set(handles.num_VecScale,'String',num2str(ScalOut.num_VecScale,3))
    3821 %     set(handles.CheckFixVectors,'BackgroundColor',[0.7 0.7 0.7])
    38223830end
    38233831
     
    40244032function update_plot(handles)
    40254033%-------------------------------------------------------------------
     4034set(handles.run0,'BackgroundColor',[1 1 0]);% indicate plot activity by yellow color
     4035drawnow
    40264036UvData=get(handles.uvmat,'UserData');
    40274037AxeData=UvData.PlotAxes;% retrieve the current plotted data
     
    40294039[tild,PlotParamOut]= plot_field(AxeData,handles.PlotAxes,PlotParam);
    40304040errormsg=fill_GUI(PlotParamOut,handles.uvmat);
    4031 RUNColor=get(handles.run0,'BackgroundColor');%
    4032 if isequal(RUNColor,[1 0 1])% suppress magenta color (indicate that plot is  updated)
    4033     set(handles.run0,'BackgroundColor',[1 0 0]);
    4034 end
     4041if ~isempty(errormsg)
     4042    msgbox_uvmat('ERROR',errormsg)
     4043    return
     4044end
     4045% RUNColor=get(handles.run0,'BackgroundColor');%
     4046% if isequal(RUNColor,[1 0 1])% suppress magenta color (indicate that plot is  updated)
     4047%     set(handles.run0,'BackgroundColor',[1 0 0]);
     4048% end
     4049set(handles.run0,'BackgroundColor',[1 0 0]);
    40354050
    40364051%------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.