Changeset 770 for trunk


Ignore:
Timestamp:
May 3, 2014, 12:07:41 PM (11 years ago)
Author:
sommeria
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series.m

    r769 r770  
    243243end
    244244
    245 %% introduce the input file name(s) if defined from input Param
     245%% introduce the input file name(s) if defined from input Param, TODO: avoid the file checking if Param.i1_series defined
    246246if isfield(Param,'FileName')&&~isempty(Param.FileName)
    247247    InputTable={};
    248248    set(handles.InputTable,'Data',InputTable)
     249    display_file_name(handles,Param,'one')%refresh the input table
    249250    if isfield(Param,'FileName_1')
    250         display_file_name(handles,Param.FileName,'one')%refresh the input table
    251         display_file_name(handles,Param.FileName_1,1)
    252     else
    253         display_file_name(handles,Param.FileName,'one')%refresh the input table
     251        Param.FileName=Param.FileName_1;
     252        display_file_name(handles,Param,2)
    254253    end
    255254else
     
    567566%------------------------------------------------------------------------
    568567% --- Function called when a new file is opened, either by series_OpeningFcn or by the browser
    569 function errormsg=display_file_name(handles,fileinput,iview)
     568function errormsg=display_file_name(handles,Param,iview)
    570569%------------------------------------------------------------------------ 
    571570%
     
    579578drawnow
    580579errormsg='';%default
     580if ischar(Param)
     581    fileinput=Param;
     582else% input set when series is opened (called by the GUI uvmat)
     583    fileinput=Param.FileName;
     584end
     585   
    581586%% get the input root name, indices, file extension and nomenclature NomType
    582587if ~exist(fileinput,'file')
     
    589594%% detect root name, nomenclature and indices in the input file name:
    590595[FilePath,FileName,FileExt]=fileparts(fileinput);
     596%%%%%%%%%%%%%%%%%%
     597%TODO: case of input by uvmat: do not check agai the input seies %%%%%%%
     598%%%%%%%%%%%%%%%%%%%
    591599% detect the file type, get the movie object if relevant, and look for the corresponding file series:
    592600% the root name and indices may be corrected by including the first index i1 if a corresponding xml file exists
     
    10971105%------------------------------------------------------------------------
    10981106SeriesData=get(handles.series,'UserData');%
     1107if ~isfield(SeriesData,'Time')
     1108    return
     1109end
    10991110PairString=get(handles.PairString,'Data');
    11001111ref_i_1=str2num(get(handles.num_first_i,'String'));%first reference index
     
    14081419Param=read_GUI_series(handles);%displayed parameters
    14091420SeriesData=get(handles.series,'UserData');%hidden parameters
     1421if ~isfield(SeriesData,'i1_series')
     1422    msgbox_uvmat('ERROR','The input field series needs to be refreshed: press REFRESH')
     1423    return
     1424end
    14101425if isfield(Param,'InputFields')&& isequal(Param.InputFields.FieldName,'get_field...')
    14111426    msgbox_uvmat('ERROR','input field name(s) not defined, select get_field...')
     
    15351550        NbCore=1;% no need to split the calculation
    15361551    case 'cluster_oar'
    1537         if strcmp(Param.Action.ActionExt,'.m')% case of Matlab function (uncompiled)
     1552        if strcmp(ActionExt,'.m')% case of Matlab function (uncompiled)
    15381553            NbCore=1;% one core used only (limitation of Matlab licences)
    15391554            msgbox_uvmat('WARNING','Number of cores =1: select the compiled version civ_matlab.sh for multi-core processing');
     
    16561671    ref_i=first_i:incr_i:last_i;
    16571672    if isempty(incr_j)
    1658     [ref_j,tild]=find(squeeze(SeriesData.i1_series{1}(1,:,:)));
    1659     ref_j=ref_j-1;
    1660     ref_j=ref_j(ref_j>=first_j & ref_j<=last_j);
     1673        [ref_j,tild]=find(squeeze(SeriesData.i1_series{1}(1,:,:)));
     1674        ref_j=ref_j-1;
     1675        ref_j=ref_j(ref_j>=first_j & ref_j<=last_j);
    16611676    else
    16621677        ref_j=first_j:incr_j:last_j;
     
    18171832                        system(['chmod +x ' filebat]);% set the file to executable
    18181833                       
    1819                     case {'PCWIN','PCWIN64'}    %       TODO: adapt to Windows system
    1820                         %                                 cmd=['matlab -automation -logfile ' regexprep(filelog,'\\','\\\\')...
    1821                         %                                     ' -r "addpath(''' regexprep(path_series,'\\','\\\\') ''');'...
    1822                         %                                     'addpath(''' regexprep(Param.Action.ActionPath,'\\','\\\\') ''');'...
    1823                         %                                     '' Param.Action.ActionName  '( ''' regexprep(filexml,'\\','\\\\') ''');exit"'];
     1834                    case {'PCWIN','PCWIN64'}   
    18241835                        fprintf(fid,cmd);
    18251836                        fclose(fid);
    1826                         %                               dos([filebat ' &']);
    18271837                end
    18281838        end
     
    20562066if numel(iview_civ)>=1 && ~isempty(iview_civ(1))
    20572067    menu=set_veltype_display(SeriesData.FileInfo{iview_civ(1)}.CivStage,SeriesData.FileType{iview_civ(1)});
     2068    set(handles.VelType,'Value',1)% set first choice by default
    20582069    set(handles.VelType,'String',[{'*'};menu])
    20592070    if numel(iview_civ)>=2
    20602071        menu=set_veltype_display(SeriesData.FileInfo{iview_civ(2)}.CivStage,SeriesData.FileType{iview_civ(2)});
     2072        set(handles.VelType_1,'Value',1)% set first choice by default
    20612073        set(handles.VelType_1,'String',[{'*'};menu])
    20622074    end
Note: See TracChangeset for help on using the changeset viewer.