function varargout = showGUI(varargin)
% SHOWGUI MATLAB code for showGUI.fig
% SHOWGUI, by itself, creates a new SHOWGUI or raises the existing
% singleton*.
%
% H = SHOWGUI returns the handle to a new SHOWGUI or the handle to
% the existing singleton*.
%
% SHOWGUI('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in SHOWGUI.M with the given input arguments.
%
% SHOWGUI('Property','Value',...) creates a new SHOWGUI or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before showGUI_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to showGUI_OpeningFcn via varargin.
%
% *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 showGUI
% Last Modified by GUIDE v2.5 08-Jun-2013 21:53:16
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @showGUI_OpeningFcn, ...
'gui_OutputFcn', @showGUI_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
function showGUI_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 command line arguments to showGUI (see VARARGIN)
% Choose default command line output for showGUI
handles.output = hObject;
guidata(hObject, handles);
% UIWAIT makes showGUI wait for user response (see UIRESUME)
% uiwait(handles.showGUI);
% --- Outputs from this function are returned to the command line.
function varargout = showGUI_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;
% --- Executes on button press in runBut.
function runBut_Callback(hObject, eventdata, handles)
% hObject handle to runBut (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
maxRunTime = 10;
current_run_no = str2double(get(handles.beginValue, 'String'));
if (get(handles.rdch, 'Value') == get(handles.rdch, 'Max'))
if runtime_number_check(handles, current_run_no) == 1
current_run_no = mod((current_run_no + 1), maxRunTime);
if current_run_no == 0
current_run_no = maxRunTime;
end
set(handles.beginValue, 'String', num2str(current_run_no));
curimno = str2double(get(handles.imgNo, 'String'));
if imgno_number_check(curimno, handles) ~= -1
gui_contents_update(handles, curimno);
end
end
else
running_testfunc(handles);
end
function rdch_Callback(hObject, eventdata, handles)
% hObject handle to rdch (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
if (get(hObject, 'Value') == get(hObject, 'Max'))
set(hObject, 'String', 'show test results');
else
set(hObject,'String', 'show maps results');
end
current_no = str2double(get(handles.imgNo,'String'));
if imgno_number_check(current_no, handles) == -1
return;
else
gui_contents_update(handles, current_no);
end
guidata(hObject, handles);
function beginValue_Callback(hObject, eventdata, handles)
% hObject handle to beginValue (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
current_no = str2double(get(handles.imgNo,'String'));
if imgno_number_check(current_no, handles) == -1
return;
elseif get(handles.rdch, 'Value') == get(handles.rdch, 'Max')
gui_contents_update(handles, current_no);
end
guidata(hObject, handles);
function beginValue_CreateFcn(hObject, eventdata, handles)
% hObject handle to beginValue (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function endValue_Callback(hObject, eventdata, handles)
% hObject handle to endValue (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
function endValue_CreateFcn(hObject, eventdata, handles)
% hObject handle to endValue (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function sliderImageNo_Callback(hObject, eventdata, handles)
% hObject handle to sliderImageNo (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
current = get(hObject,'Value');
current = floor(current);
set(handles.imgNo, 'String', num2str(current));
gui_contents_update(handles, current);
guidata(hObject, handles);
% --- Executes during object creation, after setting all properties.
function sliderImageNo_CreateFcn(hObject, eventdata, handles)
% hObject handle to sliderImageNo (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor',[.9 .9 .9]);
end
set(hObject, 'Max', handles.sliderImageNo.maxValue);
set(hObject, 'Min', handles.sliderImageNo.minValue);
step = 1/(handles.sliderImageNo.maxValue - handles.sliderImageNo.minValue);
set(hObject, 'SliderStep', [step, 0.1]);
initValue = handles.sliderImageNo.maxValue + ...
handles.sliderImageNo.minValue;
initValue = floor(initValue/2);
set(hObject, 'value', initValue);
guidata(hObject, handles);
function imgNo_Callback(hObject, eventdata, handles)
% hObject handle to imgNo (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
current_no = str2double(get(hObject,'String'));
if imgno_number_check(current_no, handles) == -1
return;
else
gui_contents_update(handles, current_no);
end
guidata(hObject, handles);
% --- Executes during object creation, after setting all properties.
function imgNo_CreateFcn(hObject, eventdata, handles)
% hObject handle to imgNo (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - hand
- 1
- 2
- 3
- 4
- 5
- 6
前往页