Changeset 604 for trunk/src/series.m


Ignore:
Timestamp:
Apr 4, 2013, 10:54:25 PM (8 years ago)
Author:
sommeria
Message:

bugs corrected in series, ima_levels cleaned as exemple

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series.m

    r603 r604  
    14601460nbfield_j=numel(first_j:incr_j:last_j);
    14611461
    1462 %% record nbre of output files for status
     1462%% record nbre of output files and starting time for computation for status
    14631463StatusData=get(handles.status,'UserData');
    1464 StatusData.NbCore=NbCore;
    1465 StatusData.NbProcess=NbProcess;
    1466 if isfield(StatusData,'OutputFileMode')
    1467 switch StatusData.OutputFileMode
    1468     case 'NbInput'%TODO:finish
    1469 end
    1470 end
     1464    switch StatusData.OutputFileMode
     1465        case 'NbInput'
     1466            StatusData.NbOutputFile=numel(first_i,incr_i:last_i)*numel(first_j,incr_j:last_j);
     1467        case 'NbInput_i'
     1468            StatusData.NbOutputFile=numel(first_i,incr_i:last_i);
     1469        case 'NbSlice'   
     1470            StatusData.NbOutputFile=str2num(get(handles.num_NbSlice,'String'));
     1471    end
     1472StatusData.TimeStart=now;
     1473set(handles.status,'UserData',StatusData)
    14711474
    14721475%% direct processing on the current Matlab session
     
    16171620    case 'background'
    16181621        for iprocess=1:NbProcess
    1619             system(batch_file_list{iprocess})% directly execute the command file for each process
     1622            system([batch_file_list{iprocess} ' &'])% directly execute the command file for each process
    16201623        end
    16211624    case 'cluster_oar' % option 'oar-parexec' used
     
    19351938if isfield(Series.IndexRange,'first_i')
    19361939    first_i=Series.IndexRange.first_i;
     1940    incr_i=Series.IndexRange.incr_i;
    19371941    last_i=Series.IndexRange.last_i;
    19381942end
    19391943if isfield(Series.IndexRange,'first_j')
    19401944    first_j=Series.IndexRange.first_j;
     1945     incr_j=Series.IndexRange.incr_j;
    19411946    last_j=Series.IndexRange.last_j;
    19421947end
     
    20442049%% Expected nbre of output files
    20452050if isfield(ParamOut,'OutputFileMode')
    2046 StatusData.NbOutputFile=ParamOut.OutputFileMode;
     2051StatusData.OutputFileMode=ParamOut.OutputFileMode;
    20472052set(handles.status,'UserData',StatusData)
    20482053end
     
    24432448    set(handles.status,'BackgroundColor',[1 1 0])
    24442449    drawnow
    2445     StatusData.time_ref=get(handles.RUN,'UserData');% get the time of launch
     2450    %StatusData.time_ref=get(handles.RUN,'UserData');% get the time of launch
    24462451    Param=read_GUI(handles.series);
    24472452    RootPath=Param.InputTable{1,1};
     
    24542459    hfig=findobj(allchild(0),'name','series_status');
    24552460    if isempty(hfig)
    2456         hfig=figure('DeleteFcn',@stop_status,'Position',[600 600 560 600]);
     2461        ScreenSize=get(0,'ScreenSize');
     2462        hfig=figure('DeleteFcn',@stop_status,'Position',[ScreenSize(3)-600 ScreenSize(4)-640 560 600]);
    24572463        set(hfig,'MenuBar','none')% suppress the menu bar
    24582464        set(hfig,'NumberTitle','off')%suppress the fig number in the title
     
    24642470        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);
    24652471        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);
    2466         set(hrefresh,'UserData',StatusData)
     2472        %set(hrefresh,'UserData',StatusData)
    24672473        BarPosition=[0.05 0.81 0.01 0.05];
    24682474        uicontrol('Style','frame','Units','normalized', 'Position',BarPosition ,'BackgroundColor',[1 0 0],'tag','waitbar');
     
    24842490% launched by selecting a file on the list
    24852491function view_file(hObject, eventdata)
     2492%------------------------------------------------------------------------
    24862493list=get(hObject,'String');
    24872494index=get(hObject,'Value');
     
    25212528
    25222529
    2523 %------------------------------------------------------------------------
    2524 
    25252530%------------------------------------------------------------------------   
    25262531% launched by refreshing the status figure
     
    25302535htitlebox=findobj(hfig,'tag','titlebox');
    25312536hlist=findobj(hfig,'tag','list');
    2532 StatusData=get(hObject,'UserData');
     2537hseries=findobj(allchild(0),'tag','series');
     2538hstatus=findobj(hseries,'tag','status');
     2539StatusData=get(hstatus,'UserData');
    25332540OutputDir=get(htitlebox,'String');
    25342541if ischar(OutputDir),OutputDir={OutputDir};end
    25352542ListFiles=dir(OutputDir{1});
     2543if numel(ListFiles)<1
     2544    return
     2545end
     2546ListFiles(1)=[];%removes the first line ='.'
    25362547ListDisplay=cell(numel(ListFiles),1);
    25372548testrecent=0;
    2538 datnum=zeros(numel(ListDisplay)-1,1);
    2539 for ilist=2:numel(ListDisplay)
    2540     ListDisplay{ilist-1}=ListFiles(ilist).name;
     2549datnum=zeros(numel(ListDisplay),1);
     2550for ilist=1:numel(ListDisplay)
     2551    ListDisplay{ilist}=ListFiles(ilist).name;
    25412552      if ~ListFiles(ilist).isdir && isfield(ListFiles(ilist),'datenum')
    25422553            datnum(ilist)=ListFiles(ilist).datenum;%only available in recent matlab versions
     
    25472558
    25482559%% Look at date of creation
     2560ListDisplay=ListDisplay(datnum~=0);
    25492561datnum=datnum(datnum~=0);%keep the non zero values corresponding to existing files
    2550 ListDisplay=ListDisplay(datnum~=0);
    25512562if isempty(datnum)
    25522563    if testrecent
     
    25582569    [first,indfirst]=min(datnum);
    25592570    [last,indlast]=max(datnum);
    2560     message={[num2str(numel(datnum)) ' file(s) done over ?'] ;['oldest modification:  ' ListDisplay{indfirst} ' : ' datestr(first)];...
     2571    NbOutputFile_str='?';
     2572    NbOutputFile=[];
     2573    if isfield(StatusData,'NbOutputFile')
     2574        NbOutputFile=StatusData.NbOutputFile;
     2575        NbOutputFile_str=num2str(NbOutputFile);
     2576    end
     2577    message={[num2str(numel(datnum)) ' file(s) done over ' NbOutputFile_str] ;['oldest modification:  ' ListDisplay{indfirst} ' : ' datestr(first)];...
    25612578        ['latest modification:  ' ListDisplay{indlast} ' : ' datestr(last)]};
    25622579end
    2563 titlebox=findobj(hfig,'tag','titlebox');
    2564 msg_old=get(titlebox,'String');
    2565 set(titlebox,'String', [msg_old(1);message])
     2580set(htitlebox,'String', [OutputDir{1};message])
     2581
     2582%% update the waitbar
    25662583hwaitbar=findobj(hfig,'tag','waitbar');
     2584if ~isempty(NbOutputFile)
     2585    BarPosition=get(hwaitbar,'Position');
     2586    BarPosition(3)=0.9*numel(datnum)/NbOutputFile;
     2587    set(hwaitbar,'Position',BarPosition)
     2588end
    25672589%TODO: adjust waitbar
    25682590
     
    26412663% set(hlist,'String',Tabchar)
    26422664% set(htitlebox,'String', message)
    2643 % if count>0 %&& ~test_new
    2644 %     BarPosition(3)=0.9*count/nbfiles;
    2645 %     set(hwaitbar,'Position',BarPosition)
    2646 % end
     2665%
    26472666%------------------------------------------------------------------------   
    26482667% launched by deleting the status figure
     
    26722691        end
    26732692    end
    2674     currentdir=pwd;
    2675     cd(get(handles.ActionPath,'String'))
    2676     sh_file=dir([ActionName '.sh']);
    2677     m_file=dir([ActionName '.m']);
    2678     if isfield(m_file,'datenum') && m_file.datenum>sh_file.datenum
     2693    sh_file_info=dir(fullfile(get(handles.ActionPath,'String'),[ActionName '.sh']));
     2694    m_file_info=dir(fullfile(get(handles.ActionPath,'String'),[ActionName '.m']));
     2695    if isfield(m_file_info,'datenum') && m_file_info.datenum>sh_file_info.datenum
    26792696        set(handles.ActionExt,'BackgroundColor',[1 1 0])
    26802697        drawnow
    26812698        answer=msgbox_uvmat('INPUT_Y-N',[ActionName '.sh needs to be updated: recompile now?']);
    26822699        if strcmp(answer,'Yes')
     2700            currentdir=pwd;
     2701            cd(get(handles.ActionPath,'String'))
    26832702            compile(ActionName)
     2703            cd(currentdir)
    26842704        end
    26852705        set(handles.ActionExt,'BackgroundColor',[1 1 1])
    26862706    end
    2687     cd(currentdir)
    26882707end
    26892708
Note: See TracChangeset for help on using the changeset viewer.