Changeset 713


Ignore:
Timestamp:
Feb 20, 2014, 3:49:21 PM (11 years ago)
Author:
sommeria
Message:

improving figure extracting and keyboard callback

Location:
trunk/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/keyboard_callback.m

    r710 r713  
    5252            switch get(gco,'tag')% tag of the current edit box
    5353                case {'RootPath', 'SubDir','RootFile','FileExt','RootPath_1', 'SubDir_1','RootFile_1','FileExt_1'}
    54                     set(handleshaxes.REFRESH,'BackgroundColor',[1 0 1])%indicat that REFRESH must be activated (intyroduce the whole series)
     54                    set(handleshaxes.InputFileREFRESH,'BackgroundColor',[1 0 1])%indicat that REFRESH must be activated (intyroduce the whole series)
     55                case 'num_IndexIncrement'% no action
    5556                otherwise
    56                     set(handleshaxes.run0,'BackgroundColor',[1 0 1])%indicat that run0 must be activated
     57                    set(handleshaxes.REFRESH,'BackgroundColor',[1 0 1])%indicat that run0 must be activated
    5758            end
    5859    end
  • trunk/src/mouse_down.m

    r710 r713  
    140140                msg_pos(1:2)=GUI_pos(1:2)+obj_pos(1:2).*GUI_pos(3:4);
    141141                display_str=get(hchild,'TooltipString');
    142                 msgbox_uvmat(['uicontrol: ' get(hchild,'Tag')],display_str,get(hchild,'String'),msg_pos);
     142                output=msgbox_uvmat(['uicontrol: ' get(hchild,'Tag')],display_str,get(hchild,'String'),msg_pos);
     143                %update the parent edit box and indicat that refresh is needed with the new input
     144                if strcmp(get(hchild,'Style'),'edit')&&strcmp(get(hchild,'Enable'),'on')
     145                    set(hchild,'String',output)
     146                    if strcmp(get(get(hchild,'parent'),'tag'),'InputFile')
     147                                hhREFRESH=hhCurrentGUI.InputFileREFRESH;
     148                            else
     149                                hhREFRESH=hhCurrentGUI.REFRESH;
     150                            end
     151                    switch get(hchild,'tag')% tag of the current edit box
     152                        case {'RootPath', 'SubDir','RootFile','FileExt','RootPath_1', 'SubDir_1','RootFile_1','FileExt_1'}
     153                            set(hhREFRESH,'BackgroundColor',[1 0 1])%indicat that REFRESH must be activated (intyroduce the whole series)
     154                        case 'num_IndexIncrement'% no action
     155                        otherwise
     156                            set(hhREFRESH,'BackgroundColor',[1 0 1])%indicat that run0 must be activated
     157                    end
     158                end
    143159                return %leave the function once a uicontrol has been selected
    144160            end
     
    164180                        msg_pos=GUI_pos(1:2)+panel_pos(1:2).*GUI_pos(3:4)+PosChildren(ind_object,1:2).*panel_pos(3:4).*GUI_pos(3:4);
    165181                        display_str=get(hhchild,'TooltipString');
    166                         msgbox_uvmat(['uicontrol: ' get(hhchild,'Tag')],display_str,get(hhchild,'String'),msg_pos);
     182                        output=msgbox_uvmat(['uicontrol: ' get(hhchild,'Tag')],display_str,get(hhchild,'String'),msg_pos);
     183                        %update the parent edit box and indicat that refresh is needed with the new input
     184                        if strcmp(get(hhchild,'Style'),'edit')&&strcmp(get(hhchild,'Enable'),'on')
     185                            set(hhchild,'String',output)
     186                            if strcmp(get(get(hhchild,'parent'),'tag'),'InputFile')
     187                                hhREFRESH=hhCurrentGUI.InputFileREFRESH;
     188                            else
     189                                hhREFRESH=hhCurrentGUI.REFRESH;
     190                            end
     191                            switch get(hhchild,'tag')% tag of the current edit box
     192                                case {'RootPath', 'SubDir','RootFile','FileExt','RootPath_1', 'SubDir_1','RootFile_1','FileExt_1'}
     193                                    set(hhREFRESH,'BackgroundColor',[1 0 1])%indicat that REFRESH must be activated (intyroduce the whole series)
     194                                case 'num_IndexIncrement'% no action
     195                                otherwise
     196                                    set(hhREFRESH,'BackgroundColor',[1 0 1])%indicat that run0 must be activated
     197                            end
     198                        end
    167199                    else
    168200                        set(hObject,'CurrentObject',hhchild)
  • trunk/src/msgbox_uvmat.m

    r654 r713  
    6262set(handles.Cancel,'Position',[300 2 60 30])
    6363set(handles.Cancel,'FontSize',15)
    64 
     64%set(hObject,'WindowKeyPressFcn',{'@keyboard_callback',handles})%set keyboard action function
    6565
    6666% Update handles structure
     
    206206    else
    207207        if strcmp(get(handles.edit_box,'Style'),'listbox')
    208              varargout{1}=get(handles.edit_box,'Value');
     208            varargout{1}=get(handles.edit_box,'Value');
    209209        else
    210         varargout{1}=get(handles.edit_box,'String');
     210            varargout{1}=get(handles.edit_box,'String');
    211211        end
    212         if isempty(varargout{1}) 
     212        if isempty(varargout{1})
    213213            varargout{1}='Yes';
    214214        end
    215215    end
     216    if strcmp(get(handles.edit_box, 'Visible'), 'on')
     217        varargout{2}=get(handles.edit_box,'String');
     218    end
    216219    % The figure can be deleted now
    217220    delete(handles.figure1);
    218221end
     222
    219223%  delete(handles.figure1);
    220224
     
    276280end   
    277281
    278 
    279 
    280 
    281 
     282%'keyboard_callback:' function activated when a key is pressed on the keyboard
     283%-----------------------------------
     284function keyboard_callback(hObject,eventdata,handleshaxes)
     285cur_axes=get(hObject,'CurrentAxes');%current plotting axes of the figure with handle hObject
     286xx=double(get(hObject,'CurrentCharacter')) %get the keyboard character
     287
     288
     289
  • trunk/src/sub_field.m

    r674 r713  
    183183
    184184function OutputCell=regexprep_r(InputCell,search_string,new_string)
     185if ischar(InputCell); InputCell={InputCell}; end
    185186OutputCell=InputCell;%default
    186187for icell=1:numel(InputCell)
  • trunk/src/uvmat.m

    r710 r713  
    4646%          .HistoAxes: idem for histogram axes
    4747
    48 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   DATA FLOW  (for run0_Callback) %%%%%%%%%%%%%%%%%%%%:
     48% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   DATA FLOW  (for REFRESH_Callback) %%%%%%%%%%%%%%%%%%%%:
    4949%
    5050%
     
    435435set(handles.PlotAxes,'Units','pixels')
    436436set(handles.PlotAxes,'Position',pos)
     437set(handles.PlotAxes,'Units','normalized')
    437438
    438439
     
    594595FileIndex=fullfile_uvmat('','','','',get(handles.NomType,'String'),i1,i2,j1,j2);
    595596set(handles.FileIndex,'String',FileIndex)
    596 % refresh the current settings and refresh the field view
     597% inputfilerefresh the current settings and inputfilerefresh the field view
    597598RootPath_Callback(hObject,eventdata,handles)
    598599
     
    607608FileIndex=fullfile_uvmat('','','','',get(handles.NomType_1,'String'),i1,i2,j1,j2);
    608609set(handles.FileIndex_1,'String',FileIndex)
    609 % refresh the current settings and refresh the field view
     610% inputfilerefresh the current settings and inputfilerefresh the field view
    610611RootPath_1_Callback(hObject,eventdata,handles)
    611612
    612613%------------------------------------------------------------------------
    613 % --- Executes on button press in REFRESH.
    614 function REFRESH_Callback(hObject, eventdata, handles)
     614% --- Executes on button press in InputFileREFRESH.
     615function InputFileREFRESH_Callback(hObject, eventdata, handles)
    615616%------------------------------------------------------------------------   
    616 set(handles.REFRESH,'BackgroundColor',[1 1 0])% set button color to yellow to indicate that refresh is under action
     617set(handles.InputFileREFRESH,'BackgroundColor',[1 1 0])% set button color to yellow to indicate that refresh is under action
    617618% read the current input file name:
    618619[RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes(handles);
     
    623624% detect the file type, get the movie object if relevant, and look for the corresponding file series:
    624625[RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,tild,FileType,FileInfo,MovieObject]=find_file_series(fullfile(RootPath,SubDir),[RootFile FileIndices FileExt]);
    625 % initiate the input file series and refresh the current field view:
     626% initiate the input file series and inputfilerefresh the current field view:
    626627errormsg=update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileType,MovieObject,1);
    627 % refresh the second series if selected
     628% inputfilerefresh the second series if selected
    628629if get(handles.SubField,'Value')
    629630    [RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes_1(handles);
     
    634635    % detect the file type, get the movie object if relevant, and look for the corresponding file series:
    635636    [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,tild,FileType,MovieObject]=find_file_series(fullfile(RootPath,SubDir),[RootFile FileIndices FileExt]);
    636     % initiate the input file series and refresh the current field view:
     637    % initiate the input file series and inputfilerefresh the current field view:
    637638    errormsg=update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileType,MovieObject,2);
    638639end
    639640
    640641if isempty(errormsg)
    641 set(handles.REFRESH,'BackgroundColor',[1 0 0])% set button color to red to indicate that refresh has been updated
    642 else
    643     set(handles.REFRESH,'BackgroundColor',[1 0 1])% keep button color magenta, input not succesfull
     642set(handles.InputFileREFRESH,'BackgroundColor',[1 0 0])% set button color to red to indicate that refresh has been updated
     643else
     644    set(handles.InputFileREFRESH,'BackgroundColor',[1 0 1])% keep button color magenta, input not succesfull
    644645end
    645646
     
    681682    set(handles.TimeValue_1,'Visible','on')
    682683end
    683 set(handles.REFRESH,'BackgroundColor',[1 1 0])% paint REFRESH button to yellow to visualise root file input
     684set(handles.InputFileREFRESH,'BackgroundColor',[1 1 0])% paint REFRESH button to yellow to visualise root file input
    684685set(handles.uvmat,'Pointer','watch') % set the mouse pointer to 'watch'
    685686drawnow
     
    801802        set(handles.MenuTools,'Enable','on')
    802803
    803         % initiate input file series and refresh the current field view:     
     804        % initiate input file series and inputfilerefresh the current field view:     
    804805        update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileType,MovieObject,index);
    805806
     
    825826end
    826827
    827 set(handles.REFRESH,'BackgroundColor',[1 0 0])% paint back button to red to indicate update is finished
     828set(handles.InputFileREFRESH,'BackgroundColor',[1 0 0])% paint back button to red to indicate update is finished
    828829set(handles.uvmat,'Pointer','arrow')% set back the mouse pointer to arrow
    829830
     
    831832%------------------------------------------------------------------------
    832833% --- Update information about a new field series (indices to scan, timing,
    833 %     calibration from an xml file, then refresh current plots
     834%     calibration from an xml file, then inputfilerefresh current plots
    834835function errormsg=update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileType,VideoObject,index)
    835836%------------------------------------------------------------------------
     
    847848set(handles.FieldName,'UserData',[])% reinialize data from uvmat opening
    848849UvData=get(handles.uvmat,'UserData');%huvmat=handles of the uvmat interface
    849 UvData.NewSeries=1; %flag for run0: begin a new series
     850UvData.NewSeries=1; %flag for REFRESH: begin a new series
    850851UvData.FileName_1='';% name of the current second field (used to detect a  constant field during file scanning)
    851852UvData.FileType{index}=FileType;
     
    916917NbSlice=1;%default
    917918ImaDoc_str='';
    918 set(handles.REFRESH,'BackgroundColor',[1 1 0])
     919set(handles.InputFileREFRESH,'BackgroundColor',[1 1 0])
    919920if ~isempty(XmlFileName)
    920921    set(handles.view_xml,'Visible','on')
     
    10881089        set(handles_Fields,'Value',1)
    10891090        set(handles_Fields,'String',{'get_field...'})
    1090         FieldName_Callback([],[], handles)
     1091        if index==1
     1092            FieldName_Callback([],[], handles)
     1093        else
     1094            FieldName_1_Callback([],[], handles)
     1095        end
    10911096    otherwise
    10921097        set(handles_Fields,'Value',1) % set menu to 'image'
     
    10981103set(handles.uvmat,'UserData',UvData)
    10991104
    1100 %% set index navigation options and refresh plots
     1105%% set index navigation options and inputfilerefresh plots
    11011106scan_option='i';%default
    11021107state_j='off'; %default
     
    14571462%------------------------------------------------------------------------
    14581463%------------------------------------------------------------------------
    1459 % III - MAIN REFRESH FUNCTIONS : 'FRAME PLOT'
     1464% III - MAIN InputFileREFRESH FUNCTIONS : 'FRAME PLOT'
    14601465%------------------------------------------------------------------------
    14611466
    14621467%------------------------------------------------------------------------
    14631468% --- Executes on button press in runplus: make one step forward and call
    1464 % --- run0. The step forward is along the fieldname series 1 or 2 depending on
     1469% --- InputFileREFRESH. The step forward is along the fieldname series 1 or 2 depending on
    14651470% --- the scan_i and scan_j check box (exclusive each other)
    14661471function runplus_Callback(hObject, eventdata, handles)
     
    14811486%------------------------------------------------------------------------
    14821487% --- Executes on button press in runmin: make one step backward and call
    1483 % --- run0. The step backward is along the fieldname series 1 or 2 depending on
     1488% --- InputFileREFRESH. The step backward is along the fieldname series 1 or 2 depending on
    14841489% --- the scan_i and scan_j check box (exclusive each other)
    14851490function runmin_Callback(hObject, eventdata, handles)
     
    17821787filename=fullfile_uvmat(InputFile.RootPath,InputFile.SubDir,InputFile.RootFile,FileExt,NomType,i1,i2,j1,j2);
    17831788
    1784 %% refresh plots
     1789%% inputfilerefresh plots
    17851790if sub_value
    17861791    filename_1=fullfile_uvmat(InputFile.RootPath_1,InputFile.SubDir_1,InputFile.RootFile_1,InputFile.FileExt_1,InputFile.NomType_1,i1_1,i2_1,j1_1,j2_1);
     
    17891794    errormsg=refresh_field(handles,filename,filename_1,i1,i2,j1,j2);
    17901795end
    1791 set(handles.run0,'BackgroundColor',[1 0 0])
     1796set(handles.InputFileREFRESH,'BackgroundColor',[1 0 0])
    17921797
    17931798%% update the index counters if the index move is successfull
     
    18401845else
    18411846    set(handles.movie_pair,'BusyAction','queue')
    1842     set(handles.run0,'BackgroundColor',[1 0 0])
     1847    set(handles.InputFileREFRESH,'BackgroundColor',[1 0 0])
    18431848end
    18441849
     
    19821987
    19831988%------------------------------------------------------------------------
    1984 % --- Executes on button press in run0.
    1985 function run0_Callback(hObject, eventdata, handles)
    1986 %------------------------------------------------------------------------
    1987 set(handles.run0,'BackgroundColor',[1 1 0])%paint the command button in yellow
     1989% --- Executes on button press in InputFileREFRESH.
     1990function REFRESH_Callback(hObject, eventdata, handles)
     1991%------------------------------------------------------------------------
     1992set(handles.REFRESH,'BackgroundColor',[1 1 0])%paint the command button in yellow
    19881993drawnow
    19891994[RootPath,SubDir,RootFile,FileIndex,FileExt]=read_file_boxes(handles);
     
    20182023    set(handles.FileIndex,'BackgroundColor',[1 1 1])
    20192024    set(handles.FileIndex_1,'BackgroundColor',[1 1 1]) 
    2020     set(handles.run0,'BackgroundColor',[1 0 0])
     2025    set(handles.REFRESH,'BackgroundColor',[1 0 0])
    20212026end   
    20222027
    20232028%------------------------------------------------------------------------
    2024 % --- read the input files and refresh all the plots, including projection.
     2029% --- read the input files and inputfilerefresh all the plots, including projection.
    20252030% OUTPUT:
    20262031%  errormsg: error message char string  =[] by default
     
    20632068    set(handles.z_index,'String',num2str(z_index))
    20642069end
    2065 % refresh menu for save_mask if relevant
     2070% inputfilerefresh menu for save_mask if relevant
    20662071masknumber=get(handles.masklevel,'String');
    20672072if length(masknumber)>=z_index
     
    22172222        ParamIn_1.FieldName=FieldName_1;
    22182223        ParamIn_1.VelType=VelType_1;
    2219         %ParamIn_1.GUIName='get_field_1';
     2224        ParamIn_1.Coord_x=get(handles.Coord_x,'String');
     2225        ParamIn_1.Coord_y=get(handles.Coord_y,'Data');
    22202226        end 
    22212227        [Field{2},ParamOut_1,errormsg] = read_field(FileName_1,UvData.FileType{2},ParamIn_1,frame_index_1);
     
    22732279    %     end
    22742280elseif ~test_keepdata_1
    2275     if (~strcmp(UvData.FileType{2},'netcdf')&&~strcmp(UvData.FileType{2},'civdata')&&~strcmp(UvData.FileType{2},'civx'))|| isequal(FieldName_1,'get_field...')
    2276         set(handles.VelType_1,'Visible','off')
    2277     else
     2281    if (strcmp(UvData.FileType{2},'civx')||strcmp(UvData.FileType{2},'civdata'))&& ~strcmp(FieldName_1,'get_field...')
     2282%     if (~strcmp(UvData.FileType{2},'netcdf')&&~strcmp(UvData.FileType{2},'civdata')&&~strcmp(UvData.FileType{2},'civx'))|| isequal(FieldName_1,'get_field...')
    22782283        test_veltype_1=1;
    22792284        set(handles.VelType_1,'Visible','on')
     
    22822287        set(handles.VelType_1,'Value',1+find(index_menu,1))
    22832288        set(handles.VelType_1,'String',[{''};menu])
     2289    else
     2290         set(handles.VelType_1,'Visible','off')
    22842291    end
    22852292    % update the second field menu: the same quantity
     
    24362443UvData.ParamOut_1=ParamOut_1;
    24372444if numel(Field)==2
    2438 UvData.Field_1=Field{2}; %store the second field for possible use at next RUN
     2445    UvData.Field_1=Field{2}; %store the second field for possible use at next RUN
    24392446end
    24402447
     
    29462953        TransformName_Callback(hObject, eventdata, handles);
    29472954    else
    2948         run0_Callback(hObject, eventdata, handles)
     2955        REFRESH_Callback(hObject, eventdata, handles)
    29492956    end 
    29502957else
     
    31643171            UvData.FileType{1}='netcdf';
    31653172            set(handles.uvmat,'UserData',UvData)
    3166             run0_Callback(hObject, eventdata, handles)
     3173            REFRESH_Callback(hObject, eventdata, handles)
    31673174        end
    31683175       
     
    31863193        display_file_name(handles,imagename)%display the image
    31873194    otherwise
    3188         run0_Callback(hObject, eventdata, handles)
     3195        REFRESH_Callback(hObject, eventdata, handles)
    31893196end
    31903197
     
    32233230switch field_1
    32243231    case 'get_field...'
    3225         set_veltype_display(0) % no veltype display
    3226         hget_field=findobj(allchild(0),'name','get_field_1');
    3227         if ~isempty(hget_field)
    3228             delete(hget_field)
    3229         end
    3230         hget_field=get_field(FileName_1);
    3231         set(hget_field,'name','get_field_1')
    3232         hhget_field=guidata(hget_field);
    3233         set(hhget_field.list_fig,'Value',1)
    3234         set(hhget_field.list_fig,'String',{'uvmat'})
    3235         if check_new
    3236             UvData.FileType{2}=UvData.FileType{1};
    3237             set(handles.FileIndex_1,'String',get(handles.FileIndex,'String'))
    3238               set(handles.uvmat,'UserData',UvData)
    3239         end
     3232         %% fill the coordinates and variables from selections in get_field
     3233        ParamIn=[];
     3234        % in case of civ data, we use the civ choice as default input for the GUI get_field
     3235        if strcmp(get(handles.VelType_1,'Visible'),'on')
     3236            ParamIn.SwitchVarIndexTime='attribute';
     3237            ListVelType=get(handles.VelType_1,'String');
     3238            VelType=ListVelType{get(handles.VelType_1,'Value')};
     3239            switch VelType
     3240                case 'civ1'
     3241                    ParamIn.TimeAttrName='Civ1_Time';
     3242                    ParamIn.vector_x='Civ1_U';
     3243                    ParamIn.vector_y='Civ1_V';
     3244                    ParamIn.vec_color='Civ1_C';
     3245                case 'filter1'
     3246                    ParamIn.TimeAttrName='Civ1_Time';
     3247                    ParamIn.vector_x='Civ1_U_smooth';
     3248                    ParamIn.vector_y='Civ1_V_smooth';
     3249                case 'civ2'
     3250                    ParamIn.TimeAttrName='Civ2_Time';
     3251                    ParamIn.vector_x='Civ2_U';
     3252                    ParamIn.vector_y='Civ2_V';
     3253                case 'filter2'
     3254                    ParamIn.TimeAttrName='Civ2_Time';
     3255                    ParamIn.vector_x='Civ2_U_smooth';
     3256                    ParamIn.vector_y='Civ2_V_smooth';
     3257                    ParamIn.vec_color='Civ2_C';
     3258            end
     3259        end
     3260       
     3261        % VelType menu desactivated
     3262        set(handles.FixVelType,'visible','off')
     3263        set(handles.VelType,'Visible','off')
     3264       
     3265        %read selection from get_field
     3266        [RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes_1(handles);
     3267        FileName=[fullfile(RootPath,SubDir,RootFile) FileIndices FileExt];
     3268        GetFieldData=get_field(FileName,ParamIn);% inport field names from the GUI get_field
     3269        FieldList={};
     3270        VecColorList={};
     3271        switch GetFieldData.FieldOption
     3272            case 'vectors'
     3273                UName=GetFieldData.PanelVectors.vector_x;
     3274                VName=GetFieldData.PanelVectors.vector_y;
     3275                YName={GetFieldData.Coordinates.Coord_y};
     3276                CName=GetFieldData.PanelVectors.vec_color;
     3277                FieldList={['vec(' UName ',' VName ')'];...
     3278                    ['norm(' UName ',' VName ')'];...
     3279                    UName;VName};
     3280                VecColorList={['norm(' UName ',' VName ')'];...
     3281                    UName;VName};
     3282                if ~isempty(CName)
     3283                    VecColorList=[{CName};VecColorList];
     3284                end
     3285            case 'scalar'
     3286                AName=GetFieldData.PanelScalar.scalar;
     3287                YName={GetFieldData.Coordinates.Coord_y};
     3288                FieldList={AName};
     3289            case '1D plot'
     3290                YName=GetFieldData.PanelOrdinate.ordinate;
     3291            case 'civdata...'%reinitiate input, return to automatic civ data reading
     3292                display_file_name(handles,FileName,1)
     3293        end
     3294        if ~strcmp(GetFieldData.FieldOption,'civdata...')
     3295            XName=GetFieldData.Coordinates.Coord_x;
     3296            TimeNameStr=GetFieldData.Time.SwitchVarIndexTime;
     3297            switch TimeNameStr
     3298                case 'file index'
     3299                    set(handles.TimeName_1,'String','');
     3300                case 'attribute'
     3301                    set(handles.TimeName_1,'String',['att:' GetFieldData.Time.TimeName]);
     3302                case 'variable'
     3303                    set(handles.TimeName_1,'String',['var:' GetFieldData.Time.TimeName])
     3304                    set(handles.NomType_1,'String','*')
     3305                    set(handles.RootFile_1,'String',[get(handles.RootFile,'String') get(handles.FileIndex,'String')])
     3306                    set(handles.FileIndex_1,'String','')
     3307                    ParamIn.TimeVarName=GetFieldData.Time.TimeName;
     3308                case 'matrix_index'
     3309                    set(handles.TimeName_1,'String',['dim:' GetFieldData.Time.TimeName]);
     3310                    set(handles.NomType_1,'String','*')
     3311                    set(handles.RootFile_1,'String',[get(handles.RootFile,'String') get(handles.FileIndex,'String')])
     3312                    set(handles.FileIndex_1,'String','')
     3313                    ParamIn.TimeDimName_1=GetFieldData.Time.TimeName;
     3314            end
     3315            set(handles.Coord_x,'String',XName)
     3316            if ischar(YName)
     3317                YName={YName};
     3318            end
     3319            set(handles.Coord_y,'Data',YName)
     3320            set(handles.FieldName_1,'Value',1)
     3321            set(handles.FieldName_1,'String',[FieldList; {'get_field...'}]);
     3322            set(handles.ColorScalar,'Value',1)
     3323            set(handles.ColorScalar,'String',VecColorList);
     3324            UvData.FileType{2}='netcdf';
     3325            set(handles.uvmat,'UserData',UvData)
     3326            REFRESH_Callback(hObject, eventdata, handles)
     3327        end
     3328         
     3329%         set_veltype_display(0) % no veltype display
     3330%         hget_field=findobj(allchild(0),'name','get_field_1');
     3331%         if ~isempty(hget_field)
     3332%             delete(hget_field)
     3333%         end
     3334%         hget_field=get_field(FileName_1);
     3335%         set(hget_field,'name','get_field_1')
     3336%         hhget_field=guidata(hget_field);
     3337%         set(hhget_field.list_fig,'Value',1)
     3338%         set(hhget_field.list_fig,'String',{'uvmat'})
     3339%         if check_new
     3340%             UvData.FileType{2}=UvData.FileType{1};
     3341%             set(handles.FileIndex_1,'String',get(handles.FileIndex,'String'))
     3342%               set(handles.uvmat,'UserData',UvData)
     3343%         end
    32403344    case 'image'
    32413345        %% look for image corresponding to civ data
     
    32833387 
    32843388        if check_refresh && ~(isfield(UvData,'NewSeries')&&isequal(UvData.NewSeries,1))
    3285             run0_Callback(hObject, eventdata, handles)
     3389            REFRESH_Callback(hObject, eventdata, handles)
    32863390        end
    32873391end
     
    33283432function FixVelType_Callback(hObject, eventdata, handles)
    33293433%------------------------------------------------------------------------
    3330 % refresh the current plot if the fixed  veltype is unselected
     3434% inputfilerefresh the current plot if the fixed  veltype is unselected
    33313435if ~get(handles.FixVelType,'Value')
    3332     run0_Callback(hObject, eventdata, handles)
     3436    REFRESH_Callback(hObject, eventdata, handles)
    33333437end
    33343438
     
    33383442%------------------------------------------------------------------------
    33393443set(handles.FixVelType,'Value',1)
    3340 run0_Callback(hObject, eventdata, handles)
     3444REFRESH_Callback(hObject, eventdata, handles)
    33413445
    33423446%------------------------------------------------------------------------
     
    33463450set(handles.FixVelType,'Value',1)% the velocity type is now imposed by the GUI (not automatic)
    33473451UvData=get(handles.uvmat,'UserData');
    3348 set(handles.run0,'BackgroundColor',[1 1 0])%paint run0 button in yellow to indicate its activation
     3452set(handles.InputFileREFRESH,'BackgroundColor',[1 1 0])%paint REFRESH button in yellow to indicate its activation
    33493453drawnow   
    33503454InputFile=read_GUI(handles.InputFile);% read the input file parameters
     
    33763480end
    33773481
    3378 % refresh the current plot if it has not been done previously
     3482% inputfilerefresh the current plot if it has not been done previously
    33793483if check_refresh
    33803484    UvData.FileName_1='';% desactivate the use of a constant second file
     
    33963500        set(handles.FileIndex_1,'BackgroundColor',[1 1 1])
    33973501    end
    3398     set(handles.run0,'BackgroundColor',[1 0 0])
     3502    set(handles.InputFileREFRESH,'BackgroundColor',[1 0 0])
    33993503end
    34003504
     
    37153819set(handles.uvmat,'UserData',UvData)
    37163820
    3717 %% refresh the current plot
     3821%% inputfilerefresh the current plot
    37183822if isempty(list_path{ichoice}) || nargin(transform_handle)<3
    37193823    set(handles.SubField,'Value',0)
    37203824    SubField_Callback(hObject, eventdata, handles)
    37213825else
    3722     run0_Callback(hObject, eventdata, handles)
     3826    REFRESH_Callback(hObject, eventdata, handles)
    37233827end
    37243828
     
    39454049update_color_code_boxes(handles);
    39464050%replot the current graph
    3947 run0_Callback(hObject, eventdata, handles)
     4051REFRESH_Callback(hObject, eventdata, handles)
    39484052
    39494053%----------------------------------------------------------------
     
    40664170function update_plot(handles)
    40674171%-------------------------------------------------------------------
    4068 set(handles.run0,'BackgroundColor',[1 1 0]);% display plot activity by yellow color
     4172set(handles.REFRESH,'BackgroundColor',[1 1 0]);% display plot activity by yellow color
    40694173drawnow
    40704174UvData=get(handles.uvmat,'UserData');
     
    40774181    return
    40784182end
    4079 set(handles.run0,'BackgroundColor',[1 0 0]);
     4183set(handles.REFRESH,'BackgroundColor',[1 0 0]);
    40804184
    40814185%------------------------------------------------------------------------
     
    44564560function MenuExportFigure_Callback(hObject, eventdata, handles)
    44574561%------------------------------------------------------------------------
    4458 % huvmat=get(handles.MenuExport,'parent');
    44594562hfig=figure;
    44604563copyobj(handles.PlotAxes,hfig);
     4564h=findobj(handles.PlotAxes,'tag','ima'); %look for image in the plot
     4565if ~isempty(h)
    44614566map=colormap(handles.PlotAxes);
    44624567colormap(map);%transmit the current colormap to the zoom fig
    44634568colorbar
     4569end
    44644570
    44654571% --------------------------------------------------------------------
     
    45234629% --------------------------------------------------------------------
    45244630set(handles.MenuExportMovie,'BusyAction','queue')% activate the button
    4525 huvmat=get(handles.run0,'parent');
     4631huvmat=get(handles.InputFileREFRESH,'parent');
    45264632UvData=get(huvmat,'UserData');
    45274633%[xx,xx,FileBase]=read_file_boxes(handles);
Note: See TracChangeset for help on using the changeset viewer.