Changeset 1154 for trunk/src/series.m


Ignore:
Timestamp:
Jul 7, 2024, 11:22:00 PM (3 months ago)
Author:
sommeria
Message:

various improvements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series.m

    r1152 r1154  
    572572        PairString=get(handles.PairString,'Data');
    573573        if numel(PairString)>=iview
    574             checkpair=strfind(PairString{iview},'j=');
    575             if checkpair
    576                 j1=str2double(PairString{iview}(4));
    577                 j2=str2double(PairString{iview}(6));
    578             end
     574                r=regexp(PairString{iview},'(?<num1>\d+)-(?<num2>\d+)' ,'names');
     575                if ~isempty(r)
     576                j1=str2double(r.num1);
     577                j2=str2double(r.num2);
     578                end
    579579        end
    580580        InputFile=fullfile_uvmat('','',InputTable{iview,3},InputTable{iview,5},InputTable{iview,4},i1,[],j1,j2);
     
    14001400    errormsg='input field name(s) not defined, select add_field...';
    14011401    return
     1402end
     1403[status,result]=system(['svn info ' Param.Action.ActionPath]);
     1404if status==0
     1405    t=regexp(result,'R.vision\s*:\s*(?<rev>\d+)','names');%detect 'revision' or 'Revision' in the text
     1406    if ~isempty(t)
     1407        Param.UvmatRevision=t.rev; %version nbre of the current package
     1408    end
    14021409end
    14031410
     
    23052312        return
    23062313    end
    2307     [tild,ActionName,ActionExt]=fileparts(FileName);
     2314    [~,ActionName,ActionExt]=fileparts(FileName);
    23082315
    23092316    % insert the choice in the menu ActionName
     
    23972404%% Activate the Action fct to adapt the configuration of the GUI series and bring specific parameters in SeriesData
    23982405Param=read_GUI_series(handles); % read the parameters from the GUI series
    2399 Param.Action.RUN=0;
    2400 Param.SeriesData=SeriesData;
     2406Param.Action.RUN=0;% indicate that we are in the mode of parameter input, not program run
     2407Param.SeriesData=SeriesData;% info stored in 'UserData' of the fig 'series'
    24012408ParamOut=h_fun(Param); % run the selected Action function to get the relevant input
    24022409
     
    24652472        ind_var=get(handles.FieldName,'Value'); % indices of previously selected variables
    24662473        for ilist=1:numel(ind_var)
    2467             if isempty(find(strcmp(FieldList{ind_var(ilist)},ListVarName)))
     2474            if isempty(find(strcmp(FieldList{ind_var(ilist)},ListVarName), 1))
    24682475                FieldList={}; % previous choice not consistent with new input field
    24692476                set(handles.FieldName,'Value',1)
     
    24712478            end
    24722479        end
    2473         if ~isempty(FieldList)iview_netcdf
    2474             if isempty(find(strcmp(get(handles.Coord_x,'String'),ListVarName)))||...
    2475                     isempty(find(strcmp(get(handles.Coord_y,'String'),ListVarName)))
     2480        if ~isempty(FieldList)
     2481            if isempty(find(strcmp(get(handles.Coord_x,'String'),ListVarName), 1))||...
     2482                    isempty(find(strcmp(get(handles.Coord_y,'String'),ListVarName), 1))
    24762483                FieldList={};
    24772484                set(handles.Coord_x,'String','')
     
    24792486            end
    24802487            Coord_z=get(handles.Coord_z,'String');
    2481             if ~isempty(Coord_z) && isempty(find(strcmp(Coord_z,ListVarName)))REFRESH
     2488            if ~isempty(Coord_z) && isempty(find(strcmp(Coord_z,ListVarName), 1))
    24822489                FieldList={};
    24832490                set(handles.Coord_z,'String','')
     
    24892496    end
    24902497    set(handles_coord,'Visible','on')
    2491     if isempty(find(strcmp('add_field...',FieldList)))
     2498    if isempty(find(strcmp('add_field...',FieldList), 1))
    24922499        FieldList=[FieldList;{'add_field...'}];%add 'add_field...' to the menu FieldName if it is not already
    24932500    end
     
    24962503        set(handles.Field_text_1,'Visible','on')
    24972504        if CheckPivData_1==0        % not civ input made
    2498             FieldList_1={'add_field...'}
     2505            FieldList_1={'add_field...'};
    24992506            ListVarName=SeriesData.FileInfo{iview_netcdf(2)}.ListVarName;
    25002507            ind_var=get(handles.FieldName,'Value'); % indices of previously selected variables
    25012508            for ilist=1:numel(ind_var)
    2502                 if isempty(find(strcmp(FieldList{ind_var(ilist)},ListVarName)))
     2509                if isempty(find(strcmp(FieldList{ind_var(ilist)},ListVarName), 1))
    25032510                    %FieldList_1={}; % previous choice not consistent with new input field
    25042511                    set(handles.FieldName_1,'Value',1)
     
    25072514            end
    25082515            warn_coord=0;
    2509             if isempty(find(strcmp(get(handles.Coord_x,'String'),ListVarName)))||...
    2510                     isempty(find(strcmp(get(handles.Coord_y,'String'),ListVarName)))
     2516            if isempty(find(strcmp(get(handles.Coord_x,'String'),ListVarName), 1))||...
     2517                    isempty(find(strcmp(get(handles.Coord_y,'String'),ListVarName), 1))
    25112518                warn_coord=1;
    25122519            end
    2513             if ~isempty(Coord_z) && isempty(find(strcmp(Coord_z,ListVarName)))
     2520            if ~isempty(Coord_z) && isempty(find(strcmp(Coord_z,ListVarName), 1))
    25142521                FieldList_1={'add_field...'};
    25152522                warn_coord=1;
     
    25472554%% Check whether alphabetical sorting of input Subdir is allowed by the Action fct  (for multiples series entries)
    25482555if isfield(ParamOut,'AllowInputSort')&&isequal(ParamOut.AllowInputSort,'on')&& size(Param.InputTable,1)>1
    2549     [tild,iview]=sort(Param.InputTable(:,2)); % subdirectories sorted in alphabetical order
     2556    [~,iview]=sort(Param.InputTable(:,2)); % subdirectories sorted in alphabetical order
    25502557    set(handles.InputTable,'Data',Param.InputTable(iview,:));
    25512558    MinIndex_i=get(handles.MinIndex_i,'Data');
     
    26322639
    26332640%% NbSlice visibility
    2634 % if isfield(ParamOut,'OutputFileMode')&& strcmp(ParamOut.OutputFileMode,'NbSlice')
    2635 %     ParamOut.NbSlice='on';
    2636 % end
    26372641if isfield(ParamOut,'NbSlice') && (strcmp(ParamOut.NbSlice,'on')||isnumeric(ParamOut.NbSlice))
    26382642    set(handles.num_NbSlice,'Visible','on')
     
    26902694end
    26912695set(handles.CheckMask,'Visible',MaskVisible);
     2696set(handles.MaskTable,'Visible',MaskVisible);
     2697
    26922698%% Setting of expected iteration time
    26932699if isfield(ParamOut,'CPUTime')
     
    26982704InputTable=get(handles.InputTable,'Data');
    26992705[OutputPath,Device,DeviceExt]=fileparts(InputTable{1,1});
    2700 [OutputPath,Experiment,ExperimentExt]=fileparts(OutputPath);
     2706[~,Experiment,ExperimentExt]=fileparts(OutputPath);
    27012707set(handles.Device,'String',[Device DeviceExt])
    27022708set(handles.Device,'Visible','on')
     
    27102716
    27112717%% definition of the subdirectory containing the output files
    2712 
    27132718if  ~(isfield(SeriesData,'ActionName') && strcmp(ActionName,SeriesData.ActionName))
    27142719    OutputDirExt='.series'; % default
     
    27522757set(handles.OutputDirExt,'Visible',OutputDirVisible)
    27532758set(handles.OutputSubDir,'Visible',OutputDirVisible)
    2754 % set(handles.OutputDir_title,'Visible',OutputDirVisible)
    27552759SeriesData.ActionName=ActionName; % record ActionName for next use
    27562760
     
    27762780%% definition of an additional parameter set, determined by an ancillary GUI
    27772781if isfield(ParamOut,'ActionInput')
    2778 %     set(handles.ActionInput,'Visible','on')
    27792782    ParamOut.ActionInput.Program=ActionName; % record the program in ActionInput
    27802783    SeriesData.ActionInput=ParamOut.ActionInput;
    27812784else
    2782 %     set(handles.ActionInput,'Visible','off')
    27832785    if isfield(SeriesData,'ActionInput')
    27842786        SeriesData=rmfield(SeriesData,'ActionInput');
Note: See TracChangeset for help on using the changeset viewer.