Index: trunk/src/series.m
===================================================================
--- trunk/src/series.m	(revision 932)
+++ trunk/src/series.m	(revision 934)
@@ -469,5 +469,5 @@
 RootPathCell=InputTable(:,1);
 SubDirCell=InputTable(:,2);
-oldfile=fullfile(RootPathCell{1},SubDirCell{1});
+oldfile=fullfile(InputTable{1,1},InputTable{1,2});
 if isempty(oldfile)
     % use a file name stored in prefdir
@@ -481,18 +481,65 @@
     end
 end
-%% launch the browser
-fileinput=uigetfile_uvmat('pick an input file in the series',oldfile);
-hh=dir(fileinput);
-if numel(hh)>1
-    msgbox_uvmat('ERROR','invalid input, probably a broken link');
-else
-    if ~isempty(fileinput)
-        display_file_name(handles,fileinput,'one')
-    end
-end
-append='one';
-set(handles.MenuOpenCampaign,'ForegroundColor',[1 1 0])
-drawnow
-browse_campaign(handles,append);
+
+OutPut=browse_data(oldfile,'on','on');% open the GUI browse_data to get select a campaign dir, experiment and device
+NbLines=numel(OutPut.Experiment)*numel(OutPut.DataSeries);
+icount=0;
+for iexp=1:numel(OutPut.Experiment)
+    for idevice=1:numel(OutPut.DataSeries)
+        icount=icount+1;
+        InputTable{icount,1}=fullfile(OutPut.Campaign,OutPut.Experiment{iexp});
+        InputTable{icount,2}=OutPut.DataSeries{idevice};
+        if isempty(InputTable{icount,3})
+            if icount>1
+            InputTable{icount,3}=InputTable{icount-1,3};
+            else
+                InputTable{icount,3}='';
+            end
+        end
+        if isempty(InputTable{icount,4})
+            if icount>1
+            InputTable{icount,4}=InputTable{icount-1,4};
+            else
+                InputTable{icount,4}='';
+            end
+        end
+                if isempty(InputTable{icount,5})
+            if icount>1
+            InputTable{icount,5}=InputTable{icount-1,5};
+            else
+                InputTable{icount,5}='';
+            end
+        end
+    end
+end
+if size(InputTable,1)>icount
+    InputTable(icount+1:size(InputTable,1),:)=[];
+end
+set(handles.InputTable,'Data',InputTable)
+REFRESH_Callback(hObject, eventdata, handles)
+% DataSeries=fullfile(OutPut.Campaign,OutPut.Experiment{1},OutPut.DataSeries{1});
+% fileinput=uigetfile_uvmat('pick an input file',DataSeries);
+% hh=dir(fileinput);
+% if numel(hh)>1
+%     msgbox_uvmat('ERROR','invalid input, probably a broken link');
+%     return
+% end
+% 
+% 
+% 
+% %% launch the browser
+% fileinput=uigetfile_uvmat('pick an input file in the series',oldfile);
+% hh=dir(fileinput);
+% if numel(hh)>1
+%     msgbox_uvmat('ERROR','invalid input, probably a broken link');
+% else
+%     if ~isempty(fileinput)
+%         display_file_name(handles,fileinput,'one')
+%     end
+% end
+% append='one';
+% set(handles.MenuOpenCampaign,'ForegroundColor',[1 1 0])
+% drawnow
+% browse_campaign(handles,append);
 
 %------------------------------------------------------------------------
@@ -1486,5 +1533,4 @@
 errormsg='';%default error message
 xmlfile=fullfile(path_series,'PARAM.xml');
-%test_batch=0;%default: ,no batch mode available
 if ~exist(xmlfile,'file')
     [success,message]=copyfile(fullfile(path_series,'PARAM.xml.default'),xmlfile);
@@ -1505,5 +1551,6 @@
 end
 ActionFullName=fullfile(get(handles.ActionPath,'String'),ActionName);
-%% If a compiled version has been selected (ext .sh) check weather it needs to be recompiled
+
+%% If a compiled version has been selected (ext .sh) check wether it needs to be recompiled
 if strcmp(ActionExt,'.sh')
     TransformPath='';
