Changeset 1016
- Timestamp:
- Oct 5, 2017, 7:47:58 PM (7 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series.m
r1012 r1016 1010 1010 Time=XmlData.Time; 1011 1011 TimeName='xml'; 1012 % if XmlData.Time(1,:)==XmlData.Time(2,:)% case starting with index 11013 % sizDti=size(XmlData.Time,1)-1; % size of the time vector explicitly defined in the xml file1014 % ind_start=1;1015 % else1016 % sizDti=size(XmlData.Time,1); % case starting with index 01017 % ind_start=0;1018 % end1019 % % complement the input if the whole time series is not defined1020 % if size(i1_series,3)>size(XmlData.Time,1)-ind_start %only the first time interval is defined, extrapolate to the whole series1021 % Dti_total=XmlData.Time(end)-XmlData.Time(1); % total time interval covered by the time vector1022 % missing_indices=sizDti+1+ind_start:size(i1_series,3)+1; % remaining set of frame indices for which time needs to be found1023 % repeat_nbre=1+floor((missing_indices-sizDti-ind_start)/(sizDti-1)); % number of repetitions of Dti1024 % 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 % end1028 % % update the xml file with NbDti1029 % 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 % end1035 % [t,uid_NbDti]=add(t,uid_NbDti,'chardata',num2str(repeat_nbre(end)-1));1036 % save(t,XmlFileName)1037 % end1038 1012 end 1039 1013 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 % end1044 % NbSlice=XmlData.Camera.NbSlice; % Nbre of slices from camera1045 % end1046 1014 if isfield(XmlData.Camera,'TimeUnit')&& ~isempty(XmlData.Camera.TimeUnit) 1047 1015 if iview>1 && ~isempty(TimeUnit) && ~strcmp(TimeUnit,XmlData.Camera.TimeUnit) … … 1061 1029 end 1062 1030 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 else1070 NbSlice=siz(1);1071 end1072 end1073 end1031 % 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 1074 1042 end 1075 1043 if ~isempty(NbSlice) … … 1122 1090 SeriesData.FileInfo{iview}=FileInfo; 1123 1091 SeriesData.Time{iview}=Time; 1124 % if ~isempty(TimeName) 1125 % SeriesData.TimeSource=TimeSource;1126 % end 1092 1093 SeriesData.TimeName=TimeName; 1094 1127 1095 if check_calib 1128 1096 SeriesData.GeometryCalib{iview}=XmlData.GeometryCalib; … … 3628 3596 ref_j=str2num(get(handles.num_first_j,'String')); 3629 3597 end 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}); 3599 InputTable=get(handles.InputTable,'Data'); 3600 displ_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}); 3602 for iline=1:size(InputTable,1) 3603 viewcell{iline}=num2str(iline); 3604 end 3605 viewcell=viewcell'; 3606 ModeMenu={'bursts';'series(Dj)'}; 3607 ModeValue=1; 3608 %i1_series,i2_series,j1_series,j2_series,mode,time,TimeUnit,ref_i,ref_j,TimeName,InputTable,FileInfo 3633 3609 % first raw of the GUI 3634 3610 uicontrol('Style','text','Units','normalized', 'Position', [0.05 0.88 0.5 0.1],'BackgroundColor',BackgroundColor,... 3635 3611 'String','row to edit #','FontUnits','points','FontSize',12,'FontWeight','bold','ForegroundColor','blue','HorizontalAlignment','right'); % title 3636 3612 uicontrol('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',... 3638 3614 'Tag','ListView','TooltipString','''ListView'':choice of the file series w for pair display'); 3639 3615 % second raw of the GUI … … 3686 3662 3687 3663 %% 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 3665 if strcmp(mode,'series(Dj)') 3666 status_j='on'; % default 3667 else 3668 status_j='off'; % no j index needed for bust case 3669 end 3670 enable_j(hhseries,status_j) % no j index needed 3698 3671 3699 3672 %% get the reference indices for the time interval Dt … … 3711 3684 3712 3685 %% 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);3686 Menu=update_listpair(i1_series,i2_series,j1_series,j2_series,mode,SeriesData.Time{iview},TimeUnit,ref_i,ref_j,SeriesData.FileInfo); 3714 3687 hlist_pairs=findobj(get(hObject,'parent'),'Tag','ListPair'); 3715 3688 set(hlist_pairs,'Value',1)% set the first choice by default in ListPair -
trunk/src/series/civ_input.m
r1010 r1016 320 320 if ~isfield(Param.IndexRange,'first_j')||isequal(MaxIndex_j,MinIndex_j)% no possibility of j pairs 321 321 set(handles.ListPairMode,'Value',1) 322 set(handles.ListPairMode,'String',{'series(Di)'})322 PairMenu={'series(Di)'}; 323 323 elseif 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)'}; 325 325 if MaxIndex_j <= 10 326 326 set(handles.ListPairMode,'Value',1)% advice 'pair j1-j2' except in MaxIndex_j is large 327 327 end 328 328 else 329 set(handles.ListPairMode,'String',{'pair j1-j2';'series(Dj)';'series(Di)'})%multiple choice329 PairMenu={'pair j1-j2';'series(Dj)';'series(Di)'};%multiple choice 330 330 if strcmp(NomTypeNc,'_1-2_1') 331 331 set(handles.ListPairMode,'Value',3)% advise 'series(Di)' … … 334 334 end 335 335 end 336 set(handles.ListPairMode,'String',PairMenu) 337 338 %% set default choice of pair mode 339 PairIndex=[]; 340 if isfield(Param,'ActionInput') && isfield(Param.ActionInput,'PairIndices') 341 PairIndex=find(strcmp(Param.ActionInput.PairIndices.ListPairMode,PairMenu)); 342 end 343 if 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 357 end 358 set(handles.ListPairMode,'Value',PairIndex); 336 359 337 360 %% indicate the min and max indices i and j on the GUI
Note: See TracChangeset
for help on using the changeset viewer.