Changeset 994 for trunk


Ignore:
Timestamp:
Feb 6, 2017, 11:31:27 AM (7 years ago)
Author:
sommeria
Message:

series updated

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series.m

    r992 r994  
    132132end
    133133
    134 %% list of builtin functions in the mebu ActionName
     134%% Read the parameter file series.xml, or created from series.xml.default if it does not exist
     135[path_series,name,ext]=fileparts(which('series'));% path to the GUI series
     136xmlfile=fullfile(path_series,'series.xml');
     137if ~exist(xmlfile,'file')
     138    [success,message]=copyfile(fullfile(path_series,'series.xml.default'),xmlfile);
     139end
     140if exist(xmlfile,'file')
     141    SeriesData.SeriesParam=xml2struct(xmlfile);
     142%     if ismember(RunMode,{'cluster_oar','cluster_pbs','cluster_sge'}) && isfield(s,'BatchParam')
     143%         if isfield(s.BatchParam,'NbCoreDefault')
     144%             NbCoreDefault=s.BatchParam.NbCoreDefault;
     145%         end
     146%     elseif ismember(RunMode,{'background','local'}) && isfield(s,'RunParam')
     147%         if isfield(s.RunParam,'NbCore')
     148%             NbCoreDefault=s.RunParam.NbCoreDefault;
     149%         end
     150%     end
     151end
     152
     153%% list of builtin functions in the menu ActionName
    135154ActionList={'check_data_files';'aver_stat';'time_series';'civ_series';'merge_proj'}; % WARNING: fits with nb_builtin_ACTION=4 in ActionName_callback
    136155NbBuiltinAction=numel(ActionList);
    137156set(handles.Action,'UserData',NbBuiltinAction)
     157path_series_fct=fullfile(path_series,'series');%path of the functions in subdirectroy 'series'
    138158[path_series,name,ext]=fileparts(which('series')); % path to the GUI series
    139159path_series_fct=fullfile(path_series,'series'); % path of the functions in subdirectroy 'series'
     
    14911511end
    14921512
    1493 %% Get  PARAM.xml (not used at this stage)
     1513%% Get  parameters from series.xml
    14941514errormsg=''; % default error message
    1495 xmlfile=fullfile(path_series,'PARAM.xml');
    1496 if ~exist(xmlfile,'file')
    1497     [success,message]=copyfile(fullfile(path_series,'PARAM.xml.default'),xmlfile);
    1498 end
    1499 if strcmp(ActionExt,'.sh')
    1500     if exist(xmlfile,'file')
    1501         s=xml2struct(xmlfile);
    1502         if (strcmp(RunMode,'cluster_oar') || strcmp(RunMode, 'cluster_pbs') || strcmp(RunMode, 'cluster_sge')) && isfield(s,'BatchParam')
    1503             if isfield(s.BatchParam,'NbCore')
    1504                 NbCore=s.BatchParam.NbCore;
    1505             end
    1506         elseif (strcmp(RunMode,'background')||strcmp(RunMode,'local')) && isfield(s,'RunParam')
    1507             if isfield(s.RunParam,'NbCore')
    1508                 NbCore=s.RunParam.NbCore;
    1509             end
    1510         end
    1511     end
    1512 end
    15131515ActionFullName=fullfile(get(handles.ActionPath,'String'),ActionName);
    15141516
     
    15711573        NbCore=1; % no need to split the calculation
    15721574    case 'cluster_oar'
     1575        NbCoreDefault=SeriesData.SeriesParam.ClusterParam{1}.NbCoreDefault;%proposed number of cores (for cluster)
    15731576        %%%%% TEST A REMETTRE%%%%%
    15741577 %       if strcmp(ActionExt,'.m')% case of Matlab function (uncompiled)
     
    15811584%             extra_oar='';
    15821585 %       else
    1583             answer=inputdlg({'Number of cores (max 36)','extra oar options'},'oarsub parameter',1,{'16',''});
     1586            answer=inputdlg({'Number of cores (max 36)','extra oar options'},'oarsub parameter',1,{num2str(NbCoreDefault),''});
    15841587            if isempty(answer)
    15851588                                errormsg='Action launch interrupted by user';
     
    25162519%% enable or desable j index visibility
    25172520status_j='on'; % default
    2518 if isfield(ParamOut,'Desable_j_index')&&isequal(ParamOut.Desable_j_index,'on')
    2519     status_j='off';
    2520 end
    25212521if isempty(find(~cellfun(@isempty,SeriesData.j1_series), 1)); % case of empty j indices
    25222522    status_j='off'; % no j index needed
     
    25282528end
    25292529enable_j(handles,status_j) % no j index needed
    2530 
     2530if isfield(ParamOut,'j_index_1')&& isfield(ParamOut,'j_index_2')%strcmp(ParamOut.Desable_j_index,'on')
     2531    %status_j='off';
     2532    set(handles.num_first_j,'String',num2str(ParamOut.j_index_1))
     2533    set(handles.num_last_j,'String',num2str(ParamOut.j_index_2))
     2534    set(handles.num_first_j,'enable','off')
     2535    set(handles.num_last_j,'enable','off')
     2536    set(handles.num_incr_j,'visible','off')
     2537else
     2538    set(handles.num_first_j,'enable','on')
     2539    set(handles.num_last_j,'enable','on')
     2540    set(handles.num_incr_j,'visible',status_j)
     2541end
    25312542
    25322543%% NbSlice visibility
     
    32153226    transform_handle=str2func(TransformName);
    32163227    cd(current_dir)
     3228    Field.Action.RUN=0;% indicate that the transform fct is called only to get input param
     3229    SeriesData=get(handles.series,'UserData');
     3230    ParamIn=[];
     3231    if isfield(SeriesData,'TransformInput')
     3232        ParamIn.TransformInput=SeriesData.TransformInput;
     3233    end
     3234    DataOut=feval(transform_handle,Field,ParamIn);% execute the transform fct to get the required conditions
    32173235    Field.Action.RUN=0; % indicate that the transform fct is called only to get input param
    32183236    DataOut=feval(transform_handle,Field,[]); % execute the transform fct to get the required conditions
    32193237    if isfield(DataOut,'TransformInput')%  used to add transform parameters at selection of the transform fct
    3220         SeriesData=get(handles.series,'UserData');
    32213238        SeriesData.TransformInput=DataOut.TransformInput;
    32223239        set(handles.series,'UserData',SeriesData)
     
    37443761function CheckOverwrite_Callback(hObject, eventdata, handles)
    37453762
    3746 
    3747 
    37483763% --- Executes on button press in TestCPUTime.
    37493764function TestCPUTime_Callback(hObject, eventdata, handles)
     
    37533768
    37543769
    3755 
    3756 
    3757 
     3770% --- Executes on button press in DiskQuota.
     3771function DiskQuota_Callback(hObject, eventdata, handles)
     3772system('quota -s -g -A')
Note: See TracChangeset for help on using the changeset viewer.