Changeset 650 for trunk/src


Ignore:
Timestamp:
Jun 17, 2013, 6:46:06 PM (11 years ago)
Author:
sommeria
Message:

bugs corrected: handles.TimeName? in uvmat, 0_OAR emptied for culter computations with series.

Location:
trunk/src
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/calc_field_interp.m

    r648 r650  
    3232    r=regexp(FieldName{ilist},'(?<Operator>(^vec|^norm|^curl|^div|^strain))\((?<UName>.+),(?<VName>.+)\)$','names');% analyse the field name
    3333    if isempty(r) % the field name is a variable itself
    34         ivar=strcmp(FieldName{ilist},Data.ListVarName);
     34        ivar=find(strcmp(FieldName{ilist},Data.ListVarName));
    3535        if isempty(ivar)
    3636            check_skipped(ilist)=1; %variable not found
    3737        else
    38             if isfield(Data.VarAttribute{ivar},'Role')&&strcmp(Data.VarAttribute{ivar}.Role,'ancillary')
    39                 check_skipped(ilist)=1; % ancillary variable, not found interpolated     
     38            if isfield(Data.VarAttribute{ivar},'Role') &&...
     39                (strcmp(Data.VarAttribute{ivar}.Role,'ancillary')||strcmp(Data.VarAttribute{ivar}.Role,'warnflag')||strcmp(Data.VarAttribute{ivar}.Role,'errorflag'))
     40                check_skipped(ilist)=1; % ancillary variable, not interpolated     
    4041            elseif isempty(find(strcmp(FieldName{ilist},InputVarList), 1));
    4142                InputVarList=[InputVarList FieldName{ilist}];% the variable is added to the list of input variables if it is not already in the list
  • trunk/src/mouse_down.m

    r627 r650  
    5959    UvData=get(huvmat,'UserData');
    6060    test_ruler=isequal(get(hhuvmat.MenuRuler,'checked'),'on');%test for ruler  action, second priority;
    61     test_edit=get(hhuvmat.edit_object,'Value')&& (isequal(obj_tag,'proj_object')||isequal(obj_tag,'DeformPoint'));%test for object editing, third priority
     61    test_edit=get(hhuvmat.CheckEditObject,'Value')&& (isequal(obj_tag,'proj_object')||isequal(obj_tag,'DeformPoint'));%test for object editing, third priority
    6262    hset_object=findobj(allchild(0),'tag','set_object');
    6363    if ~isempty(hset_object)
    6464        hPLOT=findobj(hset_object,'tag','PLOT');
    65         test_create=strcmp(get(hPLOT,'enable'),'on') &&~get(hhuvmat.edit_object,'Value');% create new object if set_object is in mode enable and uvmat not in mode 'edit_object'
     65        test_create=strcmp(get(hPLOT,'enable'),'on') &&~get(hhuvmat.CheckEditObject,'Value');% create new object if set_object is in mode enable and uvmat not in mode 'EditObject'
    6666    end
    6767    test_edit_vect=get(hhuvmat.edit_vect,'Value') && ~test_create && ~(isequal(obj_tag,'proj_object')||isequal(obj_tag,'DeformPoint')) ;%test for vector editing,  priority 4
     
    370370        UvData.ProjObject{IndexObj}.DisplayHandle.uvmat=hhuvmat.PlotAxes; % axes for plot_object
    371371        UvData.ProjObject{IndexObj}.DisplayHandle.view_field=[]; %no plot handle before plot_field operation
    372         set(hhuvmat.ViewObject,'Value',1)
     372        set(hhuvmat.CheckViewObject,'Value',1)
    373373    end
    374374    ObjectData.Coord=[ObjectData.Coord ;xy(1,1:2)];% append the coordinates marked by the mouse to the object
  • trunk/src/mouse_motion.m

    r627 r650  
    5454if ~isempty(huvmat)
    5555    hhuvmat=guidata(huvmat);%handles of the elements in uvma
    56     test_edit_object=get(hhuvmat.edit_object,'Value');
     56    test_edit_object=get(hhuvmat.CheckEditObject,'Value');
    5757    test_ruler=isequal(get(hhuvmat.MenuRuler,'checked'),'on');
    5858end
  • trunk/src/mouse_up.m

    r627 r650  
    169169                end
    170170            end
    171             set(hhuvmat.ViewField,'Value',1);%
    172             set(hhuvmat.edit_object,'Value',1);%           
    173             set(hhuvmat.edit_object,'Enable','on');%
    174 %            set(hhuvmat.MenuEditObject,'Enable','on');%
    175 %            set(hhuvmat.MenuEdit,'Enable','on');%
     171            set(hhuvmat.CheckViewField,'Value',1);%
     172            set(hhuvmat.CheckEditObject,'Value',1);%           
     173            set(hhuvmat.CheckEditObject,'Enable','on');%
    176174            set(get(h_set_object,'children'),'Enable','on')
    177175        end
  • trunk/src/plot_object.m

    r625 r650  
    131131
    132132%% determine the coordinates xline, yline,xsup,xinf, yinf,ysup determining the new object plot
    133 test_line= isequal(ObjectData.Type,'points')|isequal(ObjectData.Type,'line')|isequal(ObjectData.Type,'polyline')|...
    134     isequal(ObjectData.Type,'polygon')| isequal(ObjectData.Type,'plane')| isequal(ObjectData.Type,'volume');
     133test_line= isequal(ObjectData.Type,'points')||isequal(ObjectData.Type,'line')||isequal(ObjectData.Type,'line_x')||isequal(ObjectData.Type,'line_y')||...
     134    isequal(ObjectData.Type,'polyline')||isequal(ObjectData.Type,'polygon')|| isequal(ObjectData.Type,'plane')|| isequal(ObjectData.Type,'volume');
    135135test_patch=isequal(ObjectData.ProjMode,'inside')||isequal(ObjectData.ProjMode,'outside')||isequal(ObjectData.Type,'volume')...
    136136    ||isequal(ObjectData.ProjMode,'mask_inside')||isequal(ObjectData.ProjMode,'mask_outside');
     
    139139    yline=ObjectData.Coord(:,2);
    140140    nbpoints=numel(xline);
    141     if isequal(ObjectData.Type,'polygon')
     141    if isequal(ObjectData.Type,'line_x')
     142        xline=[xline; ObjectData.RangeX(2)];%creating the line
     143        yline=[yline; ObjectData.RangeY(2)];%creating the line
     144    elseif isequal(ObjectData.Type,'polygon')
    142145        xline=[xline; ObjectData.Coord(1,1)];%closing the line
    143146        yline=[yline; ObjectData.Coord(1,2)];
  • trunk/src/proj_field.m

    r648 r650  
    622622    %% identify vector components
    623623    testU=isfield(CellInfo{icell},'VarIndex_vector_x') &&isfield(CellInfo{icell},'VarIndex_vector_y') ;% test for vectors
    624     if testU
    625         UName=FieldData.ListVarName{CellInfo{icell}.VarIndex_vector_x};
    626         VName=FieldData.ListVarName{CellInfo{icell}.VarIndex_vector_y};
    627         vector_x=FieldData.(UName);
    628         vector_y=FieldData.(VName);
    629     end
     624%     if testU
     625%         UName=FieldData.ListVarName{CellInfo{icell}.VarIndex_vector_x};
     626%         VName=FieldData.ListVarName{CellInfo{icell}.VarIndex_vector_y};
     627%         vector_x=FieldData.(UName);
     628%         vector_y=FieldData.(VName);
     629%     end
    630630    %identify error flag
    631631    errorflag=0; %default, no error flag
     
    635635    end
    636636    VarName=FieldData.ListVarName(VarIndex);% cell array of the names of variables to pje
     637    ivar_U=[];
     638    ivar_V=[];
    637639    %% check needed object properties for unstructured positions (position given by the variables with role coord_x, coord_y
    638640   
     
    647649            coord_x=FieldData.(XName);
    648650            coord_y=FieldData.(YName);
     651            ProjData.ListVarName=[ProjData.ListVarName {XName}];
     652            ProjData.VarDimName=[ProjData.VarDimName {XName}];
     653            nbvar=numel(ProjData.ListVarName);
     654            ProjData.VarAttribute{nbvar}.long_name='abscissa along line';
    649655            if isequal(ProjMode,'projection')
    650656                if width==0
     
    663669                Xproj=(coord_x-ObjectData.Coord(1,1))*costheta + (coord_y-ObjectData.Coord(1,2))*sintheta; %projection on the line
    664670                [Xproj,indsort]=sort(Xproj);% sort points by increasing absissa along the projection line
     671                ProjData.(XName)=Xproj;
    665672                for ivar=1:numel(VarIndex)
    666673                    ProjData.(VarName{ivar})=FieldData.(VarName{ivar})(flagsel);% restrict vrtibles to the projection band
    667674                    ProjData.(VarName{ivar})=ProjData.(VarName{ivar})(indsort);% sort by absissa
    668                 end
    669                 % project the velocity components if vectors are projected
    670                 if testU
    671                     vector_x=ProjData.(UName);
    672                     ProjData.(UName)=costheta*vector_x+sintheta*ProjData.(VName);% longitudinal component
    673                     ProjData.(VName)=-sintheta*vector_x+costheta*ProjData.(VName);%transverse component
     675                    ProjData.ListVarName=[ProjData.ListVarName VarName{ivar}];
     676                    ProjData.VarDimName=[ProjData.VarDimName {XName}];
     677                    ProjData.VarAttribute{nbvar+ivar}=FieldData.VarAttribute{VarIndex(ivar)};%reproduce var attribute
     678                    if isfield(ProjData.VarAttribute{nbvar+ivar},'Role')
     679                        if  strcmp(ProjData.VarAttribute{nbvar+ivar}.Role,'vector_x');
     680                            ivar_U=ivar;
     681                        elseif strcmp(ProjData.VarAttribute{nbvar+ivar}.Role,'vector_y');
     682                            ivar_V=ivar;
     683                        end
     684                    end
     685                    ProjData.VarAttribute{ivar+nbvar}.Role='discrete';% will promote plots of the profiles with continuous lines
    674686                end
    675687            elseif isequal(ProjMode,'interp_lin')  %filtering %linear interpolation:
    676688                [ProjVar,ListFieldProj,VarAttribute,errormsg]=calc_field_interp([coord_x coord_y],FieldData,CellInfo{icell}.FieldName,XI,YI);
    677689                ProjData.X=Xproj;
    678                 ProjData.ListVarName=[ProjData.ListVarName {XName}];
    679                 ProjData.VarDimName=[ProjData.VarDimName {XName}];
    680                 nbvar=numel(ProjData.ListVarName);
    681                 ProjData.VarAttribute{nbvar}.long_name='abscissa along line';
    682690                ProjData.ListVarName=[ProjData.ListVarName ListFieldProj];
    683691                ProjData.VarAttribute=[ProjData.VarAttribute VarAttribute];
    684692                for ivar=1:numel(VarAttribute)
    685693                    ProjData.VarDimName=[ProjData.VarDimName {XName}];
     694                    if isfield(VarAttribute{ivar},'Role')
     695                        if  strcmp(VarAttribute{ivar}.Role,'vector_x');
     696                            ivar_U=ivar;
     697                        elseif strcmp(VarAttribute{ivar}.Role,'vector_y');
     698                            ivar_V=ivar;
     699                        end
     700                    end
    686701                    ProjData.VarAttribute{ivar+nbvar}.Role='continuous';% will promote plots of the profiles with continuous lines
    687702                    ProjData.(ListFieldProj{ivar})=ProjVar{ivar};
     
    696711                    FieldVar=cat(3,FieldData.(FieldData.ListVarName{CellInfo{icell}.VarIndex_vector_x_tps}),FieldData.(FieldData.ListVarName{CellInfo{icell}.VarIndex_vector_y_tps}));
    697712                end
    698                 %                 coord_x_proj=XMin:DX:XMax;
    699                 %                 coord_y_proj=YMin:DY:YMax;
    700                 %                 np_x=numel(coord_x_proj);
    701                 %                 np_y=numel(coord_y_proj);
    702713                [DataOut,VarAttribute,errormsg]=calc_field_tps(Coord,NbCentres,SubRange,FieldVar,CellInfo{icell}.FieldName,cat(3,XI,YI));
    703714                ProjData.X=Xproj;
    704                 ProjData.ListVarName=[ProjData.ListVarName {XName}];
    705                 ProjData.VarDimName=[ProjData.VarDimName {XName}];
     715%                 ProjData.ListVarName=[ProjData.ListVarName {XName}];
     716%                 ProjData.VarDimName=[ProjData.VarDimName {XName}];
    706717                nbvar=numel(ProjData.ListVarName);
    707718                ProjData.VarAttribute{nbvar}.long_name='abscissa along line';
     
    711722                for ivar=1:numel(VarAttribute)
    712723                    ProjData.VarDimName=[ProjData.VarDimName {XName}];
     724                    if isfield(VarAttribute{ivar},'Role')
     725                        if  strcmp(VarAttribute{ivar}.Role,'vector_x');
     726                            ivar_U=ivar;
     727                        elseif strcmp(VarAttribute{ivar}.Role,'vector_y');
     728                            ivar_V=ivar;
     729                        end
     730                    end
    713731                    ProjData.VarAttribute{ivar+nbvar}.Role='continuous';% will promote plots of the profiles with continuous lines
    714732                    ProjData.(ProjVarName{ivar})=DataOut.(ProjVarName{ivar});
     
    822840                    ProjData.VarAttribute{ivar}.Role='continuous';% for plot with continuous line
    823841                end
    824                 if testU
    825                     vector_x =ProjData.(FieldData.ListVarName{CellInfo{icell}.VarIndex_vector_x});
    826                     vector_y =ProjData.(FieldData.ListVarName{CellInfo{icell}.VarIndex_vector_y});
    827                     ProjData.(FieldData.ListVarName{CellInfo{icell}.VarIndex_vector_x}) =cos(theta)*vector_x+sin(theta)*vector_y;
    828                     ProjData.(FieldData.ListVarName{CellInfo{icell}.VarIndex_vector_y}) =-sin(theta)*vector_x+cos(theta)*vector_y;
    829                 end
    830                 ProjData.VarAttribute{nbvar+1}.long_name='abscissa along line';
    831842                if nbcolor==3
    832843                    ProjData.VarDimName{end}={AXName,'rgb'};
    833844                end
    834845            end
    835     end
     846    end
     847    if ~isempty(ivar_U) && ~isempty(ivar_V)
     848        vector_x =ProjData.(ProjData.ListVarName{nbvar+ivar_U});
     849         ProjData.(ProjData.ListVarName{nbvar+ivar_U}) =cos(theta)*vector_x+sin(theta)*ProjData.(ProjData.ListVarName{nbvar+ivar_V});
     850          ProjData.(ProjData.ListVarName{nbvar+ivar_V}) =-sin(theta)*vector_x+cos(theta)*ProjData.(ProjData.ListVarName{nbvar+ivar_V});
     851    end
     852       
    836853end
    837854
     
    11521169                        coord_X=coord_X(indsel);
    11531170                        coord_Y=coord_Y(indsel);
     1171                        for ivar=1:numel(CellInfo{icell}.VarIndex)
     1172                            VarName=FieldData.ListVarName{CellInfo{icell}.VarIndex(ivar)};
     1173                            FieldData.(VarName)=FieldData.(VarName)(indsel);
     1174                        end
    11541175                    end
    11551176%                     testFF=0;
    1156 %                     nbvar=numel(ProjData.ListVarName);
    1157                     if isfield(CellInfo{icell},'VarIndex_vector_x')&&isfield(CellInfo{icell},'VarIndex_vector_y')
    1158                         VarName_x=FieldData.ListVarName{CellInfo{icell}.VarIndex_vector_x};
    1159                         VarName_y=FieldData.ListVarName{CellInfo{icell}.VarIndex_vector_y};
    1160                         if isfield(CellInfo{icell},'VarIndex_errorflag')
    1161                             FieldData.(VarName_x)=FieldData.(VarName_x)(indsel);
    1162                             FieldData.(VarName_y)=FieldData.(VarName_y)(indsel);
    1163                         end
    1164                         %FieldVar=cat(2,FieldData.(VarName_x),FieldData.(VarName_y));
    1165                         if ~isfield(CellInfo{icell},'CheckSub') || ~CellInfo{icell}.CheckSub
    1166                             vector_x_proj=numel(ProjData.ListVarName)+1;
    1167                             vector_y_proj=numel(ProjData.ListVarName)+2;
    1168                         end
    1169                     end
    1170                     if isfield(CellInfo{icell},'VarIndex_scalar')
    1171                         VarName_scalar=FieldData.ListVarName{CellInfo{icell}.VarIndex_scalar};
    1172                         if isfield(CellInfo{icell},'errorflag') && ~isempty(CellInfo{icell}.errorflag)
    1173                             FieldData.(VarName_scalar)=FieldData.(VarName_scalar)(indsel);
    1174                         end
    1175                     end
    1176                     if isfield(CellInfo{icell},'VarIndex_ancillary')% do not project ancillary data with interp
    1177                         FieldData=rmfield(FieldData,FieldData.ListVarName{CellInfo{icell}.VarIndex_ancillary});
    1178                     end
    1179                     if isfield(CellInfo{icell},'VarIndex_warnflag')% do not project ancillary data with interp
    1180                         FieldData=rmfield(FieldData,FieldData.ListVarName{CellInfo{icell}.VarIndex_warnflag});
    1181                     end
     1177%                     nbvar=numel(ProjData.ListVarName);                           
     1178%                     if isfield(CellInfo{icell},'VarIndex_vector_x')&&isfield(CellInfo{icell},'VarIndex_vector_y')
     1179%                         VarName_x=FieldData.ListVarName{CellInfo{icell}.VarIndex_vector_x};
     1180%                         VarName_y=FieldData.ListVarName{CellInfo{icell}.VarIndex_vector_y};
     1181%                         if isfield(CellInfo{icell},'VarIndex_errorflag')
     1182%                             FieldData.(VarName_x)=FieldData.(VarName_x)(indsel);
     1183%                             FieldData.(VarName_y)=FieldData.(VarName_y)(indsel);
     1184%                         end
     1185%                         %FieldVar=cat(2,FieldData.(VarName_x),FieldData.(VarName_y));
     1186%                         if ~isfield(CellInfo{icell},'CheckSub') || ~CellInfo{icell}.CheckSub
     1187%                             vector_x_proj=numel(ProjData.ListVarName)+1;
     1188%                             vector_y_proj=numel(ProjData.ListVarName)+2;
     1189%                         end
     1190%                     end
     1191%                     if isfield(CellInfo{icell},'VarIndex_scalar')
     1192%                         VarName_scalar=FieldData.ListVarName{CellInfo{icell}.VarIndex_scalar};
     1193%                         if isfield(CellInfo{icell},'errorflag') && ~isempty(CellInfo{icell}.errorflag)
     1194%                             FieldData.(VarName_scalar)=FieldData.(VarName_scalar)(indsel);
     1195%                         end
     1196%                     end
     1197%                     if isfield(CellInfo{icell},'VarIndex_ancillary')% do not project ancillary data with interp
     1198%                         FieldData=rmfield(FieldData,FieldData.ListVarName{CellInfo{icell}.VarIndex_ancillary});
     1199%                     end
     1200%                     if isfield(CellInfo{icell},'VarIndex_warnflag')% do not project ancillary data with interp
     1201%                         FieldData=rmfield(FieldData,FieldData.ListVarName{CellInfo{icell}.VarIndex_warnflag});
     1202%                     end
    11821203                    % interpolate and calculate field on the grid
    11831204                    [VarVal,ListFieldProj,VarAttribute,errormsg]=calc_field_interp([coord_X coord_Y],FieldData,CellInfo{icell}.FieldName,XI,YI);
  • trunk/src/series.m

    r648 r650  
    17631763        %create subdirectory for oar command and log files
    17641764        DirOAR=fullfile(OutputDir,'0_OAR');
    1765         if ~exist(DirOAR,'dir')
     1765        if exist(DirOAR,'dir')% delete the content of the dir 0_OAR to allow new input
     1766            curdir=pwd;
     1767            cd(DirOAR)
     1768            delete('*')
     1769            cd(curdir)
     1770        else
    17661771            [tild,msg1]=mkdir(DirOAR);
    17671772            if ~strcmp(msg1,'')
  • trunk/src/set_object.m

    r648 r650  
    182182if ~isempty(huvmat)
    183183    hhuvmat=guidata(huvmat);
    184 %     set(hhuvmat.ViewObject_1,'value',0)% desactivate the two view buttons
    185     set(hhuvmat.ViewObject,'value',0)%
    186     set(hhuvmat.edit_object,'Value',0)% desactivate the edit option
    187 %    set(hhuvmat.edit_object,'BackgroundColor',[0.7 0.7 0.7])%put unactivated buttons to gree
     184    set(hhuvmat.CheckViewObject,'value',0)%
     185    set(hhuvmat.CheckEditObject,'Value',0)% desactivate the edit option
    188186    % deselect the object in ListObject when view_field is closed
    189187    if isempty(findobj(allchild(0),'Tag','view_field'))
     
    455453ListObject=get(hhuvmat.ListObject,'String');% list of objects displayed in uvmat
    456454
    457 if isequal(get(hhuvmat.edit_object,'Value'),0) %we append a new object
     455if isequal(get(hhuvmat.CheckEditObject,'Value'),0) %we append a new object
    458456    ListObject=[ListObject;{''}];
    459457    IndexObj=length(ListObject);
     
    491489set(hhuvmat.ListObject,'String',ListObject);%complement the object list
    492490set(hhuvmat.ListObject_1,'String',ListObject);%complement the object list
    493 set(hhuvmat.ViewObject,'Value',1)% indicate that the currently selected objected is viewed on set_object
     491set(hhuvmat.CheckViewObject,'Value',1)% indicate that the currently selected objected is viewed on set_object
    494492check_handle=isfield(UvData.ProjObject{IndexObj},'DisplayHandle') && isfield(UvData.ProjObject{IndexObj}.DisplayHandle,'uvmat')...
    495493    && ~isempty(UvData.ProjObject{IndexObj}.DisplayHandle.uvmat) && ishandle(UvData.ProjObject{IndexObj}.DisplayHandle.uvmat);
     
    554552            set(hview_field,'Position',Data.GUISize)
    555553        end
    556         %  set(hhuvmat.ViewField,'Value',1)% indicate that the field projection on the current object is plotted in view_field
    557554    end
    558555end
     
    586583
    587584%% update the GUI uvmat
    588 % set(hhuvmat.MenuEditObject,'enable','on')
    589 set(hhuvmat.edit_object,'Value',1) % set uvmat to object edit mode to allow further object update
    590 %set(hhuvmat.edit_object,'BackgroundColor',[1 1 0]);% paint the edit text in yellow
    591 set(hhuvmat.ViewField,'Value',1)
    592 % set(handles.PLOT,'enable','on')
     585set(hhuvmat.CheckEditObject,'Value',1) % set uvmat to object edit mode to allow further object update
     586set(hhuvmat.CheckViewField,'Value',1)
    593587set(handles.PLOT,'BackgroundColor',[1 0 0])
    594588%------------------------------------------------------------------------
  • trunk/src/uvmat.m

    r648 r650  
    9191% name in a netcdf open), it is directly read at the level of Field{1}or Field{2}.
    9292% Else only its name AName is recorded in Field{i}, and its field is then calculated
    93 %by the fuction calc_scal after the coordinate transform or after projection on an edit_object
     93%by the fuction calc_scal after the coordinate transform or after projection on an CheckEditObject
    9494     
    9595% Properties attached to plotting figures (standard Matlab properties):
     
    111111%                    = calibration: move a calibration point
    112112%                    = CheckZoom: isolate a subregion for CheckZoom in=1 if an object is being currently drawn, 0 else (set to 0 by releasing mouse button)
    113 %            .CurrentOrigin: Origin of a curently drawn edit_object
     113%            .CurrentOrigin: Origin of a curently drawn CheckEditObject
    114114%            .CurrentLine: currently drawn menuline (A REVOIR)
    115 %            .CurrentObject: handle of the currently drawn edit_object
     115%            .CurrentObject: handle of the currently drawn CheckEditObject
    116116%            .CurrentRectZoom: current rectangle used for CheckZoom
    117117
     
    723723% the root name and indices may be corrected by including the first index i1 if a corresponding xml file exists
    724724[RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,NomType,FileType,FileInfo,MovieObject,i1,i2,j1,j2]=find_file_series(FilePath,[FileName FileExt]);
     725
    725726if strcmp(FileType,'txt')
    726727    edit(fileinput)
     
    954955    set(handles.Dt_txt,'String',['Dt=' num2str(1000/imainfo.FrameRate) 'ms']);%display the elementary time interval in millisec
    955956    if index==1
    956     set(handles.TimeName,'video')
     957    set(handles.TimeName,'String','video')
    957958    else
    958         set(handles.TimeName_1,'video')
     959        set(handles.TimeName_1,'String','video')
    959960    end
    960961    ColorType='truecolor';
     
    10271028if (isfield(XmlData,'Time')&& ~isempty(XmlData.Time))
    10281029    if index==1
    1029     set(handles.TimeName,'xml')
     1030    set(handles.TimeName,'String','xml')
    10301031    else
    1031        set(handles.TimeName_1,'xml')
     1032       set(handles.TimeName_1,'String','xml')
    10321033    end
    10331034else
     
    24022403    siz=size(UvData.XmlData{1}.Time);
    24032404    if ~isempty(num_i1)&& ~isempty(num_i2) && num_i1>=0 &&siz(1)>=max(num_i1+1,num_i2+1) && siz(2)>=max(num_j1+1,num_j2+1)
    2404         set(handles.TimeName,'xml')% indicate that time is from xml
     2405        set(handles.TimeName,'String','xml')% indicate that time is from xml
    24052406        abstime=(UvData.XmlData{1}.Time(num_i1+1,num_j1+1)+UvData.XmlData{1}.Time(num_i2+1,num_j2+1))/2;%overset the time read from files
    24062407        dt=(UvData.XmlData{1}.Time(num_i2+1,num_j2+1)-UvData.XmlData{1}.Time(num_i1+1,num_j1+1));
     
    26152616            set(handles.ListObject,'Value',1);
    26162617            set(handles.ListObject,'String',{'1-PLANE'});
    2617             set(handles.edit_object,'Value',1)% put the plane in edit mode to enable the z cursor
    2618             edit_object_Callback([],[], handles)
     2618            set(handles.CheckEditObject,'Value',1)% put the plane in edit mode to enable the z cursor
     2619            CheckEditObject_Callback([],[], handles)
    26192620        end
    26202621        %multilevel case (single menuplane in a 3D space)
     
    35273528    set(handles.edit_vect,'Value',0)
    35283529    edit_vect_Callback(hObject, eventdata, handles)
    3529     set(handles.edit_object,'Value',0)
    3530 %     set(handles.edit_object,'BackgroundColor',[0.7 0.7 0.7])
     3530    set(handles.CheckEditObject,'Value',0)
     3531%     set(handles.CheckEditObject,'BackgroundColor',[0.7 0.7 0.7])
    35313532%     set(handles.cal,'Value',0)
    35323533%     set(handles.cal,'BackgroundColor',[0 1 0])
     
    35743575    set(handles.record,'Visible','on')
    35753576    set(handles.edit_vect,'BackgroundColor',[1 1 0])
    3576     set(handles.edit_object,'Value',0)
     3577    set(handles.CheckEditObject,'Value',0)
    35773578    set(handles.CheckZoom,'Value',0)
    35783579%     set(handles.CheckZoom,'BackgroundColor',[0.7 0.7 0.7])
    3579 %     set(handles.edit_object,'BackgroundColor',[0.7 0.7 0.7])
     3580%     set(handles.CheckEditObject,'BackgroundColor',[0.7 0.7 0.7])
    35803581    set(gcf,'Pointer','arrow')
    35813582else
     
    38123813    set(handles.ListObject_1,'Value',1)
    38133814    set(handles.ListObject_1,'String',{''})
    3814     set(handles.ViewObject,'value',0)
    3815     ViewObject_Callback(hObject, eventdata, handles)
    3816     set(handles.ViewField,'value',0)
    3817     ViewField_Callback(hObject, eventdata, handles)
    3818     set(handles.edit_object,'Value',0)
    3819     edit_object_Callback(hObject, eventdata, handles)
     3815    set(handles.CheckViewObject,'value',0)
     3816    CheckViewObject_Callback(hObject, eventdata, handles)
     3817    set(handles.CheckViewField,'value',0)
     3818    CheckViewField_Callback(hObject, eventdata, handles)
     3819    set(handles.CheckEditObject,'Value',0)
     3820    CheckEditObject_Callback(hObject, eventdata, handles)
    38203821    UvData.ProjObject={[]};
    38213822end
     
    42114212
    42124213%% display the object parameters if the GUI set_object is already opened
    4213 if ~get(handles.ViewObject,'Value')
     4214if ~get(handles.CheckViewObject,'Value')
    42144215    ZBounds=0; % default
    42154216    if isfield(UvData.Field,'ZMin') && isfield(UvData.Field,'ZMax')
     
    42194220    ObjectData.Name=list_str{get(handles.ListObject_1,'Value')};
    42204221    set_object(ObjectData,[],ZBounds);
    4221     set(handles.ViewObject,'Value',1)% show that the selected object in ListObject_1 is currently visualised
     4222    set(handles.CheckViewObject,'Value',1)% show that the selected object in ListObject_1 is currently visualised
    42224223end
    42234224
    42244225%  desactivate the edit object mode
    4225 set(handles.edit_object,'Value',0)
    4226 % set(handles.edit_object,'BackgroundColor',[0.7,0.7,0.7])
     4226set(handles.CheckEditObject,'Value',0)
     4227% set(handles.CheckEditObject,'BackgroundColor',[0.7,0.7,0.7])
    42274228
    42284229%------------------------------------------------------------------------
     
    42414242
    42424243%% show object features if view_object isselected
    4243 if get(handles.ViewObject,'value')
     4244if get(handles.CheckViewObject,'value')
    42444245    set_object(ObjectData,[],ZBounds);
    42454246end
     
    42524253%     ObjectData.Name=list_str{IndexObj};
    42534254%     set_object(ObjectData,[],ZBounds);
    4254 %     set(handles.ViewField,'Value',1)% show that the selected object in ListObject is currently visualised
     4255%     set(handles.CheckViewField,'Value',1)% show that the selected object in ListObject is currently visualised
    42554256% end
    42564257
    42574258%%  desactivate the edit object mode for security
    4258 set(handles.edit_object,'Value',0)
    4259 
    4260 % set(handles.edit_object,'BackgroundColor',[0.7,0.7,0.7])
     4259set(handles.CheckEditObject,'Value',0)
     4260
     4261% set(handles.CheckEditObject,'BackgroundColor',[0.7,0.7,0.7])
    42614262
    42624263%% update the  plot on view_field if view_field is already openened
     
    43424343
    43434344%-------------------------------------------------------------------
    4344 % --- Executes on selection change in edit_object.
    4345 function edit_object_Callback(hObject, eventdata, handles)
     4345% --- Executes on selection change in CheckEditObject.
     4346function CheckEditObject_Callback(hObject, eventdata, handles)
    43464347%-------------------------------------------------------------------
    43474348hset_object=findobj(allchild(0),'Tag','set_object');
    4348 if get(handles.edit_object,'Value')
     4349if get(handles.CheckEditObject,'Value')
    43494350    %suppress the other options
    43504351    set(handles.CheckZoom,'Value',0)
     
    43554356        set(hhgeometry_calib.edit_append,'Value',0)% desactivate mouse action in geometry_calib
    43564357    end
    4357     set(handles.ViewObject,'value',1)
    4358     ViewObject_Callback(hObject, eventdata, handles)
     4358    set(handles.CheckViewObject,'value',1)
     4359    CheckViewObject_Callback(hObject, eventdata, handles)
    43594360else % desactivate object edit mode
    43604361    if ~isempty(hset_object)% open the
     
    43674368
    43684369%------------------------------------------------------------------------
    4369 % --- Executes on button press in ViewObject.
    4370 function ViewObject_Callback(hObject, eventdata, handles)
    4371 %------------------------------------------------------------------------
    4372 check_view=get(handles.ViewObject,'Value');
     4370% --- Executes on button press in CheckViewObject.
     4371function CheckViewObject_Callback(hObject, eventdata, handles)
     4372%------------------------------------------------------------------------
     4373check_view=get(handles.CheckViewObject,'Value');
    43734374
    43744375if check_view %activate set_object   
     
    43924393    hset_object=set_object(data,[],ZBounds);
    43934394    hhset_object=guidata(hset_object);
    4394     if get(handles.edit_object,'Value')% edit mode
     4395    if get(handles.CheckEditObject,'Value')% edit mode
    43954396        set(get(hset_object,'children'),'Enable','on')
    43964397    else
     
    44074408
    44084409%------------------------------------------------------------------------
    4409 % --- Executes on button press in ViewField.
    4410 function ViewField_Callback(hObject, eventdata, handles)
    4411 %------------------------------------------------------------------------
    4412 check_view=get(handles.ViewField,'Value');
     4410% --- Executes on button press in CheckViewField.
     4411function CheckViewField_Callback(hObject, eventdata, handles)
     4412%------------------------------------------------------------------------
     4413check_view=get(handles.CheckViewField,'Value');
    44134414
    44144415if check_view
     
    44654466
    44664467%------------------------------------------------------------------------
    4467 % --- Executes on button press in delete_object.
    4468 %------------------------------------------------------------------------
    4469 function delete_object_Callback(hObject, eventdata, handles)
     4468% --- Executes on button press in DeleteObject.
     4469%------------------------------------------------------------------------
     4470function DeleteObject_Callback(hObject, eventdata, handles)
    44704471
    44714472IndexObj=get(handles.ListObject,'Value');%projection object selected for view_field
     
    44754476end
    44764477
    4477 %'delete_object': delete a projection object, defined by its index in the Uvmat list or by its graphic handle
    4478 %------------------------------------------------------------------------
    4479 % function delete_object(hObject)
     4478%'DeleteObject': delete a projection object, defined by its index in the Uvmat list or by its graphic handle
     4479%------------------------------------------------------------------------
     4480% function DeleteObject(hObject)
    44804481%
    44814482% INPUT:
     
    47144715
    47154716% -----------------------------------------------------------------------
     4717% --- Callback of the Menu command line
     4718%------------------------------------------------------------------------
    47164719function Menuline_Callback(hObject, eventdata, handles)
    47174720%------------------------------------------------------------------------
    47184721data.Type='line';
     4722data.ProjMode='projection';%default
     4723data.ProjModeMenu={};% do not restrict ProjMode menus
     4724create_object(data,handles)
     4725
     4726% -----------------------------------------------------------------------
     4727% --- Callback of the Menu command line_x
     4728%------------------------------------------------------------------------
     4729function Menuline_x_Callback(hObject, eventdata, handles)
     4730    msgbox_uvmat('ERROR','option not yet implemented, use line')
     4731    return
     4732data.Type='line_x';
     4733data.ProjMode='projection';%default
     4734data.ProjModeMenu={};% do not restrict ProjMode menus
     4735create_object(data,handles)
     4736
     4737% -----------------------------------------------------------------------
     4738% --- Callback of the Menu command line_y
     4739% -----------------------------------------------------------------------
     4740function Menuline_y_Callback(hObject, eventdata, handles)
     4741    msgbox_uvmat('ERROR','option not yet implemented, use line')
     4742    return
     4743data.Type='line_y';
    47194744data.ProjMode='projection';%default
    47204745data.ProjModeMenu={};% do not restrict ProjMode menus
     
    47914816    set(hhgeometry_calib.edit_append,'Value',0)% desactivate mouse action in geometry_calib
    47924817end
    4793 set(handles.edit_object,'Value',0)  %desactivate the object edit mode
    4794 edit_object_Callback([],[],handles)
    4795 set(handles.ViewObject,'Value',0) % desactivate view_object (new object created)
     4818set(handles.CheckEditObject,'Value',0)  %desactivate the object edit mode
     4819CheckEditObject_Callback([],[],handles)
     4820set(handles.CheckViewObject,'Value',0) % desactivate view_object (new object created)
    47964821set(handles.CheckZoomFig,'Value',0) %desactivate zoom sub fig
    47974822set(handles.CheckZoom,'Value',0)    %desactivate the zoom action
     
    48084833    if isfield(UvData.Field,'CoordMesh')&&~isempty(UvData.Field.CoordMesh)
    48094834        data.RangeX=[UvData.Field.XMin UvData.Field.XMax];
    4810         if strcmp(data.Type,'line')||strcmp(data.Type,'polyline')||strcmp(data.Type,'points')
    4811             data.RangeY=UvData.Field.CoordMesh;
    4812         else
    4813             data.RangeY=[UvData.Field.YMin UvData.Field.YMax];
     4835        switch data.Type
     4836            case {'line','polyline','points'}
     4837                data.RangeY=UvData.Field.CoordMesh;
     4838            case 'line_x'
     4839                data.RangeX=[UvData.Field.XMin UvData.Field.XMax];
     4840                data.RangeY=UvData.Field.CoordMesh;
     4841                data.Coord=[0 (UvData.Field.YMin +UvData.Field.YMax)/2];% put line at the middle of the y axis
     4842            case 'line_y'
     4843                data.RangeY=UvData.Field.CoordMesh;
     4844                data.Coord=[(UvData.Field.XMin +UvData.Field.XMax)/2 0];% put line at the middle of the x axis
     4845            case {'rectangle','ellipse'}
     4846                data.RangeY=[UvData.Field.YMin UvData.Field.YMax];
     4847                data.RangeX=UvData.Field.CoordMesh;
     4848                data.RangeY=UvData.Field.CoordMesh;
     4849            otherwise
     4850                data.RangeY=[UvData.Field.YMin UvData.Field.YMax];
    48144851        end
    48154852        data.DX=UvData.Field.CoordMesh;
    48164853        data.DY=UvData.Field.CoordMesh;
    4817         if strcmp(data.Type,'rectangle')||strcmp(data.Type,'ellipse')
    4818             data.RangeX=UvData.Field.CoordMesh;
    4819             data.RangeY=UvData.Field.CoordMesh;
    4820         end
    48214854    end
    48224855    if isfield(Field,'NbDim')&& isequal(Field.NbDim,3)
     
    48304863hchild=get(hset_object,'children');
    48314864set(hchild,'enable','on')
    4832 set(handles.delete_object,'Visible','on')% make the object delete button visible
     4865set(handles.DeleteObject,'Visible','on')% make the object delete button visible
    48334866
    48344867%------------------------------------------------------------------------
     
    48664899hset_object=set_object(data);% call the set_object interface
    48674900set(get(hset_object,'children'),'enable','on')% enable edit action on elements on GUI set_object
    4868 set(handles.edit_object,'Value',0); %suppress the object edit mode
    4869 edit_object_Callback([],[],handles)
    4870 % set(handles.edit_object,'BackgroundColor',[0.7,0.7,0.7]) 
    4871 set(handles.delete_object,'Visible','on')
     4901set(handles.CheckEditObject,'Value',0); %suppress the object edit mode
     4902CheckEditObject_Callback([],[],handles)
     4903% set(handles.CheckEditObject,'BackgroundColor',[0.7,0.7,0.7]) 
     4904set(handles.DeleteObject,'Visible','on')
    48724905
    48734906
     
    48784911% function MenuEditObject_Callback(hObject, eventdata, handles)
    48794912% %------------------------------------------------------------------------
    4880 % set(handles.edit_object,'Value',1)
     4913% set(handles.CheckEditObject,'Value',1)
    48814914% edit_Callback(hObject, eventdata, handles)
    48824915%
     
    51775210set(handles.edit_vect,'Value',0)
    51785211edit_vect_Callback(hObject, eventdata, handles)
    5179 % set(handles.edit_object,'BackgroundColor',[0.7 0.7 0.7])
     5212% set(handles.CheckEditObject,'BackgroundColor',[0.7 0.7 0.7])
    51805213set(handles.ListObject,'Value',1)     
    51815214
     
    52565289%------------------------------------------------------------------------
    52575290% -- open the GUI civ.fig for PIV
    5258 function MenuPIV_Callback(hObject, eventdata, handles)
     5291function MenuCIVx_Callback(hObject, eventdata, handles)
    52595292%------------------------------------------------------------------------
    52605293 [RootPath,SubDir,RootFile,FileIndex,FileExt]=read_file_boxes(handles);
    52615294 FileName=[fullfile(RootPath,SubDir,RootFile) FileIndex FileExt];
    52625295civ(FileName);% interface de civ(not in the uvmat file)
     5296
     5297
     5298% --------------------------------------------------------------------
     5299function MenuPIV_Callback(hObject, eventdata, handles)
     5300MenuSeries_Callback(hObject, eventdata, handles)
     5301
    52635302
    52645303% --------------------------------------------------------------------
  • trunk/src/view_field.m

    r644 r650  
    186186if ~isempty(huvmat)
    187187    hhuvmat=guidata(huvmat);
    188     set(hhuvmat.ViewField,'Value',0)
     188    set(hhuvmat.CheckViewField,'Value',0)
    189189    %set(hhuvmat.edit_object,'BackgroundColor',[0.7 0.7 0.7])%put unactivated buttons to gree
    190190    % deselect the object in ListObject when view_field is closed
Note: See TracChangeset for help on using the changeset viewer.