Changeset 429 for trunk/src/view_field.m
- Timestamp:
- May 22, 2012, 1:07:40 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/view_field.m
r428 r429 88 88 set(hObject,'WindowButtonUpFcn',{'mouse_up',handles_mouse}) 89 89 set(hObject,'DeleteFcn',{@closefcn})% 90 set(hObject,'ResizeFcn',{@ResizeFcn,handles})% 90 91 ViewFieldData.axes3=[];%initiates the record of the current field (will be updated by plot_field) 91 set(handles.view_field,'UserData',ViewFieldData);%store the current field 92 set(handles.view_field,'Units','pixels') 93 ViewFieldData.GUISize=get(handles.view_field,'Position'); 94 set(handles.view_field,'UserData',ViewFieldData);%store the initial fig size in UserData 92 95 AxeData.LimEditBox=1; %initialise AxeData, the parent figure sets plot parameters 93 96 set(handles.axes3,'UserData',AxeData) … … 100 103 write_plot_param(handles,PlotParamOut);% update the display of the plotting parameters 101 104 end 105 106 %------------------------------------------------------------------------ 107 %--- activated when resizing the GUI view_field 108 function ResizeFcn(gcbo,eventdata,handles) 109 %------------------------------------------------------------------------ 110 set(handles.view_field,'Units','pixels') 111 size_fig=get(handles.view_field,'Position'); 112 Data=get(handles.view_field,'UserData'); 113 Data.GUISize=size_fig; 114 set(handles.view_field,'UserData',Data) 115 116 %% reset position of text_display or TableDisplay 117 if strcmp(get(handles.TableDisplay,'Visible'),'off') 118 pos_1=get(handles.text_display,'Position'); 119 pos_1(1)=size_fig(3)-pos_1(3); 120 pos_1(2)=size_fig(4)-pos_1(4); 121 set(handles.text_display,'Position',pos_1) 122 % reset position of TableDisplay 123 else 124 pos_1=get(handles.TableDisplay,'Position'); 125 pos_1(1)=size_fig(3)-pos_1(3); 126 pos_1(2)=size_fig(4)-pos_1(4); 127 set(handles.TableDisplay,'Position',pos_1) 128 end 129 130 %% reset position of Coordinates 131 pos_2=get(handles.Coordinates,'Position'); 132 pos_2(1)=size_fig(3)-pos_1(3); 133 pos_2(2)=pos_1(2)-pos_2(4); 134 set(handles.Coordinates,'Position',pos_2) 135 136 %% reset position of Scalar 137 pos_3=get(handles.Scalar,'Position'); 138 pos_3(1)=size_fig(3)-pos_3(3); 139 if strcmp(get(handles.Scalar,'visible'),'on') 140 pos_3(2)=pos_2(2)-pos_3(4); 141 else 142 pos_3(2)=pos_2(2); 143 end 144 set(handles.Scalar,'Position',pos_3) 145 146 %% reset position of Vectors 147 pos_4=get(handles.Vectors,'Position'); 148 pos_4(1)=size_fig(3)-pos_4(3); 149 if strcmp(get(handles.Vectors,'visible'),'on') 150 pos_4(2)=pos_3(2)-pos_4(4); 151 else 152 pos_4(2)=pos_3(2); 153 end 154 set(handles.Vectors,'Position',pos_4) 155 156 %% reset position and scale of axis 157 bord=[50 40 30 60]; %bordure left,inf, right,sup 158 pos(1)=bord(1); 159 pos(2)=bord(2); 160 pos(3)=max(1,pos_1(1)-pos(1)-bord(3)); 161 pos(4)=max(1,size_fig(4)-bord(4)); 162 set(handles.axes3,'Position',pos) 163 164 %------------------------------------------------------------------------ 102 165 %------------------------------------------------------------------------ 103 166 % --- Outputs from this function are returned to the command menuline. … … 105 168 %------------------------------------------------------------------------ 106 169 varargout{1} = handles.output;% the only output argument is the handle to the GUI figure 170 varargout{2} = strcmp(get(handles.axes3,'Visible'),'on');% check active plot axis 107 171 108 172 %------------------------------------------------------------------------ … … 271 335 runpm(hObject,eventdata,handles,increment) 272 336 273 %------------------------------------------------------------------- 274 %Executes on button press in runmin: make one step backward and call 275 %run0. The step backward is along the fields series 1 or 2 depending on 276 %the scan_i and scan_j check box (exclusive each other) 277 %------------------------------------------------------------------- 278 function RunMovie_Callback(hObject, eventdata, handles) 279 %------------------------------------------------------------------ 280 set(handles.RunMovie,'BackgroundColor',[1 1 0])%paint the command button in yellow 281 drawnow 282 increment=str2num(get(handles.increment_scan,'String')); %get the field increment d 283 set(handles.STOP,'Visible','on') 284 set(handles.speed,'Visible','on') 285 set(handles.speed_txt,'Visible','on') 286 set(handles.RunMovie,'BusyAction','queue') 287 testavi=0; 288 UvData=get(handles.view_field,'UserData'); 289 290 while get(handles.speed,'Value')~=0 & isequal(get(handles.RunMovie,'BusyAction'),'queue') % enable STOP command 291 runpm(hObject,eventdata,handles,increment) 292 pause(1.02-get(handles.speed,'Value'))% wait for next image 293 end 294 if isfield(UvData,'aviobj') && ~isempty( UvData.aviobj), 295 UvData.aviobj=close(UvData.aviobj); 296 set(handles.view_field,'UserData',UvData); 297 end 298 set(handles.RunMovie,'BackgroundColor',[1 0 0])%paint the command buttonback to red 299 337 % %------------------------------------------------------------------- 338 % %Executes on button press in runmin: make one step backward and call 339 % %run0. The step backward is along the fields series 1 or 2 depending on 340 % %the scan_i and scan_j check box (exclusive each other) 341 % %------------------------------------------------------------------- 342 % function RunMovie_Callback(hObject, eventdata, handles) 343 % %------------------------------------------------------------------ 344 % set(handles.RunMovie,'BackgroundColor',[1 1 0])%paint the command button in yellow 345 % drawnow 346 % increment=str2num(get(handles.increment_scan,'String')); %get the field increment d 347 % set(handles.STOP,'Visible','on') 348 % set(handles.speed,'Visible','on') 349 % set(handles.speed_txt,'Visible','on') 350 % set(handles.RunMovie,'BusyAction','queue') 351 % testavi=0; 352 % UvData=get(handles.view_field,'UserData'); 353 % 354 % while get(handles.speed,'Value')~=0 & isequal(get(handles.RunMovie,'BusyAction'),'queue') % enable STOP command 355 % runpm(hObject,eventdata,handles,increment) 356 % pause(1.02-get(handles.speed,'Value'))% wait for next image 357 % end 358 % if isfield(UvData,'aviobj') && ~isempty( UvData.aviobj), 359 % UvData.aviobj=close(UvData.aviobj); 360 % set(handles.view_field,'UserData',UvData); 361 % end 362 % set(handles.RunMovie,'BackgroundColor',[1 0 0])%paint the command buttonback to red 300 363 301 364
Note: See TracChangeset
for help on using the changeset viewer.