Changeset 1050


Ignore:
Timestamp:
Jun 11, 2018, 9:17:44 PM (6 years ago)
Author:
sommeria
Message:

uigetfile repaired

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/find_file_series.m

    r1033 r1050  
    245245            %% update the file type if the input file does not exist (pb of 0001)
    246246            if isempty(FileInfo.FileType)
    247                 [FileInfo,MovieObject]=get_file_info(fullfile(FilePath,ListFiles(ifile_min)));
     247                [FileInfo,MovieObject]=get_file_info(fullfile(FilePath,ListFiles{ifile_min}));
    248248            end
    249249        end
  • trunk/src/get_field.m

    r1045 r1050  
    640640else % no input variable, the variable ScalarName is selected from the menu
    641641    scalar_index=get(handles.scalar,'Value');
    642         ScalarName=scalar_menu{scalar_index};
     642    ScalarName=scalar_menu{scalar_index};
    643643end
    644644
     
    647647test_coord=zeros(size(Field.Display.VarDimName)); %=1 when variable #ilist is eligible as structured coordiante
    648648dim_var=Field.Display.VarDimName{scalar_index};%list of dimensions of the selected variable
    649 %if ~get(handles.CheckDimensionX,'Value') 
    650     %look for coordinate variables among the other variables
    651     for ilist=1:numel(Field.Display.VarDimName)
    652         dimnames=Field.Display.VarDimName{ilist}; %list of dimensions for variable #ilist
    653         if isequal(dimnames,dim_var)
    654             test_component(ilist)=1;% the listed variable has the same dimension as the selected scalar-> possibly chosen as unstructured coordinate
    655         elseif numel(dimnames)==1 && ~isempty(find(strcmp(dimnames{1},dim_var), 1))%variable ilist is a 1D array which can be coordinate variable
    656             test_coord(ilist)=1;
    657         end
    658     end
     649%if ~get(handles.CheckDimensionX,'Value')
     650%look for coordinate variables among the other variables
     651for ilist=1:numel(Field.Display.VarDimName)
     652    dimnames=Field.Display.VarDimName{ilist}; %list of dimensions for variable #ilist
     653    if isequal(dimnames,dim_var)
     654        test_component(ilist)=1;% the listed variable has the same dimension as the selected scalar-> possibly chosen as unstructured coordinate
     655    elseif numel(dimnames)==1 && ~isempty(find(strcmp(dimnames{1},dim_var), 1))%variable ilist is a 1D array which can be coordinate variable
     656        test_coord(ilist)=1;
     657    end
     658end
    659659%end
    660660var_component=find(test_component);% list of variable indices elligible as unstructured coordinates
     
    687687        elseif strcmp(Role,'coord_z')
    688688            coord_val(3)=ilist;
    689             Check3D=1;
    690         end
    691     end
    692 end
    693 if numel(find(coord_val))<2
     689        end
     690    end
     691end
     692if numel(find(coord_val))<2 % no predefiend components
    694693    if numel(var_coord)>=3
    695          coord_val=[3 2 1];
    696     elseif numel(var_coord)>=2
    697        % coord_val=[numel(var_component)+2 numel(var_component)+1];
    698        coord_val=[2 1];
    699     else
    700         coord_val=[1 2];
    701     end
    702 end
    703 % if  get(handles.CheckDimensionX,'Value')
    704 %     set(handles.Coord_x,'Value',2)
    705 %     set(handles.Coord_x,'String',dim_var')
    706 % else
    707     set(handles.Coord_x,'Value',coord_val(1))
    708     set(handles.Coord_x,'String',ListCoord)
    709 % end
    710 % if  get(handles.CheckDimensionX,'Value')
    711 %     set(handles.Coord_y,'Value',1)
    712 %     set(handles.Coord_y,'String',dim_var')
    713 % else
    714     set(handles.Coord_y,'Value',coord_val(2))
    715     set(handles.Coord_y,'String',ListCoord)
    716 % end
    717 % if  get(handles.CheckDimensionX,'Value')
    718 %     set(handles.Coord_z,'Value',1)
    719 %     set(handles.Coord_z,'String',dim_var')
    720 % else
    721 if numel(test_coord)>=3
    722     set(handles.Coord_z,'Value',coord_val(2))
     694        coord_val(3)=3;
     695    end
     696    coord_val([1 2])=[1 2];
     697end
     698set(handles.Coord_x,'Value',coord_val(1))
     699set(handles.Coord_x,'String',ListCoord)
     700
     701set(handles.Coord_y,'Value',coord_val(2))
     702set(handles.Coord_y,'String',ListCoord)
     703
     704if numel(coord_val)>=3
     705    set(handles.Coord_z,'Value',coord_val(3))
    723706    set(handles.Coord_z,'String',ListCoord)
    724707    set(handles.Coord_z,'Visible','on')
     
    746729        set(handles.TimeName,'Value',1)
    747730        set(handles.TimeName,'String',ListTime)
    748 end 
     731end
    749732if ~ischar(VarName)
    750 update_field(handles,ScalarName)
     733    update_field(handles,ScalarName)
    751734end
    752735
  • trunk/src/read_civdata.m

    r1033 r1050  
    9696
    9797%% reading data
    98 Data=nc2struct(FileName,'ListGlobalAttribute','CivStage');
    99 if isfield(Data,'Txt')
    100      errormsg=['error in read_civdata: ' Data.Txt];
     98[Data,tild,tild,errormsg]=nc2struct(FileName,'ListGlobalAttribute','CivStage');
     99if ~isempty(errormsg)
     100     errormsg=['read_civdata: ' errormsg];
    101101    return
    102102end
     
    104104[varlist,role,VelTypeOut]=varcivx_generator(ProjModeRequest,VelType,Data.CivStage);
    105105if isempty(varlist)
    106     errormsg=['error in read_civdata: unknow velocity type ' VelType];
     106    errormsg=['read_civdata: unknow velocity type ' VelType];
    107107    return
    108108else
  • trunk/src/uigetfile_uvmat.m

    r1037 r1050  
    197197end
    198198set(hObject,'backgroundColor',[0 1 0])% indicate end button activatio
     199fig_struct=get(hObject,'parent');
     200if isstruct(fig_struct);%recent Matlab
     201uiresume(fig_struct.Number)
     202else
     203   uiresume(fig_struct)
     204end
    199205
    200206%------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.