@@ -1515,9 +1562,8 @@
     [mcrmajor, mcrminor] = mcrversion;   
     MCRROOT = ['MCRROOT',int2str(mcrmajor),int2str(mcrminor)];
-    %hver=ver('MATLAB');
-    %MCRROOT=['MCRROOT' regexprep(hver.Version,'\.','')];%suppress the dot in version number
     RunTime = getenv(MCRROOT);
     ActionNameVersion=[ActionName '_' MCRROOT];
     ActionFullName=fullfile(get(handles.ActionPath,'String'),[ActionNameVersion '.sh']);
+    % compile the .m file if the .sh file does not exist yet
     if ~exist(ActionFullName,'file')
         answer=msgbox_uvmat('INPUT_Y-N','compiled version has not been created: compile now?');
@@ -1552,4 +1598,5 @@
         end
     end
+
     set(handles.ActionExt,'BackgroundColor',[1 1 1])
      set(handles.series,'Pointer','arrow') % set the mouse pointer to 'watch
@@ -1774,15 +1821,10 @@
     if isempty(Param.IndexRange.NbSlice)
         Param.IndexRange.first_i=first_i+(iprocess-1)*BlockLength*incr_i;
-        %         Param.IndexRange.first_i=ref_i(1+(iprocess-1)*BlockLength);
         if Param.IndexRange.first_i>last_i
             NbProcess=iprocess-1;% leave the loop, we are at the end of the calculation
             break
         end
-        %Param.IndexRange.last_i=min(ref_i(iprocess*BlockLength),last_i);
-        %Param.IndexRange.last_i=min(first_i+(iprocess)*BlockLength*incr_i-1,last_i);
         Param.IndexRange.last_i=min(last_i,first_i+(iprocess)*BlockLength*incr_i-1);
     else %multislices (then incr_i is not empty)
-        %         Param.IndexRange.first_i= first_i+incr_i*(iprocess-1);
-        %         Param.IndexRange.incr_i=incr_i*Param.IndexRange.NbSlice;
         Param.IndexRange.first_i= first_i+iprocess-1;
         Param.IndexRange.incr_i=incr_i*Param.IndexRange.NbSlice;
@@ -1791,17 +1833,4 @@
         Param.InputTable{ilist,1}=regexprep(Param.InputTable{ilist,1},'\','/');%correct path name for PCWIN system
     end
-    
-    %         if isempty(Param.IndexRange.NbSlice)% process by blocks of i index
-    %             Param.IndexRange.first_i=first_i+(iprocess-1)*BlockLength*incr_i;
-    %             if Param.IndexRange.first_i>last_i
-    %                 NbProcess=iprocess-1;
-    %                 break% leave the loop, we are at the end of the calculation
-    %             end
-    %             Param.IndexRange.last_i=min(last_i,first_i+(iprocess)*BlockLength*incr_i-1);
-    %         else% process by slices of i index if NbSlice is defined, computation in a single process if NbSlice =1
-    %             Param.IndexRange.first_i= first_i+iprocess-1;
-    %             Param.IndexRange.incr_i=incr_i*Param.IndexRange.NbSlice;
-    %         end
-    
     
     if isfield(Param,'OutputSubDir')
@@ -1819,8 +1848,4 @@
             end
         end
-        %         [success,msg] = fileattrib(filexml{iprocess},'+w','g');% allow writing access for the group of users, recursively in the folder
-        %     if success==0
-        %         msgbox_uvmat('WARNING',{['unable to set group write access to ' filexml{iprocess} ':']; msg});%error message for directory creation
-        %     end
     end
     if strcmp (RunMode,'local')
@@ -1840,8 +1865,5 @@
     end
 end
-% [success,msg] = fileattrib(DirXml,'+w','g','s');% allow writing access for the group of users, recursively in the folder
-%     if success==0
-%         msgbox_uvmat('WARNING',{['unable to set group write access to ' DirXml ':']; msg});%error message for directory creation
-%     end
+
 if ~strcmp (RunMode,'local') && ~strcmp(RunMode,'python')
     %% processing on a different session of the same computer (background) or cluster, create executable files
@@ -1879,14 +1901,5 @@
         first_i,last_i,first_j,last_j);
     filelog_global=fullfile(OutputDir,'0_LOG',filelog_global);
