Changeset 754 for trunk/src/get_field.m


Ignore:
Timestamp:
Apr 27, 2014, 11:18:06 PM (10 years ago)
Author:
sommeria
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/get_field.m

    r752 r754  
    988988Field=get(handles.get_field,'UserData');
    989989index=get(handles.SwitchVarIndexTime,'Value');
     990MenuIndex=get(handles.TimeName,'Value');
     991string=get(handles.TimeName,'String');
     992TimeName=string{MenuIndex};
    990993switch index
    991994    case 1
     
    994997    case 2
    995998        set(handles.num_TimeDimension,'String','')
    996         attr_index=strcmpi(TimeUnit,Field.ListGlobalAttribute);
     999        attr_index=find(strcmpi([TimeName 'Unit'],Field.ListGlobalAttribute));% look for time unit
    9971000        if ~isempty(attr_index)
    9981001            AttrName=Field.ListGlobalAttribute{attr_index};
     
    10001003        end
    10011004    case {3 ,4}
    1002         MenuIndex=get(handles.TimeName,'Value');
    1003         string=get(handles.TimeName,'String');
    10041005        if index==3  % TimeName is used to chose a variable
    1005             VarName=string{MenuIndex};
    1006             VarIndex=name2index(VarName,Field.ListVarName);
     1006            VarIndex=name2index(TimeName,Field.ListVarName);
    10071007            DimName=Field.VarDimName{VarIndex};
    10081008            DimIndex=name2index(DimName,Field.ListDimName);
     
    10141014            end
    10151015            set(handles.TimeUnit,'String',unit)
    1016             update_field(handles,VarName)
     1016            update_field(handles,TimeName)
    10171017        elseif index==4% TimeName is used to chose a dimension
    10181018            DimName=string{MenuIndex};
     
    10211021            set(handles.num_TimeDimension,'String',num2str(DimValue))
    10221022            set(handles.TimeUnit,'String','index')
    1023            
    10241023        end
    10251024end
Note: See TracChangeset for help on using the changeset viewer.