Changeset 231 for trunk/src/uvmat.m


Ignore:
Timestamp:
Apr 5, 2011, 12:46:34 AM (13 years ago)
Author:
sommeria
Message:

interactive test for piv introduced various bug corrections

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/uvmat.m

    r227 r231  
    302302set(handles.transform_fct,'String',menu_str)
    303303set(handles.transform_fct,'UserData',fct_handle)% store the list of path in UserData of ACTION
    304 set(handles.uvmat,'UserData',UvData)
     304
    305305
    306306%% check the path and date of modification of all functions in uvmat
     
    324324            inputfile=input.InputFile;
    325325        end
    326         if isfield(Field,'TimeIndex')
    327             set(handles.i1,num2str(Field.TimeIndex))
     326        if isfield(input,'TimeIndex')
     327            set(handles.i1,num2str(input.TimeIndex))
     328        end
     329        if isfield(input,'FieldsString')
     330%             set(handles.Fields,'Value',1)
     331            UvData.FieldsString=input.FieldsString;
    328332        end
    329333    elseif ischar(input)% file name introduced as input
     
    335339            return
    336340        end
    337         Field.ListVarName={'A','coord_y','coord_x'};
    338         Field.VarDimName={{'coord_y','coord_x'},'cord_y','coord_x'};
    339         Field.A=input;
    340         Field.coord_x=[0.5 size(input,2)-0.5];
    341         Field.coord_y=[size(input,1)-0.5 0.5];
    342     end
    343     if ~isempty(inputfile)
    344         %%%%% display the input field %%%%%%%
    345         display_file_name(hObject, eventdata, handles,inputfile)
    346         %%%%%%%
     341        UvData.Field.ListVarName={'A','coord_y','coord_x'};
     342        UvData.Field.VarDimName={{'coord_y','coord_x'},'cord_y','coord_x'};
     343        UvData.Field.A=input;
     344        UvData.Field.coord_x=[0.5 size(input,2)-0.5];
     345        UvData.Field.coord_y=[size(input,1)-0.5 0.5];
    347346        testinputfield=1;
    348347    end
     
    360359       end
    361360   end
     361end
     362set(handles.uvmat,'UserData',UvData)
     363if ~isempty(inputfile)
     364    %%%%% display the input field %%%%%%%
     365    display_file_name(hObject, eventdata, handles,inputfile)
     366    %%%%%%%
     367    testinputfield=1;
    362368end
    363369
     
    856862UvData.XmlData=XmlData;
    857863UvData.NewSeries=1;
    858 set(handles.uvmat,'UserData',UvData)
     864
    859865
    860866%display warning message
     
    867873if ~testima
    868874    testcivx=0;
    869     hget_field=findobj('Name','get_field');
    870 %     if isequal(FileExt,'.nc')||isequal(FileExt,'.cdf')
    871     if isempty(hget_field)
     875    % hget_field=findobj('Name','get_field');
     876    %     if isequal(FileExt,'.nc')||isequal(FileExt,'.cdf')
     877    if isfield(UvData,'FieldsString') && isequal(UvData.FieldsString,{'get_field...'})% field menu defined as input (from get_field)
     878        set(handles.Fields,'Value',1)
     879        set(handles.Fields,'String',{'get_field...'})
     880        UvData=rmfield(UvData,'FieldsString');
     881    else
     882        %if isempty(hget_field)
    872883        Data=nc2struct(FileName,'ListGlobalAttribute','absolut_time_T0','civ');
    873884        if ~isempty(Data.absolut_time_T0)&& ~isequal(Data.civ,0)%if the new input is Civx
     
    878889            col_vec(1)=[];%remove 'velocity' option for vector color (must be a scalar)
    879890            testcivx=1;
    880         end 
    881     else
    882         hhget_field=guidata(hget_field);
    883         if ~strcmp(get(hhget_field.inputfile,'String'),FileName)%delete any existing get_field GUI with file name different than the input
    884             delete(hget_field)
    885         end
    886     end
    887     if ~testcivx
     891        end
     892        %     else
     893        %          hhget_field=guidata(hget_field);
     894        %         if ~strcmp(get(hhget_field.inputfile,'String'),FileName)%delete any existing get_field GUI with file name different than the input
     895        %             delete(hget_field)
     896        %         end
     897        %     end
     898        if ~testcivx
    888899            set(handles.Fields,'Value',1) % set menu to 'get_field...
    889900            set(handles.Fields,'String',{'get_field...'})
    890             col_vec={'get_field...'};
    891     end       
    892     set(handles.col_vec,'String',col_vec)
    893 %     else
    894 %         msgbox_uvmat('ERROR',['invalid input file extension ' FileExt])
    895 %         return
    896 %     end
    897 end
     901            col_vec={'get_field...'};
     902        end
     903        set(handles.col_vec,'String',col_vec)
     904        %     else
     905        %         msgbox_uvmat('ERROR',['invalid input file extension ' FileExt])
     906        %         return
     907        %     end
     908    end
     909end
     910set(handles.uvmat,'UserData',UvData)
    898911
    899912%% set index navigation options and refresh plots
     
    25332546    end
    25342547else
    2535     % create a default projection menuplane
    2536     %UvData.Object{1}.Style='none';%main plotting plane
    2537     UvData.Object{1}.ProjMode='projection';%main plotting plane
    2538     UvData.Object{1}.DisplayHandle_uvmat=[]; %plane not visible in uvmat
    2539     set(handles.list_object_1,'Value',1);
    2540     set(handles.list_object_1,'String',{''});
     2548    % create a default projection
     2549%     UvData.Object{1}.ProjMode='projection';%main plotting plane
     2550%     UvData.Object{1}.DisplayHandle_uvmat=[]; %plane not visible in uvmat
     2551%     set(handles.list_object_1,'Value',1);
     2552%     set(handles.list_object_1,'String',{''});
    25412553end
    25422554% if ~isfield(UvData.Object{1},'plotaxes')
     
    25732585% second projection object (view_field display)
    25742586IndexObj_2=get(handles.list_object_2,'Value');%selected projection object for the second view
     2587if IndexObj_2==0
     2588    IndexObj_2=1;
     2589end
    25752590if isequal(get(handles.list_object_2,'Visible'),'on') && IndexObj_2 <= numel(UvData.Object)&& ~isempty(UvData.Object{IndexObj_2})
    25762591    IndexObj(2)=IndexObj_2;
     
    39493964list_object=get(handles.list_object_1,'String');
    39503965set(handles.list_object_1,'Value',1)
    3951 set(handles.list_object_1,'String',list_object(1))
     3966set(handles.list_object_1,'String',{''})
    39523967set(handles.list_object_2,'Value',2)
    3953 set(handles.list_object_2,'String',[list_object(1);{'...'}])
     3968set(handles.list_object_2,'String',{''})
    39543969list_object_2_Callback(hObject, eventdata, handles)
    39553970
     
    43174332IndexObj=get(handles.list_object_1,'Value');
    43184333str_1=list_str{IndexObj};
    4319 val_2=get(handles.list_object_2,'Value');
    4320 str_2=get(handles.list_object_2,'String');
    4321 if isequal(val_2,IndexObj)% if the first selection is equal to the second, it will suppress the second
    4322     set(handles.list_object_2,'Value',numel(str_2))%select the end of the list ('...')
    4323     list_object_2_Callback(hObject, eventdata, handles)
    4324 end
     4334% val_2=get(handles.list_object_2,'Value');
     4335% str_2=get(handles.list_object_2,'String');
     4336% if isequal(val_2,IndexObj)% if the first selection is equal to the second, it will suppress the second
     4337%     set(handles.list_object_2,'Value',numel(str_2))%select the end of the list ('...')
     4338%     list_object_2_Callback(hObject, eventdata, handles)
     4339% end
    43254340update_object(handles,IndexObj,1,str_1)
    43264341
     
    43314346list_str=get(handles.list_object_2,'String');
    43324347IndexObj=get(handles.list_object_2,'Value');
    4333 if ischar(list_str) || strcmp(list_str{IndexObj},'...')
     4348if ischar(list_str) || isempty(list_str{IndexObj})% || strcmp(list_str{IndexObj},'...')
    43344349    hview_field=findobj(allchild(0),'Tag','view_field');
    43354350    if ~isempty(hview_field)
     
    43864401    PlotHandles=guidata(hview_field);
    43874402end
    4388 plot_field(ProjData,PlotHandles.axes3,PlotHandles);
     4403%plot_field(ProjData,PlotHandles.axes3,PlotHandles);
    43894404set(handles.uvmat,'UserData',UvData)
    43904405hother=findobj('Tag','proj_object');%find all the proj objects
     
    46704685            end
    46714686        end
    4672     end
    4673    
     4687    end
    46744688    %mask name
    46754689    RootPath=get(handles.RootPath,'String');
     
    46874701
    46884702    %display the mask
    4689     figure;
     4703    hfigmask=figure;
     4704    set(hfigmask,'Name','mask image')
    46904705    vec=linspace(0,1,256);%define a linear greyscale colormap
    46914706    map=[vec' vec' vec'];
Note: See TracChangeset for help on using the changeset viewer.