Changeset 767 for trunk


Ignore:
Timestamp:
May 2, 2014, 10:48:02 PM (7 years ago)
Author:
sommeria
Message:

Setpairs improved in series

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series.m

    r764 r767  
    665665end
    666666ref_i=floor((i1+i2)/2);% reference image number corresponding to the file
    667 set(handles.num_ref_i,'String',num2str(ref_i));
     667% set(handles.num_ref_i,'String',num2str(ref_i));
    668668if isempty(j1)
    669669    j1=1;
     
    673673end
    674674ref_j=floor((j1+j2)/2);% reference image number corresponding to the file
    675 set(handles.num_ref_j,'String',num2str(ref_j));
     675% set(handles.num_ref_j,'String',num2str(ref_j));
     676SeriesData.ref_i=ref_i;
     677SeriesData.ref_j=ref_j;
    676678
    677679%% update first and last indices if they do not exist
     
    10011003end
    10021004if check_pairs
    1003     set(handles.Pairs,'Visible','on')
     1005%     set(handles.Pairs,'Visible','on')
    10041006    set(handles.PairString,'Visible','on')
    10051007    set(handles.SetPairs,'Visible','on')
    10061008else
    1007     set(handles.Pairs,'Visible','off')
     1009%     set(handles.Pairs,'Visible','off')
    10081010    set(handles.PairString,'Visible','off')
    10091011    set(handles.SetPairs,'Visible','off')
     
    12071209set(handles.PairString,'Data',PairString)
    12081210
    1209 %------------------------------------------------------------------------
    1210 function num_ref_i_Callback(hObject, eventdata, handles)
    1211 %------------------------------------------------------------------------
    1212 mode_list=get(handles.mode,'String');
    1213 mode=mode_list{get(handles.mode,'Value')};
    1214 SeriesData=get(handles.series,'UserData');
    1215 iview=get(handles.ListView,'Value');
    1216 fill_ListPair(handles,SeriesData.i1_series{iview},SeriesData.i2_series{iview},...
    1217     SeriesData.j1_series{iview},SeriesData.j2_series{iview},SeriesData.Time{iview});% update the menu of pairs depending on the available netcdf files
    1218 ListPairs_Callback([],[],handles)
    1219 
    1220 %------------------------------------------------------------------------
    1221 function num_ref_j_Callback(hObject, eventdata, handles)
    1222 %------------------------------------------------------------------------
    1223 num_ref_i_Callback(hObject, eventdata, handles)
    12241211
    12251212%------------------------------------------------------------------------
     
    12271214%------------------------------------------------------------------------   
    12281215% check_burst=0;
     1216ModeMenu={''};
    12291217if isempty(j2_series)% no j pair
    12301218    ModeValue=1;
     
    23362324                YName=GetFieldData.PanelOrdinate.ordinate;
    23372325            case 'civdata...'
    2338                 FieldList=set_field_list('U','V','C');
     2326                FieldList=[set_field_list('U','V','C') ;{'C'}];
    23392327                set(handles.FieldName,'Value',2) % set menu to 'velocity
    23402328                XName='X';
    23412329                YName='y';
     2330                set(handles.VelType,'visible','on')
    23422331        end
    23432332        if ~strcmp(GetFieldData.FieldOption,'civdata...')
     2333            set(handles.VelType,'visible','off')
    23442334            XName=GetFieldData.Coordinates.Coord_x;
    23452335            TimeNameStr=GetFieldData.Time.SwitchVarIndexTime;
     
    31263116set(0,'Unit','points')
    31273117ScreenSize=get(0,'ScreenSize');% get the size of the screen, to put the fig on the upper right
    3128 Width=300;% fig width in points (1/72 inch)
     3118Width=220;% fig width in points (1/72 inch)
    31293119Height=min(0.8*ScreenSize(4),300);
    31303120Left=ScreenSize(3)- Width-40; %right edge close to the right, with margin=40
     
    31403130SeriesData=get(handles.series,'UserData');
    31413131% first raw of the GUI
    3142 uicontrol('Style','text','Units','normalized', 'Position', [0.02 0.9 0.5 0.1],'BackgroundColor',BackgroundColor,...
     3132uicontrol('Style','text','Units','normalized', 'Position', [0.05 0.88 0.5 0.1],'BackgroundColor',BackgroundColor,...
    31433133    'String','row to edit #','FontUnits','points','FontSize',12,'FontWeight','bold','ForegroundColor','blue','HorizontalAlignment','right');%title
    31443134uicontrol('Style','popupmenu','Units','normalized', 'Position', [0.54 0.8 0.3 0.2],'tag','ListView','BackgroundColor',[1 1 1],...
    31453135    'String',SeriesData.ListViewMenu,'Value',SeriesData.ListViewValue,'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''ListView'':choice of the file series w for pair display');
    31463136% second raw of the GUI
    3147 uicontrol('Style','text','Units','normalized', 'Position', [0.02 0.8 0.7 0.1],'BackgroundColor',BackgroundColor,...
     3137uicontrol('Style','text','Units','normalized', 'Position', [0.05 0.79 0.7 0.1],'BackgroundColor',BackgroundColor,...
    31483138    'String','mode of index pairing:','FontUnits','points','FontSize',12,'FontWeight','bold','ForegroundColor','blue','HorizontalAlignment','left');%title
    3149 uicontrol('Style','popupmenu','Units','normalized', 'Position', [0.02 0.58 ww 0.2],'tag','Mode','BackgroundColor',[1 1 1],'Callback',@(hObject,eventdata)ModeMenu_Callback(hObject,eventdata),...
     3139uicontrol('Style','popupmenu','Units','normalized', 'Position', [0.05 0.62 ww 0.2],'tag','Mode','BackgroundColor',[1 1 1],'Callback',@(hObject,eventdata)ModeMenu_Callback(hObject,eventdata),...
    31503140    'String',SeriesData.ModeMenu,'Value',SeriesData.ModeValue,'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''Mode'': choice of the image pair mode');
    31513141% third raw
    3152 uicontrol('Style','text','Units','normalized', 'Position', [0.02 0.6 0.7 0.1],'BackgroundColor',BackgroundColor,...
     3142uicontrol('Style','text','Units','normalized', 'Position', [0.05 0.6 0.7 0.1],'BackgroundColor',BackgroundColor,...
    31533143    'String','pair choice:','FontUnits','points','FontSize',12,'FontWeight','bold','ForegroundColor','blue','HorizontalAlignment','left');%title
    3154 uicontrol('Style','listbox','Units','normalized', 'Position', [0.02 0.16 ww 0.4],'tag','ListPairs','BackgroundColor',[1 1 1],'Callback',@(hObject,eventdata)ListPairsMenu_Callback(hObject,eventdata),...
     3144uicontrol('Style','listbox','Units','normalized', 'Position', [0.05 0.42 ww 0.2],'tag','ListPairs','BackgroundColor',[1 1 1],'Callback',@(hObject,eventdata)ListPairsMenu_Callback(hObject,eventdata),...
    31553145    'String',SeriesData.ListPairsMenu,'Value',SeriesData.ListPairsValue,'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''ListPairs'': menu for selecting the image pair');
     3146uicontrol('Style','text','Units','normalized', 'Position', [0.1 0.22 0.8 0.1],'BackgroundColor',BackgroundColor,...
     3147    'String','ref_i           ref_j','FontUnits','points','FontSize',12,'FontWeight','bold','ForegroundColor','blue','HorizontalAlignment','center');%title
     3148uicontrol('Style','edit','Units','normalized', 'Position', [0.15 0.17 0.3 0.08],'tag','num_ref_i','BackgroundColor',[1 1 1],'Callback',@(hObject,eventdata)num_ref_i_Callback(hObject,eventdata),...
     3149    'String',num2str(SeriesData.ref_i),'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''num_ref_i'': reference field index i used to display dt in ''list_pair_civ''');
     3150uicontrol('Style','edit','Units','normalized', 'Position', [0.55 0.17 0.3 0.08],'tag','num_ref_j','BackgroundColor',[1 1 1],'Callback',@(hObject,eventdata)num_ref_j_Callback(hObject,eventdata),...
     3151    'String',num2str(SeriesData.ref_j),'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''num_ref_j'': reference field index i used to display dt in ''list_pair_civ''');
    31563152%  last raw  of the GUI: pushbuttons
    3157 wwp=(1-4*ii)/3; %width of the push buttons
    3158 uicontrol('Style','pushbutton','Units','normalized', 'Position', [ii ii wwp hh],'BackgroundColor',[0 1 0],'String','OK','Callback',@(hObject,eventdata)OK_Callback(hObject,eventdata),...
     3153uicontrol('Style','pushbutton','Units','normalized', 'Position', [0.35 0.01 0.3 0.15],'BackgroundColor',[0 1 0],'String','OK','Callback',@(hObject,eventdata)OK_Callback(hObject,eventdata),...
    31593154    'FontWeight','bold','FontUnits','points','FontSize',12,'TooltipString','''OK'': apply the output to the current field series in uvmat');
    31603155drawnow
     
    32003195set(hPairString,'Data',PairString)
    32013196
     3197%------------------------------------------------------------------------
     3198function num_ref_i_Callback(hObject, eventdata)
     3199%------------------------------------------------------------------------
     3200hMode=findobj(get(hObject,'parent'),'Tag','Mode');
     3201mode_list=get(hMode,'String');
     3202mode=mode_list{get(hMode,'Value')};
     3203hseries=findobj(allchild(0),'tag','series');
     3204hhseries=guidata(hseries);
     3205SeriesData=get(hseries,'UserData');
     3206hListView=findobj(get(hObject,'parent'),'Tag','ListView');
     3207iview=get(hListView,'Value');
     3208fill_ListPair(hhseries,SeriesData.i1_series{iview},SeriesData.i2_series{iview},...
     3209    SeriesData.j1_series{iview},SeriesData.j2_series{iview},SeriesData.Time{iview});% update the menu of pairs depending on the available netcdf files
     3210
     3211hListPairs=findobj(get(hObject,'parent'),'Tag','ListPairs');
     3212ListPairsMenu_Callback(hListPairs,eventdata)
     3213
     3214%------------------------------------------------------------------------
     3215function num_ref_j_Callback(hObject, eventdata)
     3216%------------------------------------------------------------------------
     3217num_ref_i_Callback(hObject, eventdata)
     3218
    32023219%-------------------------------------------------------------
    32033220% --- Executes on selection in ListPairs.
     
    32053222%------------------------------------------------------------
    32063223delete(get(hObject,'parent'))
    3207 
Note: See TracChangeset for help on using the changeset viewer.