Changeset 741
- Timestamp:
- Apr 15, 2014, 9:06:46 AM (11 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/browse_data.m
r733 r741 72 72 set(hObject, 'Units', OldUnits); 73 73 if exist('Campaign','var') 74 [ CampaignPath,CampaignName]=fileparts(Campaign);74 [tild,CampaignName]=fileparts(Campaign); 75 75 RootXml=fullfile(Campaign,[CampaignName '.xml']); 76 76 s=[]; … … 125 125 if isempty(MirrorRoot) 126 126 return 127 elseif strcmp(MirrorRoot,SourcePath) 128 msgbox_uvmat('ERROR','The mirror folder must be different from the source') 129 return 127 130 else 128 131 MirrorDir=fullfile(MirrorRoot,ProjectName); 129 132 end 130 if ~exist(MirrorDir,'dir') 131 mkdir(MirrorDir) 133 if exist(MirrorDir,'dir') 134 msgbox_uvmat('ERROR',['The folder ' MirrorDir ' chosen as new mirror campaign already exists']) 135 return 136 else 137 [s,errormsg]=mkdir(MirrorDir)% create the mirror dir 138 if s~=1 139 msgbox_uvmat('ERROR',['error in creating ' MirrorDir ': ' errormsg]) 140 return 141 end 132 142 end 133 143 MirrorDoc.SourceDir=SourceDir; 134 144 t=struct2xml(MirrorDoc); 135 145 set(t,1,'name','DataTree'); 136 save(t,fullfile(MirrorDir,[ProjectName '.xml'])) 146 save(t,fullfile(MirrorDir,[ProjectName '.xml']))% create an xml file in the mirror folder to indicate its source folder 137 147 set(handles.MirrorDir,'String',MirrorDir) 138 148 set(handles.MirrorDir,'Visible','on') 149 set(handles.CreateMirror,'String','update_mirror') 139 150 end 140 151 ExpName={''}; … … 206 217 function ListExperiments_Callback(hObject, eventdata, handles) 207 218 208 MirrorPath='';209 CampaignPath=get(handles.SourceDir,'String');210 219 if strcmp(get(handles.MirrorDir,'Visible'),'on') 211 220 MirrorPath=get(handles.MirrorDir,'String'); 221 else 222 MirrorPath=get(handles.SourceDir,'String'); 212 223 end 213 224 ListExperiments=get(handles.ListExperiments,'String'); … … 229 240 for iexp=1:numel(ListExperiments) 230 241 if strcmp(ListExperiments{iexp}(1),'+')% if the item is a directory 231 ListExperiments{iexp}(1)=[]; 242 ListExperiments{iexp}(1)=[];%remove the first char '+' used to mark folders 232 243 ListStruct=dir(fullfile(MirrorPath,ListExperiments{iexp})); %list files and dir in the source experiment directory 233 244 ListCells=struct2cell(ListStruct);%transform dir struct to a cell arrray … … 279 290 if ~isempty(MirrorPath) 280 291 mirror=fullfile(MirrorPath,ListExperiments{iexp},ListFiles{ilist}); 281 if exist(mirror,' dir')||exist(mirror,'file')292 if exist(mirror,'file')% if mirror already exists as a file or folder 282 293 [tild,msg]=fileattrib(mirror); 283 294 if strcmp(msg.Name,mirror)%if the mirror name already exists as a local file or dir 284 if msg.directory% case of a f 295 if msg.directory% case of a folder 285 296 answer=msgbox_uvmat('INPUT_Y-N',['replace local folder ' msg.Name ' by a link to the source dir']); 286 297 if strcmp(answer,'Yes') … … 292 303 end 293 304 end 294 else 305 else % case of an existing mirror file 295 306 answer=msgbox_uvmat('INPUT_Y-N',['replace local file ' msg.Name ' by a link to the source file']); 296 307 if strcmp(answer,'Yes') 297 308 delete(mirror); 298 system(['ln -s ' DataSeries ' ' mirror]); % create the link to the source folder 299 309 system(['ln -s ' DataSeries ' ' mirror]); % create the link to the source folder 300 310 end 301 311 end 302 else% create mirror to the data series if needed303 system(['ln -s ' DataSeries ' ' mirror]); % create the link to the source folder304 312 end 313 else% create mirror to the data series if needed 314 system(['ln -s ' DataSeries ' ' mirror]); % create the link to the source folder 305 315 end 306 316 if isempty(find(strcmp(ListFiles{ilist},ListDevices), 1))% if the item is not already in ListDevices … … 586 596 Device=Device(Value); 587 597 Device=regexprep(Device,'^\+/','');% remove the +/ used to mark dir 598 Device=regexprep(Device,'^~','');% remove the ~ used to mark symbolic link 588 599 handles.output.Experiment=Experiment; 589 600 handles.output.DataSeries=Device; -
trunk/src/mouse_motion.m
r738 r741 25 25 function mouse_motion(hObject,eventdata,handles) 26 26 27 % if ~exist('handles','var')28 % set(hCurrentFig,'Pointer','arrow');29 % return30 % end31 27 FigData=get(hObject,'UserData'); 32 28 if ishandle(FigData)% case of a zoom plot, the handle of the parent rectangle is stored in UserData, its parent is the plotting axes of the rectangle … … 84 80 % AxeData=[];%default 85 81 xy=[];%default 82 set(hCurrentFig,'Units','normalized') 86 83 xy_fig=get(hObject,'CurrentPoint');% current point of the current figure (gcbo) 87 84 pointershape='arrow';% default pointer is an arrow … … 218 215 end 219 216 %display the z coordinate if defined by the projection plane 220 if isfield(Field,' ObjectType') && strcmp(Field.ObjectType,'plane') && isfield(Field,'ObjectCoord') && length(Field.ObjectCoord)>=3217 if isfield(Field,'ProjObjectType') && strcmp(Field.ProjObjectType,'plane') && isfield(Field,'ProjObjectCoord') && length(Field.ProjObjectCoord)>=3 221 218 pos=[xy(1,1) xy(1,2) 0]; 222 if isfield(Field,' ObjectAngle')&&~isequal(Field.ObjectAngle,[0 0 0])223 om=norm(Field. ObjectAngle);%norm of rotation angle in radians224 OmAxis=Field. ObjectAngle/om; %unit vector marking the rotation axis219 if isfield(Field,'ProjObjectAngle')&&~isequal(Field.ProjObjectAngle,[0 0 0]) 220 om=norm(Field.ProjObjectAngle);%norm of rotation angle in radians 221 OmAxis=Field.ProjObjectAngle/om; %unit vector marking the rotation axis 225 222 cos_om=cos(pi*om/180); 226 223 sin_om=sin(pi*om/180); … … 228 225 pos=cos_om*pos+sin_om*cross(OmAxis,pos)+(1-cos_om)*(OmAxis*pos')*OmAxis; 229 226 end 230 pos=pos+[Field.ObjectCoord 0]; 227 % pos=pos+[Field.ProjObjectCoord 0]; 228 pos=pos+Field.ProjObjectCoord; 231 229 text_displ_3=[text_displ_3 'x,y,z=' num2str(pos,4)]; 232 230 end
Note: See TracChangeset
for help on using the changeset viewer.