Changeset 650 for trunk/src/uvmat.m


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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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% --------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.