Changeset 912 for trunk/src/set_object.m


Ignore:
Timestamp:
Jun 16, 2015, 8:15:10 PM (9 years ago)
Author:
sommeria
Message:

interp range introduced in set_object

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/set_object.m

    r911 r912  
    3838function varargout = set_object(varargin)
    3939
    40 % Last Modified by GUIDE v2.5 15-Jun-2015 19:51:15
     40% Last Modified by GUIDE v2.5 16-Jun-2015 00:33:59
    4141
    4242% Begin initialization code - DO NOT REFRESH
     
    307307set(handles.num_DY,'Visible','off')
    308308set(handles.num_DZ,'Visible','off')
     309set(handles.num_RangeInterp,'Visible','off')
    309310
    310311switch ObjectStyle
     
    322323            set(handles.num_DX,'Visible','on')
    323324            set(handles.num_DX,'TooltipString','num_DX: mesh for the interpolated field along the line')
     325            set(handles.num_RangeInterp,'Visible','on')
    324326        end       
    325327    case {'rectangle','ellipse'}
     
    341343            set(handles.num_DX,'Visible','on')
    342344            set(handles.num_DY,'Visible','on')
     345            set(handles.num_RangeInterp,'Visible','on')
    343346        else
    344347            set(handles.num_DX,'Visible','off')
    345348            set(handles.num_DY,'Visible','off')
    346349        end
    347         if  isequal(ProjMode,'interp_lin')
    348             set(handles.num_DZ,'Visible','on') 
    349         end
     350%         if  isequal(ProjMode,'interp_lin')
     351%             set(handles.num_DZ,'Visible','on') 
     352%         end
    350353     case {'volume'} 
    351354        set(handles.num_RangeX_1,'Visible','on')
     
    372375% set default values read in the plot of uvmat to initiate the mesh
    373376if isequal(ProjMode,'interp_lin')|| isequal(ProjMode,'interp_tps')
     377            huvmat=findobj('Tag','uvmat');%find the current uvmat interface handle
     378        UvData=get(huvmat,'UserData');%Data associated to the current uvmat interface
    374379    if isempty(str2num(get(handles.num_DX,'String')))||isempty(str2num(get(handles.num_DY,'String')));     
    375         huvmat=findobj('Tag','uvmat');%find the current uvmat interface handle
    376         UvData=get(huvmat,'UserData');%Data associated to the current uvmat interface
    377         Field=UvData.Field;
     380%         Field=UvData.Field;
    378381        if  isfield(UvData.Field,'CoordMesh')&&~isempty(UvData.Field.CoordMesh)
    379382            set(handles.num_DX,'String',num2str(UvData.Field.CoordMesh))
     
    387390            set(handles.CoordUnit,'String',Field.CoordUnit)
    388391        end       
     392    end
     393    if isempty(str2num(get(handles.num_RangeInterp,'String')))
     394     set(handles.num_RangeInterp,'String',num2str(3*UvData.Field.CoordMesh))% default interpolationlength= 3 meshes
    389395    end
    390396end
     
    416422huvmat=findobj('Tag','uvmat');%find the current uvmat interface handle
    417423UvData=get(huvmat,'UserData');%Data associated to the current uvmat interface
    418 if isfield(UvData,'X') & isfield(UvData,'Y') & isfield(UvData,'Z')
     424if isfield(UvData,'X') && isfield(UvData,'Y') && isfield(UvData,'Z')
    419425    Z=norm_plane(1)*(UvData.X)+norm_plane(2)*(UvData.Y)+norm_plane(3)*(UvData.Z);
    420426    set(handles.z_slider,'Min',min(Z))
     
    691697        t=struct2xml(Object);
    692698        t=set(t,1,'name','ProjObject');
    693         save(t,FullName)
    694         msgbox_uvmat('CONFIRMATION',[FullName  ' saved'])
     699        try
     700            save(t,FullName)
     701            msgbox_uvmat('CONFIRMATION',[FullName  ' saved'])
     702        catch ME
     703            msgbox_uvmat('ERROR',ME.message)
     704        end
    695705    end
    696706end
     
    801811
    802812function num_RangeInterp_Callback(hObject, eventdata, handles)
    803 % hObject    handle to num_RangeInterp (see GCBO)
    804 % eventdata  reserved - to be defined in a future version of MATLAB
    805 % handles    structure with handles and user data (see GUIDATA)
    806 
    807 % Hints: get(hObject,'String') returns contents of num_RangeInterp as text
    808 %        str2double(get(hObject,'String')) returns contents of num_RangeInterp as a double
    809 
    810 
    811 % --- Executes during object creation, after setting all properties.
    812 function num_RangeInterp_CreateFcn(hObject, eventdata, handles)
    813 % hObject    handle to num_RangeInterp (see GCBO)
    814 % eventdata  reserved - to be defined in a future version of MATLAB
    815 % handles    empty - handles not created until after all CreateFcns called
    816 
    817 % Hint: edit controls usually have a white background on Windows.
    818 %       See ISPC and COMPUTER.
    819 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    820     set(hObject,'BackgroundColor','white');
    821 end
Note: See TracChangeset for help on using the changeset viewer.