-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathprepData_UI.m
110 lines (87 loc) · 3.77 KB
/
prepData_UI.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
% prepData
function varargout = prepData_UI(varargin)
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @prepData_UI_OpeningFcn, ...
'gui_OutputFcn', @prepData_UI_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
function prepData_UI_OpeningFcn(hObject, eventdata, handles, varargin)
handles.output = hObject;
guidata(hObject, handles);
function varargout = prepData_UI_OutputFcn(hObject, eventdata, handles)
varargout{1} = handles.output;
function checkbox1_Callback(hObject, eventdata, handles)
handles.properties.collapse = get(hObject,'Value');
guidata(hObject,handles)
function edit7_Callback(hObject, eventdata, handles)
handles.properties.minGroupSize = str2double(get(hObject,'String'));
guidata(hObject,handles)
function edit7_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit3_Callback(hObject, eventdata, handles)
handles.properties.collectionName = get(hObject,'String');
guidata(hObject,handles)
function edit3_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function checkbox2_Callback(hObject, eventdata, handles)
handles.properties.saveSet = get(hObject, 'Value');
guidata(hObject,handles)
function edit1_Callback(hObject, eventdata, handles)
file_name = get(hObject,'String');
handles.properties.file = file_name{1};
guidata(hObject,handles)
function edit1_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit4_Callback(hObject, eventdata, handles)
handles.properties.sheet = get(hObject,'String');
guidata(hObject,handles)
function edit4_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function pushbutton1_Callback(hObject, eventdata, handles)
try;
[output] = prepData_GUI_170917(handles.properties);
assignin('base', 'output', output);
catch e;
assignin('base','e',e)
disp(e)
msgbox({'Error while running prepare data module',...
' ',...
'Ensure inputs are complete'},'Error', 'Error');
end
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
file_name = uigetfile('*.xlsx','Select excel file for preparation');
try; handles.properties; catch; handles.properties = []; end;
file_name = erase(file_name, '.xlsx');
set(handles.edit1, 'String', file_name);
handles.properties.file = file_name;
guidata(hObject,handles);
% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
close all; clear all;
msgbox({'Prepare data module has been closed'}, 'Cancelled');
error('Prepare data module has been closed');
% hObject handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)