PageRenderTime 53ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 0ms

/ATF2/FlightSim/testApps/mOTR/reference_voltages.m

http://atf2flightsim.googlecode.com/
MATLAB | 820 lines | 325 code | 187 blank | 308 comment | 53 complexity | 155df8538d3a8ced9fbf785c4d97924b MD5 | raw file
Possible License(s): BSD-2-Clause, LGPL-2.0, IPL-1.0, BSD-3-Clause
  1. function varargout = reference_voltages(varargin)
  2. % REFERENCE_VOLTAGES MATLAB code for reference_voltages.fig
  3. % REFERENCE_VOLTAGES, by itself, creates a new REFERENCE_VOLTAGES or raises the existing
  4. % singleton*.
  5. %
  6. % H = REFERENCE_VOLTAGES returns the handle to a new REFERENCE_VOLTAGES or the handle to
  7. % the existing singleton*.
  8. %
  9. % REFERENCE_VOLTAGES('CALLBACK',hObject,eventData,handles,...) calls the local
  10. % function named CALLBACK in REFERENCE_VOLTAGES.M with the given input arguments.
  11. %
  12. % REFERENCE_VOLTAGES('Property','Value',...) creates a new REFERENCE_VOLTAGES or raises the
  13. % existing singleton*. Starting from the left, property value pairs are
  14. % applied to the GUI before reference_voltages_OpeningFcn gets called. An
  15. % unrecognized property name or invalid value makes property application
  16. % stop. All inputs are passed to reference_voltages_OpeningFcn via varargin.
  17. %
  18. % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
  19. % instance to run (singleton)".
  20. %
  21. % See also: GUIDE, GUIDATA, GUIHANDLES
  22. % Edit the above text to modify the response to help reference_voltages
  23. % Last Modified by GUIDE v2.5 11-Nov-2010 20:50:39
  24. % Begin initialization code - DO NOT EDIT
  25. gui_Singleton = 1;
  26. gui_State = struct('gui_Name', mfilename, ...
  27. 'gui_Singleton', gui_Singleton, ...
  28. 'gui_OpeningFcn', @reference_voltages_OpeningFcn, ...
  29. 'gui_OutputFcn', @reference_voltages_OutputFcn, ...
  30. 'gui_LayoutFcn', [] , ...
  31. 'gui_Callback', []);
  32. if nargin && ischar(varargin{1})
  33. gui_State.gui_Callback = str2func(varargin{1});
  34. end
  35. if nargout
  36. [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
  37. else
  38. gui_mainfcn(gui_State, varargin{:});
  39. end
  40. % End initialization code - DO NOT EDIT
  41. % --- Executes just before reference_voltages is made visible.
  42. function reference_voltages_OpeningFcn(hObject, eventdata, handles, varargin)
  43. % This function has no output args, see OutputFcn.
  44. % hObject handle to figure
  45. % eventdata reserved - to be defined in a future version of MATLAB
  46. % handles structure with handles and user data (see GUIDATA)
  47. % varargin command line arguments to reference_voltages (see VARARGIN)
  48. % Choose default command line output for reference_voltages
  49. handles.output = hObject;
  50. handles.singlepanel=varargin{1};
  51. handles.rv= load('reference_voltages.dat', 'rv', '-ascii');
  52. for i=1:4
  53. for j=2:7
  54. set(handles.(sprintf('rv%d%d',i,j)),'String',num2str(handles.rv(i,j)));
  55. end
  56. end
  57. % Update handles structure
  58. guidata(hObject, handles);
  59. % UIWAIT makes reference_voltages wait for user response (see UIRESUME)
  60. % uiwait(handles.figure1);
  61. % --- Outputs from this function are returned to the command line.
  62. function varargout = reference_voltages_OutputFcn(hObject, eventdata, handles)
  63. % varargout cell array for returning output args (see VARARGOUT);
  64. % hObject handle to figure
  65. % eventdata reserved - to be defined in a future version of MATLAB
  66. % handles structure with handles and user data (see GUIDATA)
  67. % Get default command line output from handles structure
  68. varargout{1} = handles.output;
  69. function rv13_Callback(hObject, eventdata, handles)
  70. % hObject handle to rv13 (see GCBO)
  71. % eventdata reserved - to be defined in a future version of MATLAB
  72. % handles structure with handles and user data (see GUIDATA)
  73. % Hints: get(hObject,'String') returns contents of rv13 as text
  74. % str2double(get(hObject,'String')) returns contents of rv13 as a double
  75. temp = str2double(get(hObject, 'String'));
  76. if isnan(temp)
  77. set(hObject, 'String', 0);
  78. errordlg('Input must be a number','Error');
  79. end
  80. handles.rv(1,3) = temp;
  81. guidata(gcbo,handles)
  82. % --- Executes during object creation, after setting all properties.
  83. function rv13_CreateFcn(hObject, eventdata, handles)
  84. % hObject handle to rv13 (see GCBO)
  85. % eventdata reserved - to be defined in a future version of MATLAB
  86. % handles empty - handles not created until after all CreateFcns called
  87. % Hint: edit controls usually have a white background on Windows.
  88. % See ISPC and COMPUTER.
  89. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  90. set(hObject,'BackgroundColor','white');
  91. end
  92. function rv16_Callback(hObject, eventdata, handles)
  93. % hObject handle to rv16 (see GCBO)
  94. % eventdata reserved - to be defined in a future version of MATLAB
  95. % handles structure with handles and user data (see GUIDATA)
  96. % Hints: get(hObject,'String') returns contents of rv16 as text
  97. % str2double(get(hObject,'String')) returns contents of rv16 as a double
  98. temp = str2double(get(hObject, 'String'));
  99. if isnan(temp)
  100. set(hObject, 'String', 0);
  101. errordlg('Input must be a number','Error');
  102. end
  103. handles.rv(1,6) = temp;
  104. guidata(gcbo,handles)
  105. % --- Executes during object creation, after setting all properties.
  106. function rv16_CreateFcn(hObject, eventdata, handles)
  107. % hObject handle to rv16 (see GCBO)
  108. % eventdata reserved - to be defined in a future version of MATLAB
  109. % handles empty - handles not created until after all CreateFcns called
  110. % Hint: edit controls usually have a white background on Windows.
  111. % See ISPC and COMPUTER.
  112. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  113. set(hObject,'BackgroundColor','white');
  114. end
  115. function rv23_Callback(hObject, eventdata, handles)
  116. % hObject handle to rv23 (see GCBO)
  117. % eventdata reserved - to be defined in a future version of MATLAB
  118. % handles structure with handles and user data (see GUIDATA)
  119. % Hints: get(hObject,'String') returns contents of rv23 as text
  120. % str2double(get(hObject,'String')) returns contents of rv23 as a double
  121. temp = str2double(get(hObject, 'String'));
  122. if isnan(temp)
  123. set(hObject, 'String', 0);
  124. errordlg('Input must be a number','Error');
  125. end
  126. handles.rv(2,3) = temp;
  127. guidata(gcbo,handles)
  128. % --- Executes during object creation, after setting all properties.
  129. function rv23_CreateFcn(hObject, eventdata, handles)
  130. % hObject handle to rv23 (see GCBO)
  131. % eventdata reserved - to be defined in a future version of MATLAB
  132. % handles empty - handles not created until after all CreateFcns called
  133. % Hint: edit controls usually have a white background on Windows.
  134. % See ISPC and COMPUTER.
  135. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  136. set(hObject,'BackgroundColor','white');
  137. end
  138. function rv26_Callback(hObject, eventdata, handles)
  139. % hObject handle to rv26 (see GCBO)
  140. % eventdata reserved - to be defined in a future version of MATLAB
  141. % handles structure with handles and user data (see GUIDATA)
  142. % Hints: get(hObject,'String') returns contents of rv26 as text
  143. % str2double(get(hObject,'String')) returns contents of rv26 as a double
  144. temp = str2double(get(hObject, 'String'));
  145. if isnan(temp)
  146. set(hObject, 'String', 0);
  147. errordlg('Input must be a number','Error');
  148. end
  149. handles.rv(2,6) = temp;
  150. guidata(gcbo,handles)
  151. % --- Executes during object creation, after setting all properties.
  152. function rv26_CreateFcn(hObject, eventdata, handles)
  153. % hObject handle to rv26 (see GCBO)
  154. % eventdata reserved - to be defined in a future version of MATLAB
  155. % handles empty - handles not created until after all CreateFcns called
  156. % Hint: edit controls usually have a white background on Windows.
  157. % See ISPC and COMPUTER.
  158. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  159. set(hObject,'BackgroundColor','white');
  160. end
  161. function rv33_Callback(hObject, eventdata, handles)
  162. % hObject handle to rv33 (see GCBO)
  163. % eventdata reserved - to be defined in a future version of MATLAB
  164. % handles structure with handles and user data (see GUIDATA)
  165. % Hints: get(hObject,'String') returns contents of rv33 as text
  166. % str2double(get(hObject,'String')) returns contents of rv33 as a double
  167. temp = str2double(get(hObject, 'String'));
  168. if isnan(temp)
  169. set(hObject, 'String', 0);
  170. errordlg('Input must be a number','Error');
  171. end
  172. handles.rv(3,3) = temp;
  173. guidata(gcbo,handles)
  174. % --- Executes during object creation, after setting all properties.
  175. function rv33_CreateFcn(hObject, eventdata, handles)
  176. % hObject handle to rv33 (see GCBO)
  177. % eventdata reserved - to be defined in a future version of MATLAB
  178. % handles empty - handles not created until after all CreateFcns called
  179. % Hint: edit controls usually have a white background on Windows.
  180. % See ISPC and COMPUTER.
  181. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  182. set(hObject,'BackgroundColor','white');
  183. end
  184. function rv36_Callback(hObject, eventdata, handles)
  185. % hObject handle to rv36 (see GCBO)
  186. % eventdata reserved - to be defined in a future version of MATLAB
  187. % handles structure with handles and user data (see GUIDATA)
  188. % Hints: get(hObject,'String') returns contents of rv36 as text
  189. % str2double(get(hObject,'String')) returns contents of rv36 as a double
  190. temp = str2double(get(hObject, 'String'));
  191. if isnan(temp)
  192. set(hObject, 'String', 0);
  193. errordlg('Input must be a number','Error');
  194. end
  195. handles.rv(3,6) = temp;
  196. guidata(gcbo,handles)
  197. % --- Executes during object creation, after setting all properties.
  198. function rv36_CreateFcn(hObject, eventdata, handles)
  199. % hObject handle to rv36 (see GCBO)
  200. % eventdata reserved - to be defined in a future version of MATLAB
  201. % handles empty - handles not created until after all CreateFcns called
  202. % Hint: edit controls usually have a white background on Windows.
  203. % See ISPC and COMPUTER.
  204. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  205. set(hObject,'BackgroundColor','white');
  206. end
  207. function rv43_Callback(hObject, eventdata, handles)
  208. % hObject handle to rv43 (see GCBO)
  209. % eventdata reserved - to be defined in a future version of MATLAB
  210. % handles structure with handles and user data (see GUIDATA)
  211. % Hints: get(hObject,'String') returns contents of rv43 as text
  212. % str2double(get(hObject,'String')) returns contents of rv43 as a double
  213. temp = str2double(get(hObject, 'String'));
  214. if isnan(temp)
  215. set(hObject, 'String', 0);
  216. errordlg('Input must be a number','Error');
  217. end
  218. handles.rv(4,3) = temp;
  219. guidata(gcbo,handles)
  220. % --- Executes during object creation, after setting all properties.
  221. function rv43_CreateFcn(hObject, eventdata, handles)
  222. % hObject handle to rv43 (see GCBO)
  223. % eventdata reserved - to be defined in a future version of MATLAB
  224. % handles empty - handles not created until after all CreateFcns called
  225. % Hint: edit controls usually have a white background on Windows.
  226. % See ISPC and COMPUTER.
  227. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  228. set(hObject,'BackgroundColor','white');
  229. end
  230. function rv46_Callback(hObject, eventdata, handles)
  231. % hObject handle to rv46 (see GCBO)
  232. % eventdata reserved - to be defined in a future version of MATLAB
  233. % handles structure with handles and user data (see GUIDATA)
  234. % Hints: get(hObject,'String') returns contents of rv46 as text
  235. % str2double(get(hObject,'String')) returns contents of rv46 as a double
  236. temp = str2double(get(hObject, 'String'));
  237. if isnan(temp)
  238. set(hObject, 'String', 0);
  239. errordlg('Input must be a number','Error');
  240. end
  241. handles.rv(4,6) = temp;
  242. guidata(gcbo,handles)
  243. % --- Executes during object creation, after setting all properties.
  244. function rv46_CreateFcn(hObject, eventdata, handles)
  245. % hObject handle to rv46 (see GCBO)
  246. % eventdata reserved - to be defined in a future version of MATLAB
  247. % handles empty - handles not created until after all CreateFcns called
  248. % Hint: edit controls usually have a white background on Windows.
  249. % See ISPC and COMPUTER.
  250. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  251. set(hObject,'BackgroundColor','white');
  252. end
  253. function rv12_Callback(hObject, eventdata, handles)
  254. % hObject handle to rv12 (see GCBO)
  255. % eventdata reserved - to be defined in a future version of MATLAB
  256. % handles structure with handles and user data (see GUIDATA)
  257. % Hints: get(hObject,'String') returns contents of rv12 as text
  258. % str2double(get(hObject,'String')) returns contents of rv12 as a double
  259. temp = str2double(get(hObject, 'String'));
  260. if isnan(temp)
  261. set(hObject, 'String', 0);
  262. errordlg('Input must be a number','Error');
  263. end
  264. handles.rv(1,2) = temp;
  265. guidata(gcbo,handles)
  266. % --- Executes during object creation, after setting all properties.
  267. function rv12_CreateFcn(hObject, eventdata, handles)
  268. % hObject handle to rv12 (see GCBO)
  269. % eventdata reserved - to be defined in a future version of MATLAB
  270. % handles empty - handles not created until after all CreateFcns called
  271. % Hint: edit controls usually have a white background on Windows.
  272. % See ISPC and COMPUTER.
  273. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  274. set(hObject,'BackgroundColor','white');
  275. end
  276. function rv15_Callback(hObject, eventdata, handles)
  277. % hObject handle to rv15 (see GCBO)
  278. % eventdata reserved - to be defined in a future version of MATLAB
  279. % handles structure with handles and user data (see GUIDATA)
  280. % Hints: get(hObject,'String') returns contents of rv15 as text
  281. % str2double(get(hObject,'String')) returns contents of rv15 as a double
  282. temp = str2double(get(hObject, 'String'));
  283. if isnan(temp)
  284. set(hObject, 'String', 0);
  285. errordlg('Input must be a number','Error');
  286. end
  287. handles.rv(1,5) = temp;
  288. guidata(gcbo,handles)
  289. % --- Executes during object creation, after setting all properties.
  290. function rv15_CreateFcn(hObject, eventdata, handles)
  291. % hObject handle to rv15 (see GCBO)
  292. % eventdata reserved - to be defined in a future version of MATLAB
  293. % handles empty - handles not created until after all CreateFcns called
  294. % Hint: edit controls usually have a white background on Windows.
  295. % See ISPC and COMPUTER.
  296. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  297. set(hObject,'BackgroundColor','white');
  298. end
  299. function rv22_Callback(hObject, eventdata, handles)
  300. % hObject handle to rv22 (see GCBO)
  301. % eventdata reserved - to be defined in a future version of MATLAB
  302. % handles structure with handles and user data (see GUIDATA)
  303. % Hints: get(hObject,'String') returns contents of rv22 as text
  304. % str2double(get(hObject,'String')) returns contents of rv22 as a double
  305. temp = str2double(get(hObject, 'String'));
  306. if isnan(temp)
  307. set(hObject, 'String', 0);
  308. errordlg('Input must be a number','Error');
  309. end
  310. handles.rv(2,2) = temp;
  311. guidata(gcbo,handles)
  312. % --- Executes during object creation, after setting all properties.
  313. function rv22_CreateFcn(hObject, eventdata, handles)
  314. % hObject handle to rv22 (see GCBO)
  315. % eventdata reserved - to be defined in a future version of MATLAB
  316. % handles empty - handles not created until after all CreateFcns called
  317. % Hint: edit controls usually have a white background on Windows.
  318. % See ISPC and COMPUTER.
  319. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  320. set(hObject,'BackgroundColor','white');
  321. end
  322. function rv25_Callback(hObject, eventdata, handles)
  323. % hObject handle to rv25 (see GCBO)
  324. % eventdata reserved - to be defined in a future version of MATLAB
  325. % handles structure with handles and user data (see GUIDATA)
  326. % Hints: get(hObject,'String') returns contents of rv25 as text
  327. % str2double(get(hObject,'String')) returns contents of rv25 as a double
  328. temp = str2double(get(hObject, 'String'));
  329. if isnan(temp)
  330. set(hObject, 'String', 0);
  331. errordlg('Input must be a number','Error');
  332. end
  333. handles.rv(2,5) = temp;
  334. guidata(gcbo,handles)
  335. % --- Executes during object creation, after setting all properties.
  336. function rv25_CreateFcn(hObject, eventdata, handles)
  337. % hObject handle to rv25 (see GCBO)
  338. % eventdata reserved - to be defined in a future version of MATLAB
  339. % handles empty - handles not created until after all CreateFcns called
  340. % Hint: edit controls usually have a white background on Windows.
  341. % See ISPC and COMPUTER.
  342. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  343. set(hObject,'BackgroundColor','white');
  344. end
  345. function rv32_Callback(hObject, eventdata, handles)
  346. % hObject handle to rv32 (see GCBO)
  347. % eventdata reserved - to be defined in a future version of MATLAB
  348. % handles structure with handles and user data (see GUIDATA)
  349. % Hints: get(hObject,'String') returns contents of rv32 as text
  350. % str2double(get(hObject,'String')) returns contents of rv32 as a double
  351. temp = str2double(get(hObject, 'String'));
  352. if isnan(temp)
  353. set(hObject, 'String', 0);
  354. errordlg('Input must be a number','Error');
  355. end
  356. handles.rv(3,2) = temp;
  357. guidata(gcbo,handles)
  358. % --- Executes during object creation, after setting all properties.
  359. function rv32_CreateFcn(hObject, eventdata, handles)
  360. % hObject handle to rv32 (see GCBO)
  361. % eventdata reserved - to be defined in a future version of MATLAB
  362. % handles empty - handles not created until after all CreateFcns called
  363. % Hint: edit controls usually have a white background on Windows.
  364. % See ISPC and COMPUTER.
  365. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  366. set(hObject,'BackgroundColor','white');
  367. end
  368. function rv35_Callback(hObject, eventdata, handles)
  369. % hObject handle to rv35 (see GCBO)
  370. % eventdata reserved - to be defined in a future version of MATLAB
  371. % handles structure with handles and user data (see GUIDATA)
  372. % Hints: get(hObject,'String') returns contents of rv35 as text
  373. % str2double(get(hObject,'String')) returns contents of rv35 as a double
  374. temp = str2double(get(hObject, 'String'));
  375. if isnan(temp)
  376. set(hObject, 'String', 0);
  377. errordlg('Input must be a number','Error');
  378. end
  379. handles.rv(3,5) = temp;
  380. guidata(gcbo,handles)
  381. % --- Executes during object creation, after setting all properties.
  382. function rv35_CreateFcn(hObject, eventdata, handles)
  383. % hObject handle to rv35 (see GCBO)
  384. % eventdata reserved - to be defined in a future version of MATLAB
  385. % handles empty - handles not created until after all CreateFcns called
  386. % Hint: edit controls usually have a white background on Windows.
  387. % See ISPC and COMPUTER.
  388. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  389. set(hObject,'BackgroundColor','white');
  390. end
  391. function rv42_Callback(hObject, eventdata, handles)
  392. % hObject handle to rv42 (see GCBO)
  393. % eventdata reserved - to be defined in a future version of MATLAB
  394. % handles structure with handles and user data (see GUIDATA)
  395. % Hints: get(hObject,'String') returns contents of rv42 as text
  396. % str2double(get(hObject,'String')) returns contents of rv42 as a double
  397. temp = str2double(get(hObject, 'String'));
  398. if isnan(temp)
  399. set(hObject, 'String', 0);
  400. errordlg('Input must be a number','Error');
  401. end
  402. handles.rv(4,2) = temp;
  403. guidata(gcbo,handles)
  404. % --- Executes during object creation, after setting all properties.
  405. function rv42_CreateFcn(hObject, eventdata, handles)
  406. % hObject handle to rv42 (see GCBO)
  407. % eventdata reserved - to be defined in a future version of MATLAB
  408. % handles empty - handles not created until after all CreateFcns called
  409. % Hint: edit controls usually have a white background on Windows.
  410. % See ISPC and COMPUTER.
  411. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  412. set(hObject,'BackgroundColor','white');
  413. end
  414. function rv45_Callback(hObject, eventdata, handles)
  415. % hObject handle to rv45 (see GCBO)
  416. % eventdata reserved - to be defined in a future version of MATLAB
  417. % handles structure with handles and user data (see GUIDATA)
  418. % Hints: get(hObject,'String') returns contents of rv45 as text
  419. % str2double(get(hObject,'String')) returns contents of rv45 as a double
  420. temp = str2double(get(hObject, 'String'));
  421. if isnan(temp)
  422. set(hObject, 'String', 0);
  423. errordlg('Input must be a number','Error');
  424. end
  425. handles.rv(4,5) = temp;
  426. guidata(gcbo,handles)
  427. % --- Executes during object creation, after setting all properties.
  428. function rv45_CreateFcn(hObject, eventdata, handles)
  429. % hObject handle to rv45 (see GCBO)
  430. % eventdata reserved - to be defined in a future version of MATLAB
  431. % handles empty - handles not created until after all CreateFcns called
  432. % Hint: edit controls usually have a white background on Windows.
  433. % See ISPC and COMPUTER.
  434. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  435. set(hObject,'BackgroundColor','white');
  436. end
  437. function rv14_Callback(hObject, eventdata, handles)
  438. % hObject handle to rv14 (see GCBO)
  439. % eventdata reserved - to be defined in a future version of MATLAB
  440. % handles structure with handles and user data (see GUIDATA)
  441. % Hints: get(hObject,'String') returns contents of rv14 as text
  442. % str2double(get(hObject,'String')) returns contents of rv14 as a double
  443. temp = str2double(get(hObject, 'String'));
  444. if isnan(temp)
  445. set(hObject, 'String', 0);
  446. errordlg('Input must be a number','Error');
  447. end
  448. handles.rv(1,4) = temp;
  449. guidata(gcbo,handles)
  450. % --- Executes during object creation, after setting all properties.
  451. function rv14_CreateFcn(hObject, eventdata, handles)
  452. % hObject handle to rv14 (see GCBO)
  453. % eventdata reserved - to be defined in a future version of MATLAB
  454. % handles empty - handles not created until after all CreateFcns called
  455. % Hint: edit controls usually have a white background on Windows.
  456. % See ISPC and COMPUTER.
  457. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  458. set(hObject,'BackgroundColor','white');
  459. end
  460. function rv17_Callback(hObject, eventdata, handles)
  461. % hObject handle to rv17 (see GCBO)
  462. % eventdata reserved - to be defined in a future version of MATLAB
  463. % handles structure with handles and user data (see GUIDATA)
  464. % Hints: get(hObject,'String') returns contents of rv17 as text
  465. % str2double(get(hObject,'String')) returns contents of rv17 as a double
  466. temp = str2double(get(hObject, 'String'));
  467. if isnan(temp)
  468. set(hObject, 'String', 0);
  469. errordlg('Input must be a number','Error');
  470. end
  471. handles.rv(1,7) = temp;
  472. guidata(gcbo,handles)
  473. % --- Executes during object creation, after setting all properties.
  474. function rv17_CreateFcn(hObject, eventdata, handles)
  475. % hObject handle to rv17 (see GCBO)
  476. % eventdata reserved - to be defined in a future version of MATLAB
  477. % handles empty - handles not created until after all CreateFcns called
  478. % Hint: edit controls usually have a white background on Windows.
  479. % See ISPC and COMPUTER.
  480. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  481. set(hObject,'BackgroundColor','white');
  482. end
  483. function rv24_Callback(hObject, eventdata, handles)
  484. % hObject handle to rv24 (see GCBO)
  485. % eventdata reserved - to be defined in a future version of MATLAB
  486. % handles structure with handles and user data (see GUIDATA)
  487. % Hints: get(hObject,'String') returns contents of rv24 as text
  488. % str2double(get(hObject,'String')) returns contents of rv24 as a double
  489. temp = str2double(get(hObject, 'String'));
  490. if isnan(temp)
  491. set(hObject, 'String', 0);
  492. errordlg('Input must be a number','Error');
  493. end
  494. handles.rv(2,4) = temp;
  495. guidata(gcbo,handles)
  496. % --- Executes during object creation, after setting all properties.
  497. function rv24_CreateFcn(hObject, eventdata, handles)
  498. % hObject handle to rv24 (see GCBO)
  499. % eventdata reserved - to be defined in a future version of MATLAB
  500. % handles empty - handles not created until after all CreateFcns called
  501. % Hint: edit controls usually have a white background on Windows.
  502. % See ISPC and COMPUTER.
  503. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  504. set(hObject,'BackgroundColor','white');
  505. end
  506. function rv27_Callback(hObject, eventdata, handles)
  507. % hObject handle to rv27 (see GCBO)
  508. % eventdata reserved - to be defined in a future version of MATLAB
  509. % handles structure with handles and user data (see GUIDATA)
  510. % Hints: get(hObject,'String') returns contents of rv27 as text
  511. % str2double(get(hObject,'String')) returns contents of rv27 as a double
  512. temp = str2double(get(hObject, 'String'));
  513. if isnan(temp)
  514. set(hObject, 'String', 0);
  515. errordlg('Input must be a number','Error');
  516. end
  517. handles.rv(2,7) = temp;
  518. guidata(gcbo,handles)
  519. % --- Executes during object creation, after setting all properties.
  520. function rv27_CreateFcn(hObject, eventdata, handles)
  521. % hObject handle to rv27 (see GCBO)
  522. % eventdata reserved - to be defined in a future version of MATLAB
  523. % handles empty - handles not created until after all CreateFcns called
  524. % Hint: edit controls usually have a white background on Windows.
  525. % See ISPC and COMPUTER.
  526. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  527. set(hObject,'BackgroundColor','white');
  528. end
  529. function rv34_Callback(hObject, eventdata, handles)
  530. % hObject handle to rv34 (see GCBO)
  531. % eventdata reserved - to be defined in a future version of MATLAB
  532. % handles structure with handles and user data (see GUIDATA)
  533. % Hints: get(hObject,'String') returns contents of rv34 as text
  534. % str2double(get(hObject,'String')) returns contents of rv34 as a double
  535. temp = str2double(get(hObject, 'String'));
  536. if isnan(temp)
  537. set(hObject, 'String', 0);
  538. errordlg('Input must be a number','Error');
  539. end
  540. handles.rv(3,4) = temp;
  541. guidata(gcbo,handles)
  542. % --- Executes during object creation, after setting all properties.
  543. function rv34_CreateFcn(hObject, eventdata, handles)
  544. % hObject handle to rv34 (see GCBO)
  545. % eventdata reserved - to be defined in a future version of MATLAB
  546. % handles empty - handles not created until after all CreateFcns called
  547. % Hint: edit controls usually have a white background on Windows.
  548. % See ISPC and COMPUTER.
  549. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  550. set(hObject,'BackgroundColor','white');
  551. end
  552. function rv37_Callback(hObject, eventdata, handles)
  553. % hObject handle to rv37 (see GCBO)
  554. % eventdata reserved - to be defined in a future version of MATLAB
  555. % handles structure with handles and user data (see GUIDATA)
  556. % Hints: get(hObject,'String') returns contents of rv37 as text
  557. % str2double(get(hObject,'String')) returns contents of rv37 as a double
  558. temp = str2double(get(hObject, 'String'));
  559. if isnan(temp)
  560. set(hObject, 'String', 0);
  561. errordlg('Input must be a number','Error');
  562. end
  563. handles.rv(3,7) = temp;
  564. guidata(gcbo,handles)
  565. % --- Executes during object creation, after setting all properties.
  566. function rv37_CreateFcn(hObject, eventdata, handles)
  567. % hObject handle to rv37 (see GCBO)
  568. % eventdata reserved - to be defined in a future version of MATLAB
  569. % handles empty - handles not created until after all CreateFcns called
  570. % Hint: edit controls usually have a white background on Windows.
  571. % See ISPC and COMPUTER.
  572. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  573. set(hObject,'BackgroundColor','white');
  574. end
  575. function rv44_Callback(hObject, eventdata, handles)
  576. % hObject handle to rv44 (see GCBO)
  577. % eventdata reserved - to be defined in a future version of MATLAB
  578. % handles structure with handles and user data (see GUIDATA)
  579. % Hints: get(hObject,'String') returns contents of rv44 as text
  580. % str2double(get(hObject,'String')) returns contents of rv44 as a double
  581. temp = str2double(get(hObject, 'String'));
  582. if isnan(temp)
  583. set(hObject, 'String', 0);
  584. errordlg('Input must be a number','Error');
  585. end
  586. handles.rv(4,4) = temp;
  587. guidata(gcbo,handles)
  588. % --- Executes during object creation, after setting all properties.
  589. function rv44_CreateFcn(hObject, eventdata, handles)
  590. % hObject handle to rv44 (see GCBO)
  591. % eventdata reserved - to be defined in a future version of MATLAB
  592. % handles empty - handles not created until after all CreateFcns called
  593. % Hint: edit controls usually have a white background on Windows.
  594. % See ISPC and COMPUTER.
  595. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  596. set(hObject,'BackgroundColor','white');
  597. end
  598. function rv47_Callback(hObject, eventdata, handles) %#ok<*INUSL,*DEFNU>
  599. % hObject handle to rv47 (see GCBO)
  600. % eventdata reserved - to be defined in a future version of MATLAB
  601. % handles structure with handles and user data (see GUIDATA)
  602. % Hints: get(hObject,'String') returns contents of rv47 as text
  603. % str2double(get(hObject,'String')) returns contents of rv47 as a double
  604. temp = str2double(get(hObject, 'String'));
  605. if isnan(temp)
  606. set(hObject, 'String', 0);
  607. errordlg('Input must be a number','Error');
  608. end
  609. handles.rv(4,7) = temp;
  610. guidata(gcbo,handles)
  611. % --- Executes during object creation, after setting all properties.
  612. function rv47_CreateFcn(hObject, eventdata, handles) %#ok<*INUSD>
  613. % hObject handle to rv47 (see GCBO)
  614. % eventdata reserved - to be defined in a future version of MATLAB
  615. % handles empty - handles not created until after all CreateFcns called
  616. % Hint: edit controls usually have a white background on Windows.
  617. % See ISPC and COMPUTER.
  618. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  619. set(hObject,'BackgroundColor','white');
  620. end
  621. % --- Executes when user attempts to close figure1.
  622. function figure1_CloseRequestFcn(hObject, eventdata, handles)
  623. % hObject handle to figure1 (see GCBO)
  624. % eventdata reserved - to be defined in a future version of MATLAB
  625. % handles structure with handles and user data (see GUIDATA)
  626. try
  627. rv=handles.rv;
  628. save -ASCII reference_voltages.dat rv
  629. setappdata(handles.singlepanel.single_otr_general_panel,'reference_voltages',handles.rv)
  630. delete(hObject);
  631. catch
  632. delete(hObject);
  633. end