Index: trunk/src/series.m
===================================================================
--- trunk/src/series.m	(revision 603)
+++ trunk/src/series.m	(revision 604)
@@ -1460,13 +1460,16 @@
 nbfield_j=numel(first_j:incr_j:last_j);
 
-%% record nbre of output files for status
+%% record nbre of output files and starting time for computation for status
 StatusData=get(handles.status,'UserData');
-StatusData.NbCore=NbCore;
-StatusData.NbProcess=NbProcess;
-if isfield(StatusData,'OutputFileMode')
-switch StatusData.OutputFileMode
-    case 'NbInput'%TODO:finish
-end
-end
+    switch StatusData.OutputFileMode
+        case 'NbInput'
+            StatusData.NbOutputFile=numel(first_i,incr_i:last_i)*numel(first_j,incr_j:last_j);
+        case 'NbInput_i'
+            StatusData.NbOutputFile=numel(first_i,incr_i:last_i);
+        case 'NbSlice'    
+            StatusData.NbOutputFile=str2num(get(handles.num_NbSlice,'String'));
+    end
+StatusData.TimeStart=now;
+set(handles.status,'UserData',StatusData)
 
 %% direct processing on the current Matlab session
@@ -1617,5 +1620,5 @@
     case 'background'
         for iprocess=1:NbProcess
-            system(batch_file_list{iprocess})% directly execute the command file for each process
+            system([batch_file_list{iprocess} ' &'])% directly execute the command file for each process
         end
     case 'cluster_oar' % option 'oar-parexec' used
@@ -1935,8 +1938,10 @@
 if isfield(Series.IndexRange,'first_i')
     first_i=Series.IndexRange.first_i;
+    incr_i=Series.IndexRange.incr_i;
     last_i=Series.IndexRange.last_i;
 end
 if isfield(Series.IndexRange,'first_j')
     first_j=Series.IndexRange.first_j;
+     incr_j=Series.IndexRange.incr_j;
     last_j=Series.IndexRange.last_j;
 end
@@ -2044,5 +2049,5 @@
 %% Expected nbre of output files
 if isfield(ParamOut,'OutputFileMode')
-StatusData.NbOutputFile=ParamOut.OutputFileMode;
+StatusData.OutputFileMode=ParamOut.OutputFileMode;
 set(handles.status,'UserData',StatusData)
 end
@@ -2443,5 +2448,5 @@
     set(handles.status,'BackgroundColor',[1 1 0])
     drawnow
-    StatusData.time_ref=get(handles.RUN,'UserData');% get the time of launch
+    %StatusData.time_ref=get(handles.RUN,'UserData');% get the time of launch
     Param=read_GUI(handles.series);
     RootPath=Param.InputTable{1,1};
@@ -2454,5 +2459,6 @@
     hfig=findobj(allchild(0),'name','series_status');
     if isempty(hfig)
-        hfig=figure('DeleteFcn',@stop_status,'Position',[600 600 560 600]);
+        ScreenSize=get(0,'ScreenSize');
+        hfig=figure('DeleteFcn',@stop_status,'Position',[ScreenSize(3)-600 ScreenSize(4)-640 560 600]);
         set(hfig,'MenuBar','none')% suppress the menu bar
         set(hfig,'NumberTitle','off')%suppress the fig number in the title
@@ -2464,5 +2470,5 @@
         uicontrol('Style','pushbutton','Units','normalized', 'Position', [0.7 0.01 0.2 0.07],'String','Close','FontWeight','bold','FontUnits','points','FontSize',11,'Callback',@stop_status);
         hrefresh=uicontrol('Style','pushbutton','Units','normalized', 'Position', [0.1 0.01 0.2 0.07],'String','Refresh','FontWeight','bold','FontUnits','points','FontSize',11,'Callback',@refresh_GUI);
-        set(hrefresh,'UserData',StatusData)
+        %set(hrefresh,'UserData',StatusData)
         BarPosition=[0.05 0.81 0.01 0.05];
         uicontrol('Style','frame','Units','normalized', 'Position',BarPosition ,'BackgroundColor',[1 0 0],'tag','waitbar');
@@ -2484,4 +2490,5 @@
 % launched by selecting a file on the list
 function view_file(hObject, eventdata)
+%------------------------------------------------------------------------
 list=get(hObject,'String');
 index=get(hObject,'Value');
@@ -2521,6 +2528,4 @@
 
 
-%------------------------------------------------------------------------
-
 %------------------------------------------------------------------------   
 % launched by refreshing the status figure
@@ -2530,13 +2535,19 @@
 htitlebox=findobj(hfig,'tag','titlebox');
 hlist=findobj(hfig,'tag','list');
-StatusData=get(hObject,'UserData');
+hseries=findobj(allchild(0),'tag','series');
+hstatus=findobj(hseries,'tag','status');
+StatusData=get(hstatus,'UserData');
 OutputDir=get(htitlebox,'String');
 if ischar(OutputDir),OutputDir={OutputDir};end
 ListFiles=dir(OutputDir{1});
+if numel(ListFiles)<1
+    return
+end
+ListFiles(1)=[];%removes the first line ='.'
 ListDisplay=cell(numel(ListFiles),1);
 testrecent=0;
-datnum=zeros(numel(ListDisplay)-1,1);
-for ilist=2:numel(ListDisplay)
-    ListDisplay{ilist-1}=ListFiles(ilist).name;
+datnum=zeros(numel(ListDisplay),1);
+for ilist=1:numel(ListDisplay)
+    ListDisplay{ilist}=ListFiles(ilist).name;
       if ~ListFiles(ilist).isdir && isfield(ListFiles(ilist),'datenum')
             datnum(ilist)=ListFiles(ilist).datenum;%only available in recent matlab versions
@@ -2547,6 +2558,6 @@
 
 %% Look at date of creation
+ListDisplay=ListDisplay(datnum~=0);
 datnum=datnum(datnum~=0);%keep the non zero values corresponding to existing files
-ListDisplay=ListDisplay(datnum~=0);
 if isempty(datnum)
     if testrecent
@@ -2558,11 +2569,22 @@
     [first,indfirst]=min(datnum);
     [last,indlast]=max(datnum);
-    message={[num2str(numel(datnum)) ' file(s) done over ?'] ;['oldest modification:  ' ListDisplay{indfirst} ' : ' datestr(first)];...
+    NbOutputFile_str='?';
+    NbOutputFile=[];
+    if isfield(StatusData,'NbOutputFile')
+        NbOutputFile=StatusData.NbOutputFile;
+        NbOutputFile_str=num2str(NbOutputFile);
+    end
+    message={[num2str(numel(datnum)) ' file(s) done over ' NbOutputFile_str] ;['oldest modification:  ' ListDisplay{indfirst} ' : ' datestr(first)];...
         ['latest modification:  ' ListDisplay{indlast} ' : ' datestr(last)]};
 end
-titlebox=findobj(hfig,'tag','titlebox');
-msg_old=get(titlebox,'String');
-set(titlebox,'String', [msg_old(1);message])
+set(htitlebox,'String', [OutputDir{1};message])
+
+%% update the waitbar
 hwaitbar=findobj(hfig,'tag','waitbar');
+if ~isempty(NbOutputFile) 
+    BarPosition=get(hwaitbar,'Position');
+    BarPosition(3)=0.9*numel(datnum)/NbOutputFile;
+    set(hwaitbar,'Position',BarPosition)
+end
 %TODO: adjust waitbar
 
@@ -2641,8 +2663,5 @@
 % set(hlist,'String',Tabchar)
 % set(htitlebox,'String', message)
-% if count>0 %&& ~test_new
-%     BarPosition(3)=0.9*count/nbfiles;
-%     set(hwaitbar,'Position',BarPosition)
-% end
+% 
 %------------------------------------------------------------------------   
 % launched by deleting the status figure
@@ -2672,18 +2691,18 @@
         end
     end
-    currentdir=pwd;
-    cd(get(handles.ActionPath,'String'))
-    sh_file=dir([ActionName '.sh']);
-    m_file=dir([ActionName '.m']);
-    if isfield(m_file,'datenum') && m_file.datenum>sh_file.datenum
+    sh_file_info=dir(fullfile(get(handles.ActionPath,'String'),[ActionName '.sh']));
+    m_file_info=dir(fullfile(get(handles.ActionPath,'String'),[ActionName '.m']));
+    if isfield(m_file_info,'datenum') && m_file_info.datenum>sh_file_info.datenum
         set(handles.ActionExt,'BackgroundColor',[1 1 0])
         drawnow
         answer=msgbox_uvmat('INPUT_Y-N',[ActionName '.sh needs to be updated: recompile now?']);
         if strcmp(answer,'Yes')
+            currentdir=pwd;
+            cd(get(handles.ActionPath,'String'))
             compile(ActionName)
+            cd(currentdir)
         end
         set(handles.ActionExt,'BackgroundColor',[1 1 1])
     end
-    cd(currentdir)
 end
 
