Index: trunk/src/uvmat.m
===================================================================
--- trunk/src/uvmat.m	(revision 405)
+++ trunk/src/uvmat.m	(revision 406)
@@ -79,8 +79,12 @@
 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   DATA FLOW  (for run0_Callback) %%%%%%%%%%%%%%%%%%%%:
 %
-% fields are opened and visualised by the sub-function refresh_field.m
-% (called by uvmat_opening, RUN0, runp and runm)
+%
+% 1) Input filenames are determined by MenuBrowse (first field), MenuBrowse_1
+% (second field), or by the stored file names under  Browse, or as an input of uvmat. 
+% 2) These functions call 'display_file_name.m' which detects the file series, and fills the file index boxes
+% 3) Then 'update_rootinfo.m' Updates information about a new field series (indices to scan, timing, calibration from an xml file)
+% 4) Then fields are opened and visualised by the main sub-function 'refresh_field.m'
 % The function first reads the name of the input file from the edit boxes  of the GUI
-% A second input file can be introduced for filed comparison
+% A second input file can be introduced for file comparison
 % It then reads the input file(s) with the appropriate function, read for
 % images, read_civxdata.m for CIVx PIV data, nc2struct for other netcdf
@@ -168,5 +172,5 @@
 %------------------------------------------------------------------------
 %------------------------------------------------------------------------
-%  I - MAIN FUNCTION UVMAT 
+%  I - MAIN FUNCTION uvmat
 %------------------------------------------------------------------------
 %------------------------------------------------------------------------
@@ -343,5 +347,5 @@
 if ~isempty(inputfile)
     %%%%% display the input field %%%%%%%
-    display_file_name(hObject, eventdata, handles,inputfile)
+    display_file_name(handles,inputfile)
     %%%%%%%
     testinputfield=1;
@@ -442,5 +446,5 @@
 
 % display the selected field and related information
-display_file_name(hObject, eventdata, handles,fileinput)
+display_file_name( handles,fileinput)
 
 % -----------------------------------------------------------------------
@@ -449,5 +453,5 @@
 %------------------------------------------------------------------------
 fileinput=get(handles.MenuFile_1,'Label');
-display_file_name(hObject, eventdata, handles,fileinput)
+display_file_name( handles,fileinput)
 
 % -----------------------------------------------------------------------
@@ -456,5 +460,5 @@
 %------------------------------------------------------------------------
 fileinput=get(handles.MenuFile_2,'Label');
-display_file_name(hObject, eventdata, handles,fileinput)
+display_file_name(handles,fileinput)
 
 % -----------------------------------------------------------------------
@@ -463,5 +467,5 @@
 %------------------------------------------------------------------------
 fileinput=get(handles.MenuFile_3,'Label');
-display_file_name(hObject, eventdata, handles,fileinput)
+display_file_name(handles,fileinput)
 
 % -----------------------------------------------------------------------
@@ -470,5 +474,5 @@
 %------------------------------------------------------------------------
 fileinput=get(handles.MenuFile_4,'Label');
-display_file_name(hObject, eventdata, handles,fileinput)
+display_file_name(handles,fileinput)
 
 % -----------------------------------------------------------------------
@@ -477,5 +481,5 @@
 %------------------------------------------------------------------------
 fileinput=get(handles.MenuFile_5,'Label');
-display_file_name(hObject, eventdata, handles,fileinput)
+display_file_name(handles,fileinput)
 
 %------------------------------------------------------------------------
@@ -511,5 +515,5 @@
 % refresh the current displayed field
 set(handles.SubField,'Value',1)
-display_file_name(hObject,eventdata,handles,fileinput_1,2)
+display_file_name(handles,fileinput_1,2)
 
 %update list of recent files in the menubar
@@ -550,5 +554,5 @@
 fileinput_1=get(handles.MenuFile_1_1,'Label');
 set(handles.SubField,'Value',1)
-display_file_name(hObject,eventdata,handles,fileinput_1,2)
+display_file_name(handles,fileinput_1,2)
 
 % -----------------------------------------------------------------------
@@ -558,5 +562,5 @@
 fileinput_1=get(handles.MenuFile_2_1,'Label');
 set(handles.SubField,'Value',1)
-display_file_name(hObject,eventdata,handles,fileinput_1,2)
+display_file_name(handles,fileinput_1,2)
 
 % -----------------------------------------------------------------------
@@ -566,5 +570,5 @@
 fileinput_1=get(handles.MenuFile_3_1,'Label');
 set(handles.SubField,'Value',1)
-display_file_name(hObject,eventdata,handles,fileinput_1,2)
+display_file_name(handles,fileinput_1,2)
 
 % -----------------------------------------------------------------------
@@ -574,5 +578,5 @@
 fileinput_1=get(handles.MenuFile_4_1,'Label');
 set(handles.SubField,'Value',1)
-display_file_name(hObject,eventdata,handles,fileinput_1,2)
+display_file_name(handles,fileinput_1,2)
 
 % -----------------------------------------------------------------------
@@ -582,5 +586,5 @@
 fileinput_1=get(handles.MenuFile_5_1,'Label');
 set(handles.SubField,'Value',1)
-display_file_name(hObject,eventdata,handles,fileinput_1,2)
+display_file_name(handles,fileinput_1,2)
 
 %------------------------------------------------------------------------
@@ -593,5 +597,5 @@
 [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,tild,FileType,MovieObject]=find_file_series(fullfile(RootPath,SubDir),[RootFile FileIndices FileExt]);
 % initiate the input file series and refresh the current field view: 
-update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileType,MovieObject);
+update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileType,MovieObject,1);
 
 %-----------------------------------------------------------------------
@@ -674,5 +678,5 @@
 %------------------------------------------------------------------------ 
 % --- Fills the edit boxes RootPath, RootFile,NomType...from an input file name 'fileinput'
-function display_file_name(hObject, eventdata, handles,fileinput,index)
+function display_file_name(handles,fileinput,index)
 %------------------------------------------------------------------------
 %% look for the input file existence
@@ -687,5 +691,5 @@
 drawnow
 
-%% define the relevant handles for the first fiel series (index=1) or the second file series (index=2)
+%% define the relevant handles for the first field series (index=1) or the second file series (index=2)
 if ~exist('index','var')
     index=1;
@@ -698,5 +702,4 @@
     handles_NomType=handles.NomType;
     handles_FileExt=handles.FileExt;
-%     handles_Fields=handles.Fields;
 elseif index==2
     handles_RootPath=handles.RootPath_1;
@@ -706,5 +709,4 @@
     handles_NomType=handles.NomType_1;
     handles_FileExt=handles.FileExt_1;
-%     handles_Fields=handles.Fields_1;
     set(handles.RootPath_1,'Visible','on')
     set(handles.RootFile_1,'Visible','on')
@@ -782,5 +784,5 @@
             else
                 set(handles.SubField,'Value',0)
-                SubField_Callback(hObject, eventdata, handles)
+                SubField_Callback([], [], handles)
             end
         end
@@ -1132,5 +1134,5 @@
 end
 
-%% update list of recent files in the menubar
+%% update list of recent files in the menubar and save it for future opening
 MenuFile=[{get(handles.MenuFile_1,'Label')};{get(handles.MenuFile_2,'Label')};...
     {get(handles.MenuFile_3,'Label')};{get(handles.MenuFile_4,'Label')};{get(handles.MenuFile_5,'Label')}];
@@ -2961,5 +2963,5 @@
     end
      % display the selected field and related information
-    display_file_name(hObject, eventdata, handles,imagename)%display the image
+    display_file_name(handles,imagename)%display the image
     return
 else
@@ -2973,5 +2975,5 @@
         filename=[PathName FileName];
         % display the selected field and related information
-        display_file_name(hObject, eventdata, handles,filename)
+        display_file_name( handles,filename)
         return
     end
@@ -3068,5 +3070,5 @@
             set(handles.num_Npx,'Visible','on')
             set(handles.num_Npy,'Visible','on')
-            display_file_name(hObject, eventdata, handles,imagename,2)%display the imag
+            display_file_name(handles,imagename,2)%display the imag
         end
     otherwise
@@ -4332,7 +4334,12 @@
     if isfield(UvData.Field,'Mesh')&&~isempty(UvData.Field.Mesh)
         data.RangeX=[UvData.Field.XMin UvData.Field.XMax];
-        data.RangeY=[UvData.Field.YMin UvData.Field.YMax];
+        if strcmp(data.Type,'line')||rcmp(data.Type,'polyline')
+            data.RangeY=UvData.Field.Mesh;
+        else
+            data.RangeY=[UvData.Field.YMin UvData.Field.YMax];
+        end
         data.DX=UvData.Field.Mesh;
         data.DY=UvData.Field.Mesh;
+        
 %     elseif isfield(Field,'AX')&& isfield(Field,'AY')&& isfield(Field,'A')%only image
 %         np=size(Field.A);
