function varargout = fbnq_diffraction(varargin)
%FBNQ_DIFFRACTION M-file for fbnq_diffraction.fig
% FBNQ_DIFFRACTION, by itself, creates a new FBNQ_DIFFRACTION or raises the existing
% singleton*.
%
% H = FBNQ_DIFFRACTION returns the handle to a new FBNQ_DIFFRACTION or the handle to
% the existing singleton*.
%
% FBNQ_DIFFRACTION('Property','Value',...) creates a new
FBNQ_DIFFRACTION using the
% given property value pairs. Unrecognized properties are passed via % varargin to fbnq_diffraction_OpeningFcn. This calling syntax produces a
% warning when there is an existing singleton*.
%
% FBNQ_DIFFRACTION('CALLBACK') and
FBNQ_DIFFRACTION('CALLBACK',hObject,...) call the
% local function named CALLBACK in FBNQ_DIFFRACTION.M with the given input
% arguments.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one % instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help fbnq_diffraction
% Last Modified by GUIDE v2.5 04-Nov-2011 18:32:44
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @fbnq_diffraction_OpeningFcn, ...
'gui_OutputFcn', @fbnq_diffraction_OutputFcn, ...
'gui_LayoutFcn', [], ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before fbnq_diffraction is made visible.
function fbnq_diffraction_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin unrecognized PropertyName/PropertyValue pairs from the
% command line (see VARARGIN)
% Choose default command line output for fbnq_diffraction
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
if strcmp(get(hObject,'Visible'),'off')
initialize_gui(hObject, handles);
end
% UIWAIT makes fbnq_diffraction wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = fbnq_diffraction_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
function distance_Callback(hObject, eventdata, handles)
% hObject handle to distance (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of distance as text
% str2double(get(hObject,'String')) returns contents of distance as a double
distance = str2double(get(hObject, 'String'));
if isnan(distance)
set(hObject, 'String', 100);
errordlg('Input must be a number','Error');
end
data = getappdata(gcbf, 'metricdata');
data.distance = distance;
setappdata(gcbf, 'metricdata', data);
% --- Executes during Object creation, after setting all properties. function distance_CreateFcn(hObject, eventdata, handles)
% hObject handle to distance (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
usewhitebg = 1;
if usewhitebg
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'))
;
end
function samspace_Callback(hObject, eventdata, handles)
% hObject handle to samspace (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of samspace as text
% str2double(get(hObject,'String')) returns contents of samspace as a double
samspace = str2double(get(hObject, 'String'));
if isnan(samspace)
set(hObject, 'String', 100);
errordlg('Input must be a number','Error');
end
data = getappdata(gcbf, 'metricdata');
data.samspace = samspace;
setappdata(gcbf, 'metricdata', data);
% --- Executes during object creation, after setting all properties. function samspace_CreateFcn(hObject, eventdata, handles)
% hObject handle to samspace (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
usewhitebg = 1;
if usewhitebg
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')) ;
end
function Lamda_Callback(hObject, eventdata, handles)
% hObject handle to Lamda (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of Lamda as text
% str2double(get(hObject,'String')) returns contents of Lamda as a double
Lamda = str2double(get(hObject, 'String'));
if isnan(Lamda)
set(hObject, 'String', 100);
errordlg('Input must be a number','Error');
end
data = getappdata(gcbf, 'metricdata');
data.Lamda = Lamda;
setappdata(gcbf, 'metricdata', data);
% --- Executes during object creation, after setting all properties. function Lamda_CreateFcn(hObject, eventdata, handles)
% hObject handle to Lamda (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
usewhitebg = 1;
if usewhitebg
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')) ;
end
function Da_Callback(hObject, eventdata, handles)
% hObject handle to Da (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of Da as text
% str2double(get(hObject,'String')) returns contents of Da as a double Da = str2double(get(hObject, 'String'));
if isnan(Da)
set(hObject, 'String', 100);
errordlg('Input must be a number','Error');
end
data = getappdata(gcbf, 'metricdata');
data.Da = Da;
setappdata(gcbf, 'metricdata', data);
% --- Executes during object creation, after setting all properties. function Da_CreateFcn(hObject, eventdata, handles)
% hObject handle to Da (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
usewhitebg = 1;
if usewhitebg
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')) ;
end
function Db_Callback(hObject, eventdata, handles)
% hObject handle to Db (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of Db as text
% str2double(get(hObject,'String')) returns contents of Db as a double Db = str2double(get(hObject, 'String'));
if isnan(Db)
set(hObject, 'String', 100);
errordlg('Input must be a number','Error');
end
data = getappdata(gcbf, 'metricdata');
data.Db = Db;
setappdata(gcbf, 'metricdata', data);
% --- Executes during object creation, after setting all properties. function Db_CreateFcn(hObject, eventdata, handles)
% hObject handle to Db (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB