Changeset 1016


Ignore:
Timestamp:
Oct 5, 2017, 7:47:58 PM (7 years ago)
Author:
sommeria
Message:

bugs repaired for multilevel series

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series.m

    r1012 r1016  
    10101010        Time=XmlData.Time;
    10111011        TimeName='xml';
    1012 %                         if XmlData.Time(1,:)==XmlData.Time(2,:)% case starting with index 1
    1013 %                     sizDti=size(XmlData.Time,1)-1; % size of the time vector explicitly defined in the xml file
    1014 %                     ind_start=1;
    1015 %                 else
    1016 %                     sizDti=size(XmlData.Time,1); % case starting with index 0
    1017 %                     ind_start=0;
    1018 %                 end
    1019 %         % complement the input if the whole time series is not defined
    1020 %             if size(i1_series,3)>size(XmlData.Time,1)-ind_start %only the first time interval is defined, extrapolate to the whole series
    1021 %                 Dti_total=XmlData.Time(end)-XmlData.Time(1); % total time interval covered by the time vector
    1022 %                 missing_indices=sizDti+1+ind_start:size(i1_series,3)+1; % remaining set of frame indices for which time needs to be found
    1023 %                 repeat_nbre=1+floor((missing_indices-sizDti-ind_start)/(sizDti-1)); % number of repetitions of Dti
    1024 %                 time_indices=1+mod(missing_indices-sizDti-1,sizDti-1);
    1025 %                 for j=1:size(XmlData.Time,2)
    1026 %                 Time(missing_indices,j)=XmlData.Time(time_indices,j)+repeat_nbre'*Dti_total;
    1027 %                 end
    1028 %                 % update the xml file with NbDti
    1029 %                 t=xmltree(XmlFileName);
    1030 %                 uid_NbDti=find(t,'ImaDoc/Camera/BurstTiming/NbDti')
    1031 %                 if isempty(uid_NbDti)
    1032 %                     uid_BurstTiming=find(t,'ImaDoc/Camera/BurstTiming')
    1033 %                     [t,uid_NbDti]=add(t,uid_BurstTiming,'element','NbDti');
    1034 %                 end
    1035 %                 [t,uid_NbDti]=add(t,uid_NbDti,'chardata',num2str(repeat_nbre(end)-1));
    1036 %                 save(t,XmlFileName)
    1037 %             end
    10381012    end
    10391013    if isfield(XmlData,'Camera')
    1040         %         if isfield(XmlData.Camera,'NbSlice')&& ~isempty(XmlData.Camera.NbSlice)
    1041         %             if iview>1 && ~isempty(NbSlice) && ~strcmp(NbSlice,XmlData.Camera.NbSlice)
    1042         %                 msgbox_uvmat('WARNING','inconsistent number of slices with the first field series');
    1043         %             end
    1044         %             NbSlice=XmlData.Camera.NbSlice; % Nbre of slices from camera
    1045         %         end
    10461014        if isfield(XmlData.Camera,'TimeUnit')&& ~isempty(XmlData.Camera.TimeUnit)
    10471015            if iview>1 && ~isempty(TimeUnit) && ~strcmp(TimeUnit,XmlData.Camera.TimeUnit)
     
    10611029    end
    10621030   
    1063     if isfield(XmlData,'GeometryCalib')
    1064         check_calib=1;
    1065         if isfield(XmlData.GeometryCalib,'SliceCoord')
    1066             siz=size(XmlData.GeometryCalib.SliceCoord);
    1067             if ~isempty(NbSlice)&& ~isequal(size(1),NbSlice)
    1068                 msgbox_uvmat('WARNING','inconsistent numbers of Z indices between motor and calibration');
    1069             else
    1070                 NbSlice=siz(1);
    1071             end
    1072         end
    1073     end
     1031%     if isfield(XmlData,'GeometryCalib')
     1032%         check_calib=1;
     1033%         if isfield(XmlData.GeometryCalib,'SliceCoord')
     1034%             siz=size(XmlData.GeometryCalib.SliceCoord);
     1035%             if ~isempty(NbSlice)&& ~isequal(size(1),NbSlice)
     1036%                 msgbox_uvmat('WARNING','inconsistent numbers of Z indices between motor and calibration');
     1037%             else
     1038%                 NbSlice=siz(1);
     1039%             end
     1040%         end
     1041%     end
    10741042end
    10751043if ~isempty(NbSlice)
     
    11221090SeriesData.FileInfo{iview}=FileInfo;
    11231091SeriesData.Time{iview}=Time;
    1124 % if ~isempty(TimeName)
    1125 %     SeriesData.TimeSource=TimeSource;
    1126 % end
     1092
     1093SeriesData.TimeName=TimeName;
     1094
    11271095if check_calib
    11281096    SeriesData.GeometryCalib{iview}=XmlData.GeometryCalib;
     
    36283596    ref_j=str2num(get(handles.num_first_j,'String'));
    36293597end
    3630 [ModeMenu,ModeValue]=update_mode(SeriesData.i1_series{iview},SeriesData.i2_series{iview},SeriesData.j2_series{iview});
    3631 displ_pair=update_listpair(SeriesData.i1_series{iview},SeriesData.i2_series{iview},SeriesData.j1_series{iview},SeriesData.j2_series{iview},ModeMenu{ModeValue},...
    3632                                                      SeriesData.Time{iview},TimeUnit,ref_i,ref_j,SeriesData.FileInfo{iview});
     3598[ModeMenu,ModeValue]=update_mode(SeriesData.i1_series{1},SeriesData.i2_series{1},SeriesData.j2_series{1});
     3599InputTable=get(handles.InputTable,'Data');
     3600displ_pair=update_listpair(SeriesData.i1_series{1},SeriesData.i2_series{1},SeriesData.j1_series{1},SeriesData.j2_series{1},ModeMenu{ModeValue},...
     3601                                                 SeriesData.Time{1},TimeUnit,ref_i,ref_j,SeriesData.TimeName,InputTable,SeriesData.FileInfo{1});
     3602for iline=1:size(InputTable,1)
     3603    viewcell{iline}=num2str(iline);
     3604end
     3605viewcell=viewcell';
     3606ModeMenu={'bursts';'series(Dj)'};
     3607ModeValue=1;                                               
     3608                   %i1_series,i2_series,j1_series,j2_series,mode,time,TimeUnit,ref_i,ref_j,TimeName,InputTable,FileInfo                             
    36333609% first raw of the GUI
    36343610uicontrol('Style','text','Units','normalized', 'Position', [0.05 0.88 0.5 0.1],'BackgroundColor',BackgroundColor,...
    36353611    'String','row to edit #','FontUnits','points','FontSize',12,'FontWeight','bold','ForegroundColor','blue','HorizontalAlignment','right'); % title
    36363612uicontrol('Style','popupmenu','Units','normalized', 'Position', [0.54 0.8 0.3 0.2],'BackgroundColor',[1 1 1],...
    3637     'Callback',@(hObject,eventdata)ListView_Callback(hObject,eventdata),'String',ListViewMenu,'Value',ListViewValue,'FontUnits','points','FontSize',12,'FontWeight','bold',...
     3613    'Callback',@(hObject,eventdata)ListView_Callback(hObject,eventdata),'String',viewcell,'Value',1,'FontUnits','points','FontSize',12,'FontWeight','bold',...
    36383614    'Tag','ListView','TooltipString','''ListView'':choice of the file series w for pair display');
    36393615% second raw of the GUI
     
    36863662
    36873663%% enable j index visibility after the new choice
    3688 status_j='on'; % default
    3689 if isempty(find(~cellfun(@isempty,SeriesData.j1_series), 1)); % case of empty j indices
    3690     status_j='off'; % no j index needed
    3691 elseif strcmp(get(handles.PairString,'Visible'),'on')
    3692     check_burst=cellfun(@isempty,regexp(PairString,'^j')); % =0 for burst case, 1 otherwise
    3693     if isempty(find(check_burst, 1))% if all pair string begins by j (burst)
    3694         status_j='off'; % no j index needed for bust case
    3695     end
    3696 end
    3697 enable_j(handles,status_j) % no j index needed
     3664
     3665if strcmp(mode,'series(Dj)')
     3666   status_j='on'; % default
     3667else
     3668       status_j='off'; % no j index needed for bust case
     3669end
     3670enable_j(hhseries,status_j) % no j index needed
    36983671
    36993672%% get the reference indices for the time interval Dt
     
    37113684
    37123685%% update the menu ListPair
    3713 Menu=update_listpair(i1_series,i2_series,j1_series,j2_series,mode,SeriesData.Time{iview},TimeUnit,ref_i,ref_j,FileInfo);
     3686Menu=update_listpair(i1_series,i2_series,j1_series,j2_series,mode,SeriesData.Time{iview},TimeUnit,ref_i,ref_j,SeriesData.FileInfo);
    37143687hlist_pairs=findobj(get(hObject,'parent'),'Tag','ListPair');
    37153688set(hlist_pairs,'Value',1)% set the first choice by default in ListPair
  • trunk/src/series/civ_input.m

    r1010 r1016  
    320320if ~isfield(Param.IndexRange,'first_j')||isequal(MaxIndex_j,MinIndex_j)% no possibility of j pairs
    321321    set(handles.ListPairMode,'Value',1)
    322     set(handles.ListPairMode,'String',{'series(Di)'})
     322    PairMenu={'series(Di)'};
    323323elseif  MaxIndex_i==1 && MaxIndex_j>1% simple series in j
    324     set(handles.ListPairMode,'String',{'pair j1-j2';'series(Dj)'})
     324    PairMenu={'pair j1-j2';'series(Dj)'};
    325325    if  MaxIndex_j <= 10
    326326        set(handles.ListPairMode,'Value',1)% advice 'pair j1-j2' except in MaxIndex_j is large
    327327    end
    328328else
    329     set(handles.ListPairMode,'String',{'pair j1-j2';'series(Dj)';'series(Di)'})%multiple choice
     329    PairMenu={'pair j1-j2';'series(Dj)';'series(Di)'};%multiple choice
    330330    if strcmp(NomTypeNc,'_1-2_1')
    331331        set(handles.ListPairMode,'Value',3)% advise 'series(Di)'
     
    334334    end
    335335end
     336set(handles.ListPairMode,'String',PairMenu)
     337
     338%% set default choice of pair mode
     339PairIndex=[];
     340if isfield(Param,'ActionInput') && isfield(Param.ActionInput,'PairIndices')
     341    PairIndex=find(strcmp(Param.ActionInput.PairIndices.ListPairMode,PairMenu));
     342end
     343if isempty(PairIndex)
     344    if ~isfield(Param.IndexRange,'first_j')||isequal(MaxIndex_j,MinIndex_j)% no possibility of j pairs
     345        PairIndex=1;
     346    elseif  MaxIndex_i==1 && MaxIndex_j>1% simple series in j
     347        if  MaxIndex_j <= 10
     348            PairIndex=1;% advice 'pair j1-j2' except in MaxIndex_j is large
     349        end
     350    else
     351        if strcmp(NomTypeNc,'_1-2_1')
     352            PairIndex=3;% advise 'series(Di)'
     353        elseif  MaxIndex_j <= 10
     354            PairIndex=1;% advice 'pair j1-j2' except in MaxIndex_j is large
     355        end
     356    end
     357end
     358set(handles.ListPairMode,'Value',PairIndex); 
    336359
    337360%% indicate the min and max indices i and j on the GUI
Note: See TracChangeset for help on using the changeset viewer.