IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
uip_report_sovalues_comparison.m
Go to the documentation of this file.
1 %> @ingroup guigroup
2 %> @file
3 %> @brief Properties Window for @ref report_sovalues_comparison
5 
6 %>@cond
7 function varargout = uip_report_sovalues_comparison(varargin)
8 % Last Modified by GUIDE v2.5 12-Nov-2012 18:27:52
9 
10 % Begin initialization code - DO NOT EDIT
11 gui_Singleton = 1;
12 gui_State = struct('gui_Name', mfilename, ...
13  'gui_Singleton', gui_Singleton, ...
14  'gui_OpeningFcn', @uip_report_sovalues_comparison_OpeningFcn, ...
15  'gui_OutputFcn', @uip_report_sovalues_comparison_OutputFcn, ...
16  'gui_LayoutFcn', [] , ...
17  'gui_Callback', []);
18 if nargin && ischar(varargin{1})
19  gui_State.gui_Callback = str2func(varargin{1});
20 end
21 
22 if nargout
23  [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
24 else
25  gui_mainfcn(gui_State, varargin{:});
26 end
27 % End initialization code - DO NOT EDIT
28 
29 
30 % --- Executes just before uip_report_sovalues_comparison is made visible.
31 function uip_report_sovalues_comparison_OpeningFcn(hObject, eventdata, handles, varargin) %#ok<*INUSL>
32 if nargin > 4
33  handles.input.sovalues = varargin{2};
34 else
35  handles.input.sovalues = [];
36 end;
37 handles.output.flag_ok = 0;
38 guidata(hObject, handles);
39 gui_set_position(hObject);
40 
41 if ~isempty(handles.input.sovalues)
42  sov = handles.input.sovalues;
43  a = sov.get_numericfieldnames();
44  set(handles.popupmenu_valuesfieldname, 'string', a);
45  set(handles.edit_valuesfieldname, 'string', a{1});
46 else
47  set(handles.popupmenu_valuesfieldname, 'string', {'?'});
48 end;
49 
50 listbox_load_from_workspace('vectorcomp', handles.popupmenu_vectorcomp, 1, 'Use default');
51 
52 
53 
54 
55 % --- Outputs from this function are returned to the command clae.
56 function varargout = uip_report_sovalues_comparison_OutputFcn(hObject, eventdata, handles)
57 try
58  uiwait(handles.figure1);
59  handles = guidata(hObject);
60  varargout{1} = handles.output;
61  delete(gcf);
62 catch %#ok<*CTCH>
63  output.flag_ok = 0;
64  output.params = {};
65  varargout{1} = output;
66 end;
67 
68 
69 % --- Executes on button press in pushbuttonOk.
70 function pushbuttonOk_Callback(hObject, eventdata, handles)
71 try
72  aaa = eval(get(handles.edit_dimspec, 'String'));
73  if iscell(aaa)
74  aaa = cell2str(aaa);
75  else
76  aaa = mat2str(aaa);
77  end;
78 
79  svfn = fel(get(handles.edit_valuesfieldname, 'String'));
80  if ~isempty(handles.input.sovalues)
81  sov = handles.input.sovalues;
82  if ~any(strcmp(svfn, sov.get_numericfieldnames()));
83  irerror(sprintf('Invalid values field name: "%s"', svfn));
84  end;
85  end;
86 
87  svectorcomp = listbox_get_selected_1stname(handles.popupmenu_vectorcomp);
88  if isempty(svectorcomp)
89  svectorcomp = '[]';
90  end;
91 
92  handles.output.params = {...
93  'dimspec', aaa, ...
94  'names', ['{''', svfn, '''}'], ...
95  'maxrows', int2str(eval(get(handles.edit_maxrows, 'String'))), ...
96  'flag_ptable' , int2str(get(handles.checkbox_flag_ptable, 'Value')), ...
97  'vectorcomp', svectorcomp, ...
98  };
99  handles.output.flag_ok = 1;
100  guidata(hObject, handles);
101  uiresume();
102 catch ME
103  irerrordlg(ME.message, 'Cannot continue');
104 
105 end;
106 
107 
108 function edit_dimspec_Callback(hObject, eventdata, handles) %#ok<*INUSD,*DEFNU>
109 
110 % --- Executes during object creation, after setting all properties.
111 function edit_dimspec_CreateFcn(hObject, eventdata, handles)
112 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
113  set(hObject,'BackgroundColor','white');
114 end
115 
116 
117 
118 function edit_valuesfieldname_Callback(hObject, eventdata, handles)
119 
120 function edit_valuesfieldname_CreateFcn(hObject, eventdata, handles)
121 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
122  set(hObject,'BackgroundColor','white');
123 end
124 
125 function edit_maxrows_Callback(hObject, eventdata, handles)
126 
127 function edit_maxrows_CreateFcn(hObject, eventdata, handles)
128 
129 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
130  set(hObject,'BackgroundColor','white');
131 end
132 
133 function checkbox_flag_ptable_Callback(hObject, eventdata, handles)
134 
135 
136 %#####
137 function popupmenu_valuesfieldname_Callback(hObject, eventdata, handles)
138 contents = cellstr(get(hObject,'String'));
139 s = contents{get(hObject,'Value')};
140 if ~strcmp(s, '?')
141  set(handles.edit_valuesfieldname, 'String', s);
142 end;
143 
144 function popupmenu_valuesfieldname_CreateFcn(hObject, eventdata, handles)
145 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
146  set(hObject,'BackgroundColor','white');
147 end
148 
149 
150 
151 %> @endcond
152 
153 
154 % --- Executes on selection change in popupmenu_vectorcomp.
155 function popupmenu_vectorcomp_Callback(hObject, eventdata, handles)
156 % hObject handle to popupmenu_vectorcomp (see GCBO)
157 % eventdata reserved - to be defined in a future version of MATLAB
158 % handles structure with handles and user data (see GUIDATA)
159 
160 % Hints: contents = cellstr(get(hObject,'String')) returns popupmenu_vectorcomp contents as cell array
161 % contents{get(hObject,'Value')} returns selected item from popupmenu_vectorcomp
162 
163 
164 % --- Executes during object creation, after setting all properties.
165 function popupmenu_vectorcomp_CreateFcn(hObject, eventdata, handles)
166 % hObject handle to popupmenu_vectorcomp (see GCBO)
167 % eventdata reserved - to be defined in a future version of MATLAB
168 % handles empty - handles not created until after all CreateFcns called
169 
170 % Hint: popupmenu controls usually have a white background on Windows.
171 % See ISPC and COMPUTER.
172 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
173  set(hObject,'BackgroundColor','white');
174 end
function cell2str(in c)
function irerror(in s)
Comparison and p-values tables.
function listbox_get_selected_1stname(in h_listbox)
function fel(in c, in n)
function listbox_load_from_workspace(in classname, in h_list, in flag_blank, in string_empty, in input)
function gui_set_position(in hObject)
Paired Vector Comparer base class.
Definition: vectorcomp.m:9