-    
-    %     [success,msg] = fileattrib(DirLog,'+w','g','s');% allow writing access for the group of users, recursively in the folder
-    %     if success==0
-    %         msgbox_uvmat('WARNING',{['unable to set group write access to ' DirLog ':']; msg});%error message for directory creation
-    %     end
-    %     [success,msg] = fileattrib(fullfile(OutputDir,'0_EXE'),'+w','g','s');% allow writing access for the group of users, recursively in the folder
-    %     if success==0
-    %         msgbox_uvmat('WARNING',{['unable to set group write access to ' fullfile(OutputDir,'0_EXE') ':']; msg});%error message for directory creation
-    %     end
-    %
+
     for iprocess=1:NbProcess
         
@@ -1894,9 +1907,4 @@
         
         batch_file_list{iprocess}=fullfile(OutputDir,'0_EXE',regexprep(extxml{iprocess},'.xml$',ExeExt));
-        %         [fid,message]=fopen(batch_file_list{iprocess},'w');% create the executable file
-        %         if isequal(fid,-1)
-        %             errormsg=['creation of ' batch_file_list{iprocess} ':' message];
-        %             return
-        %         end
         
         % set the log file name
@@ -1958,5 +1966,5 @@
                                 'hostname && date \n '...
                                 'umask 002 \n'...
-                                ActionFullName ' ' RunTime ' ' filexml];%allow writting access to created files for user group
+                                ActionFullName ' ' RunTime ' ' filexml{iprocess}];%allow writting access to created files for user group
                             fprintf(fid,cmd);%fill the executable file with the  char string cmd
                             fclose(fid);% close the executable file
@@ -1979,8 +1987,4 @@
                 return
             end
-            %             [success,msg] = fileattrib(batch_file_list{iprocess},'+w','g');% allow writing access for the group of users, recursively in the folder
-            %     if success==0
-            %         msgbox_uvmat('WARNING',{['unable to set group write access to ' batch_file_list{iprocess} ':']; msg});%error message for directory creation
-            %     end
             if  strcmp(ActionExt,'.sh')
                 cmd=['#!/bin/bash \n '...
@@ -2020,5 +2024,4 @@
         filename_joblist=fullfile(DirOAR,'job_list.txt');% name of the file containing the list of executables
         fid=fopen(filename_joblist,'w');%open it for writting
-        %         [success,msg] = fileattrib(filename_joblist,'+w','g');% allow writing access for the group of users,
         for iprocess=1:length(batch_file_list)
             fprintf(fid,[batch_file_list{iprocess} '\n']);% write list of exe files
@@ -2053,6 +2056,4 @@
             '-l ' filename_joblist '.log"'];
         
-        
-        
         fprintf(oar_command);% display  system command on the Matlab command window
         [status,result]=system(oar_command)% execute system command and show the result (ID number of the launched job) on the Matlab command window
@@ -2063,8 +2064,4 @@
         fclose(fid);
         msgbox_uvmat('CONFIRMATION',[ActionFullName ' launched as  ' num2str(NbProcess) ' processes in cluster: press STATUS to see results'])
-        %         [success,msg] = fileattrib(DirOAR,'+w','g','s');% allow writing access for the group of users, recursively in the folder
-        %     if success==0
-        %         msgbox_uvmat('WARNING',{['unable to set group write access to ' DirOAR ':']; msg});%error message for directory creation
-        %     end
         
     case 'cluster_pbs' % for LMFA Kepler machine
@@ -2121,4 +2118,5 @@
     end
 end
+
 %------------------------------------------------------------------------
 function STOP_Callback(hObject, eventdata, handles)
@@ -2128,5 +2126,4 @@
 set(handles.RUN,'enable','on')
 set(handles.RUN, 'Value',0)
-
 
 %------------------------------------------------------------------------
