📄 cr1dmod.m
字号:
% --------------------------------------------------------------------% --- Executes on button press in topview_button.function topview_button_Callback(hObject, eventdata, handles)% hObject handle to topview_button (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)
config = topview(handles.config);
if isstruct(config)
handles.config = config;
set(handles.Config_popup,'value', ...
find(ismember(get(handles.Config_popup,'string'), ...
handles.config.type)));
handles = update_config(handles);
guidata(hObject,handles);
end
% --------------------------------------------------------------------% --- Executes on button press in Add_button.function add_button_Callback(hObject, eventdata, handles)% hObject handle to Add_button (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)
handles.layers(2:end+1) = handles.layers(1:end);
if length(handles.layers) == 2
handles.layers(1).thickness = 10;
end
for k = 2:size(get(handles.Layer_popup,'String'),1)
handles.layers(k).depth_to_top = ...
handles.layers(k-1).depth_to_top+handles.layers(k-1).thickness;
end
handles.layers(1).interface_handle = [];
% otherwise it points to the interface of layer 2!
handles.layers(1).prop_lab_handle = [];
handles.layers(1).label_handle = [];
handles = update_model(handles);
guidata(hObject, handles);
update_layer_param(handles);
ylimits = [-1 2/5]*(9/7*handles.layers(end).depth_to_top);
set(handles.axes1,'ylim',ylimits);
if strcmp(handles.config.type,'TEM Central Loop')
yscale = diff(ylimits);
t = sin([0:pi/100:pi]).*yscale./70;
set(handles.config.plot_handle(1),'ydata',t.*4);
set(handles.config.plot_handle(2),'ydata',t.*1);
end
handles = update_model(handles);
guidata(hObject, handles);
% --------------------------------------------------------------------% --- Executes on button press in delete_button.function delete_button_Callback(hObject, eventdata, handles)% hObject handle to delete_button (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)
layer_index = get(handles.Layer_popup,'Value');
if layer_index ~= size(get(handles.Layer_popup,'String'),1)
% keyboard
delete(handles.layers(layer_index).label_handle,...
handles.layers(layer_index).interface_handle,...
handles.layers(layer_index).prop_lab_handle);
handles.layers(layer_index) = [];
handles.layers(layer_index).depth_to_top = ...
sum([handles.layers(1:layer_index-1).thickness]);
handles = update_model(handles);
guidata(hObject, handles);
update_layer_param(handles);
handles = guidata(hObject);
if ( ~isempty(handles.layers(layer_index).depth_to_top) ) && ...
( handles.layers(layer_index).depth_to_top ~= 0 )
ylimits = [-1 2/5]*(9/7*handles.layers(end).depth_to_top);
set(handles.axes1,'ylim',ylimits);
if strcmp(handles.config.type,'TEM Central Loop')
yscale = diff(ylimits);
t = sin([0:pi/100:pi]).*yscale./70;
set(handles.config.plot_handle(1),'ydata',t.*4);
set(handles.config.plot_handle(2),'ydata',t.*1);
end
end
handles = update_model(handles);
% Update handles structure
guidata(hObject, handles);
end
% --------------------------------------------------------------------function Extra_menu_Callback(hObject, eventdata, handles)% hObject handle to Untitled_1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)
if getappdata(0, 'compiled')
disp('CR1Dmod:Extra_menu_Callback: Keyboard access...');
keyboard
end
% --------------------------------------------------------------------function Tx_side_edit_Callback(hObject, eventdata, handles)
[num,isOK] = str2num(get(hObject,'String'));
if isOK & isfinite(num(1))
handles.config.TxS = num(1);
handles.config.TxR = sqrt(handles.config.TxS.^2/pi);
end
set(hObject,'String',num2str(handles.config.TxS));
handles = update_config(handles);
handles = update_model(handles);
guidata(hObject, handles);% --------------------------------------------------------------------function Rx_area_edit_Callback(hObject, eventdata, handles)
[num,isOK] = str2num(get(hObject,'String'));
if isOK & isfinite(num(1))
handles.config.RxA = num(1);
end
set(hObject,'String',num2str(handles.config.RxA));
handles = update_config(handles);
handles = update_model(handles);
guidata(hObject, handles);
% --------------------------------------------------------------------
function layer_label_Callback(hObject, eventdata, layerNo)
handles = guidata(hObject);
set(handles.Layer_popup, 'Value', layerNo);
Layer_popup_Callback(handles.Layer_popup, [], handles);
% --------------------------------------------------------------------
% --- Executes during object creation, after setting all properties.
function Layer_popup_CreateFcn(hObject, eventdata, handles)
if ispc
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
% --------------------------------------------------------------------
% --- Executes during object creation, after setting all properties.
function h_edit_CreateFcn(hObject, eventdata, handles)
if ispc
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
% --------------------------------------------------------------------
% --- Executes during object creation, after setting all properties.
function DC_res_edit_CreateFcn(hObject, eventdata, handles)
if ispc
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
% --------------------------------------------------------------------
% --- Executes during object creation, after setting all properties.
function m_edit_CreateFcn(hObject, eventdata, handles)
if ispc
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
% --------------------------------------------------------------------
% --- Executes during object creation, after setting all properties.
function Tau_edit_CreateFcn(hObject, eventdata, handles)
if ispc
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
% --------------------------------------------------------------------
% --- Executes during object creation, after setting all properties.
function c_edit_CreateFcn(hObject, eventdata, handles)
if ispc
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
% --------------------------------------------------------------------
% --- Executes during object creation, after setting all properties.
function Eps_r_edit_CreateFcn(hObject, eventdata, handles)
if ispc
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
% --------------------------------------------------------------------
% --- Executes during object creation, after setting all properties.
function Mu_edit_CreateFcn(hObject, eventdata, handles)
if ispc
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
% --------------------------------------------------------------------
% --- Executes during object creation, after setting all properties.
function Config_popup_CreateFcn(hObject, eventdata, handles)
if ispc
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
% --------------------------------------------------------------------
% --- Executes during object creation, after setting all properties.
function Aspac_edit_CreateFcn(hObject, eventdata, handles)
if ispc
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
% --------------------------------------------------------------------
% --- Executes during object creation, after setting all properties.
function Nspac_edit_CreateFcn(hObject, eventdata, handles)
if ispc
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
% --------------------------------------------------------------------
% --- Executes during object creation, after setting all properties.
function OA_edit_CreateFcn(hObject, eventdata, handles)
if ispc
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
% --------------------------------------------------------------------
% --- Executes during object creation, after setting all properties.
function OM_edit_CreateFcn(hObject, eventdata, handles)
if ispc
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
% --------------------------------------------------------------------
% --- Executes during object creation, after setting all properties.
function Rspac_edit_CreateFcn(hObject, eventdata, handles)
if ispc
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
% --------------------------------------------------------------------
% --- Executes during object creation, after setting all properties.
function Tx_side_edit_CreateFcn(hObject, eventdata, handles)
if ispc
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
% --------------------------------------------------------------------
% --- Executes during object creation, after setting all properties.
function Rx_area_edit_CreateFcn(hObject, eventdata, handles)
if ispc
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
% --- Executes when user attempts to close figure1.
function figure1_CloseRequestFcn(hObject, eventdata, handles)
% hObject handle to figure1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: delete(hObject) closes the figure
if isappdata(0,'debug') && getappdata(0,'debug')
disp('Executing CR1Dmod::figure1_CloseRequestFcn');
end
if isfield(handles,'compute_win') && ...
ishandle(handles.compute_win)
delete(handles.compute_win);
end
if handles.mfilePathRemove
rmpath(handles.mfilePath);
end
delete(hObject);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -