/ATF2/FlightSim/testApps/mOTR/cal_settings.m

http://atf2flightsim.googlecode.com/ · MATLAB · 722 lines · 429 code · 157 blank · 136 comment · 69 complexity · 69189684db8f983e1900168e0b1f51e9 MD5 · raw file

  1. function varargout = cal_settings(varargin)
  2. % CAL_SETTINGS M-file for cal_settings.fig
  3. % CAL_SETTINGS, by itself, creates a new CAL_SETTINGS or raises the existing
  4. % singleton*.
  5. %
  6. % H = CAL_SETTINGS returns the handle to a new CAL_SETTINGS or the handle to
  7. % the existing singleton*.
  8. %
  9. % CAL_SETTINGS('CALLBACK',hObject,eventData,handles,...) calls the local
  10. % function named CALLBACK in CAL_SETTINGS.M with the given input arguments.
  11. %
  12. % CAL_SETTINGS('Property','Value',...) creates a new CAL_SETTINGS or raises the
  13. % existing singleton*. Starting from the left, property value pairs are
  14. % applied to the GUI before cal_settings_OpeningFcn gets called. An
  15. % unrecognized property name or invalid value makes property application
  16. % stop. All inputs are passed to cal_settings_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 cal_settings
  23. % Last Modified by GUIDE v2.5 08-Nov-2011 16:03: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', @cal_settings_OpeningFcn, ...
  29. 'gui_OutputFcn', @cal_settings_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 cal_settings is made visible.
  42. function cal_settings_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 cal_settings (see VARARGIN)
  48. % Choose default command line output for cal_settings
  49. handles.output = hObject;
  50. handles.single_otr_general_panel = varargin{2};
  51. handles.cal = load('cal.set', 'calibration', '-ascii');
  52. otr_numb=varargin{1};
  53. %Before it made only changeable the 'parent'OTR: [better the possibility to change all
  54. for i=1:4
  55. for j=2:8
  56. set(handles.(sprintf('cal_%d_%d',i,j)),'String',num2str(handles.cal(i,j)));
  57. %Before it made only changeable the 'parent'OTR: [better the possibility to change all
  58. %set(handles.(sprintf('cal_%d_%d',i,j)),'Enable','off')
  59. end
  60. end
  61. % X cal settings
  62. try
  63. set(handles.edit29,'String',num2str(handles.cal(1,9)))
  64. set(handles.edit30,'String',num2str(handles.cal(2,9)))
  65. set(handles.edit31,'String',num2str(handles.cal(3,9)))
  66. set(handles.edit32,'String',num2str(handles.cal(4,9)))
  67. catch
  68. set(handles.edit29,'String','0.5')
  69. set(handles.edit30,'String','0.5')
  70. set(handles.edit31,'String','0.5')
  71. set(handles.edit32,'String','0.5')
  72. end
  73. % Update handles structure
  74. guidata(hObject, handles);
  75. % UIWAIT makes cal_settings wait for user response (see UIRESUME)
  76. % uiwait(handles.figure1);
  77. % --- Outputs from this function are returned to the command line.
  78. function varargout = cal_settings_OutputFcn(hObject, eventdata, handles) %#ok<*INUSL>
  79. % varargout cell array for returning output args (see VARARGOUT);
  80. % hObject handle to figure
  81. % eventdata reserved - to be defined in a future version of MATLAB
  82. % handles structure with handles and user data (see GUIDATA)
  83. % Get default command line output from handles structure
  84. varargout{1} = handles.output;
  85. function cal_1_2_Callback(hObject, eventdata, handles) %#ok<*DEFNU>
  86. temp = str2double(get(hObject, 'String'));
  87. if isnan(temp)
  88. set(hObject, 'String', 0);
  89. errordlg('Input must be a number','Error');
  90. end
  91. handles.cal(1,2) = temp;
  92. guidata(gcbo,handles)
  93. function cal_1_2_CreateFcn(hObject, eventdata, handles)
  94. % Hint: edit controls usually have a white background on Windows.
  95. % See ISPC and COMPUTER.
  96. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  97. set(hObject,'BackgroundColor','white');
  98. end
  99. function cal_1_3_Callback(hObject, eventdata, handles)
  100. temp = str2double(get(hObject, 'String'));
  101. if isnan(temp)
  102. set(hObject, 'String', 0);
  103. errordlg('Input must be a number','Error');
  104. end
  105. handles.cal(1,3) = temp;
  106. guidata(gcbo,handles)
  107. function cal_1_3_CreateFcn(hObject, eventdata, handles)
  108. % Hint: edit controls usually have a white background on Windows.
  109. % See ISPC and COMPUTER.
  110. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  111. set(hObject,'BackgroundColor','white');
  112. end
  113. function cal_1_4_Callback(hObject, eventdata, handles)
  114. temp = str2double(get(hObject, 'String'));
  115. if isnan(temp)
  116. set(hObject, 'String', 0);
  117. errordlg('Input must be a number','Error');
  118. end
  119. handles.cal(1,4) = temp;
  120. guidata(gcbo,handles)
  121. function cal_1_4_CreateFcn(hObject, eventdata, handles)
  122. % Hint: edit controls usually have a white background on Windows.
  123. % See ISPC and COMPUTER.
  124. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  125. set(hObject,'BackgroundColor','white');
  126. end
  127. function cal_1_5_Callback(hObject, eventdata, handles)
  128. temp = str2double(get(hObject, 'String'));
  129. if isnan(temp)
  130. set(hObject, 'String', 0);
  131. errordlg('Input must be a number','Error');
  132. end
  133. handles.cal(1,5) = temp;
  134. guidata(gcbo,handles)
  135. function cal_1_5_CreateFcn(hObject, eventdata, handles)
  136. % Hint: edit controls usually have a white background on Windows.
  137. % See ISPC and COMPUTER.
  138. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  139. set(hObject,'BackgroundColor','white');
  140. end
  141. function cal_1_6_Callback(hObject, eventdata, handles)
  142. temp = str2double(get(hObject, 'String'));
  143. if isnan(temp)
  144. set(hObject, 'String', 0);
  145. errordlg('Input must be a number','Error');
  146. end
  147. handles.cal(1,6) = temp;
  148. guidata(gcbo,handles)
  149. function cal_1_6_CreateFcn(hObject, eventdata, handles)
  150. % Hint: edit controls usually have a white background on Windows.
  151. % See ISPC and COMPUTER.
  152. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  153. set(hObject,'BackgroundColor','white');
  154. end
  155. function cal_1_7_Callback(hObject, eventdata, handles)
  156. temp = str2double(get(hObject, 'String'));
  157. if isnan(temp)
  158. set(hObject, 'String', 0);
  159. errordlg('Input must be a number','Error');
  160. end
  161. handles.cal(1,7) = temp;
  162. guidata(gcbo,handles)
  163. function cal_1_7_CreateFcn(hObject, eventdata, handles)
  164. % Hint: edit controls usually have a white background on Windows.
  165. % See ISPC and COMPUTER.
  166. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  167. set(hObject,'BackgroundColor','white');
  168. end
  169. function cal_1_8_Callback(hObject, eventdata, handles)
  170. temp = str2double(get(hObject, 'String'));
  171. if isnan(temp)
  172. set(hObject, 'String', 0);
  173. errordlg('Input must be a number','Error');
  174. end
  175. handles.cal(1,8) = temp;
  176. guidata(gcbo,handles)
  177. function cal_1_8_CreateFcn(hObject, eventdata, handles)
  178. % Hint: edit controls usually have a white background on Windows.
  179. % See ISPC and COMPUTER.
  180. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  181. set(hObject,'BackgroundColor','white');
  182. end
  183. function cal_2_2_Callback(hObject, eventdata, handles)
  184. temp = str2double(get(hObject, 'String'));
  185. if isnan(temp)
  186. set(hObject, 'String', 0);
  187. errordlg('Input must be a number','Error');
  188. end
  189. handles.cal(2,2) = temp;
  190. guidata(gcbo,handles)
  191. function cal_2_2_CreateFcn(hObject, eventdata, handles)
  192. % Hint: edit controls usually have a white background on Windows.
  193. % See ISPC and COMPUTER.
  194. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  195. set(hObject,'BackgroundColor','white');
  196. end
  197. function cal_2_3_Callback(hObject, eventdata, handles)
  198. temp = str2double(get(hObject, 'String'));
  199. if isnan(temp)
  200. set(hObject, 'String', 0);
  201. errordlg('Input must be a number','Error');
  202. end
  203. handles.cal(2,3) = temp;
  204. guidata(gcbo,handles)
  205. function cal_2_3_CreateFcn(hObject, eventdata, handles)
  206. % Hint: edit controls usually have a white background on Windows.
  207. % See ISPC and COMPUTER.
  208. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  209. set(hObject,'BackgroundColor','white');
  210. end
  211. function cal_2_4_Callback(hObject, eventdata, handles)
  212. temp = str2double(get(hObject, 'String'));
  213. if isnan(temp)
  214. set(hObject, 'String', 0);
  215. errordlg('Input must be a number','Error');
  216. end
  217. handles.cal(2,4) = temp;
  218. guidata(gcbo,handles)
  219. function cal_2_4_CreateFcn(hObject, eventdata, handles)
  220. % Hint: edit controls usually have a white background on Windows.
  221. % See ISPC and COMPUTER.
  222. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  223. set(hObject,'BackgroundColor','white');
  224. end
  225. function cal_2_5_Callback(hObject, eventdata, handles)
  226. temp = str2double(get(hObject, 'String'));
  227. if isnan(temp)
  228. set(hObject, 'String', 0);
  229. errordlg('Input must be a number','Error');
  230. end
  231. handles.cal(2,5) = temp;
  232. guidata(gcbo,handles)
  233. function cal_2_5_CreateFcn(hObject, eventdata, handles)
  234. % Hint: edit controls usually have a white background on Windows.
  235. % See ISPC and COMPUTER.
  236. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  237. set(hObject,'BackgroundColor','white');
  238. end
  239. function cal_2_6_Callback(hObject, eventdata, handles)
  240. temp = str2double(get(hObject, 'String'));
  241. if isnan(temp)
  242. set(hObject, 'String', 0);
  243. errordlg('Input must be a number','Error');
  244. end
  245. handles.cal(2,6) = temp;
  246. guidata(gcbo,handles)
  247. function cal_2_6_CreateFcn(hObject, eventdata, handles)
  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 cal_2_7_Callback(hObject, eventdata, handles)
  254. temp = str2double(get(hObject, 'String'));
  255. if isnan(temp)
  256. set(hObject, 'String', 0);
  257. errordlg('Input must be a number','Error');
  258. end
  259. handles.cal(2,7) = temp;
  260. guidata(gcbo,handles)
  261. function cal_2_7_CreateFcn(hObject, eventdata, handles)
  262. % Hint: edit controls usually have a white background on Windows.
  263. % See ISPC and COMPUTER.
  264. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  265. set(hObject,'BackgroundColor','white');
  266. end
  267. function cal_2_8_Callback(hObject, eventdata, handles)
  268. temp = str2double(get(hObject, 'String'));
  269. if isnan(temp)
  270. set(hObject, 'String', 0);
  271. errordlg('Input must be a number','Error');
  272. end
  273. handles.cal(2,8) = temp;
  274. guidata(gcbo,handles)
  275. function cal_2_8_CreateFcn(hObject, eventdata, handles)
  276. % Hint: edit controls usually have a white background on Windows.
  277. % See ISPC and COMPUTER.
  278. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  279. set(hObject,'BackgroundColor','white');
  280. end
  281. function cal_3_2_Callback(hObject, eventdata, handles)
  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.cal(3,2) = temp;
  288. guidata(gcbo,handles)
  289. function cal_3_2_CreateFcn(hObject, eventdata, handles)
  290. % Hint: edit controls usually have a white background on Windows.
  291. % See ISPC and COMPUTER.
  292. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  293. set(hObject,'BackgroundColor','white');
  294. end
  295. function cal_3_3_Callback(hObject, eventdata, handles)
  296. temp = str2double(get(hObject, 'String'));
  297. if isnan(temp)
  298. set(hObject, 'String', 0);
  299. errordlg('Input must be a number','Error');
  300. end
  301. handles.cal(3,3) = temp;
  302. guidata(gcbo,handles)
  303. function cal_3_3_CreateFcn(hObject, eventdata, handles)
  304. % Hint: edit controls usually have a white background on Windows.
  305. % See ISPC and COMPUTER.
  306. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  307. set(hObject,'BackgroundColor','white');
  308. end
  309. function cal_3_4_Callback(hObject, eventdata, handles)
  310. temp = str2double(get(hObject, 'String'));
  311. if isnan(temp)
  312. set(hObject, 'String', 0);
  313. errordlg('Input must be a number','Error');
  314. end
  315. handles.cal(3,4) = temp;
  316. guidata(gcbo,handles)
  317. function cal_3_4_CreateFcn(hObject, eventdata, handles)
  318. % Hint: edit controls usually have a white background on Windows.
  319. % See ISPC and COMPUTER.
  320. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  321. set(hObject,'BackgroundColor','white');
  322. end
  323. function cal_3_5_Callback(hObject, eventdata, handles)
  324. temp = str2double(get(hObject, 'String'));
  325. if isnan(temp)
  326. set(hObject, 'String', 0);
  327. errordlg('Input must be a number','Error');
  328. end
  329. handles.cal(3,5) = temp;
  330. guidata(gcbo,handles)
  331. function cal_3_5_CreateFcn(hObject, eventdata, handles)
  332. % Hint: edit controls usually have a white background on Windows.
  333. % See ISPC and COMPUTER.
  334. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  335. set(hObject,'BackgroundColor','white');
  336. end
  337. function cal_3_6_Callback(hObject, eventdata, handles)
  338. temp = str2double(get(hObject, 'String'));
  339. if isnan(temp)
  340. set(hObject, 'String', 0);
  341. errordlg('Input must be a number','Error');
  342. end
  343. handles.cal(3,6) = temp;
  344. guidata(gcbo,handles)
  345. function cal_3_6_CreateFcn(hObject, eventdata, handles)
  346. % Hint: edit controls usually have a white background on Windows.
  347. % See ISPC and COMPUTER.
  348. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  349. set(hObject,'BackgroundColor','white');
  350. end
  351. function cal_3_7_Callback(hObject, eventdata, handles)
  352. temp = str2double(get(hObject, 'String'));
  353. if isnan(temp)
  354. set(hObject, 'String', 0);
  355. errordlg('Input must be a number','Error');
  356. end
  357. handles.cal(3,7) = temp;
  358. guidata(gcbo,handles)
  359. function cal_3_7_CreateFcn(hObject, eventdata, handles)
  360. % Hint: edit controls usually have a white background on Windows.
  361. % See ISPC and COMPUTER.
  362. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  363. set(hObject,'BackgroundColor','white');
  364. end
  365. function cal_3_8_Callback(hObject, eventdata, handles)
  366. temp = str2double(get(hObject, 'String'));
  367. if isnan(temp)
  368. set(hObject, 'String', 0);
  369. errordlg('Input must be a number','Error');
  370. end
  371. handles.cal(3,8) = temp;
  372. guidata(gcbo,handles)
  373. function cal_3_8_CreateFcn(hObject, eventdata, handles)
  374. % Hint: edit controls usually have a white background on Windows.
  375. % See ISPC and COMPUTER.
  376. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  377. set(hObject,'BackgroundColor','white');
  378. end
  379. function cal_4_2_Callback(hObject, eventdata, handles)
  380. temp = str2double(get(hObject, 'String'));
  381. if isnan(temp)
  382. set(hObject, 'String', 0);
  383. errordlg('Input must be a number','Error');
  384. end
  385. handles.cal(4,2) = temp;
  386. guidata(gcbo,handles)
  387. function cal_4_2_CreateFcn(hObject, eventdata, handles)
  388. % Hint: edit controls usually have a white background on Windows.
  389. % See ISPC and COMPUTER.
  390. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  391. set(hObject,'BackgroundColor','white');
  392. end
  393. function cal_4_3_Callback(hObject, eventdata, handles)
  394. temp = str2double(get(hObject, 'String'));
  395. if isnan(temp)
  396. set(hObject, 'String', 0);
  397. errordlg('Input must be a number','Error');
  398. end
  399. handles.cal(4,3) = temp;
  400. guidata(gcbo,handles)
  401. function cal_4_3_CreateFcn(hObject, eventdata, handles)
  402. % Hint: edit controls usually have a white background on Windows.
  403. % See ISPC and COMPUTER.
  404. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  405. set(hObject,'BackgroundColor','white');
  406. end
  407. function cal_4_4_Callback(hObject, eventdata, handles)
  408. temp = str2double(get(hObject, 'String'));
  409. if isnan(temp)
  410. set(hObject, 'String', 0);
  411. errordlg('Input must be a number','Error');
  412. end
  413. handles.cal(4,4) = temp;
  414. guidata(gcbo,handles)
  415. function cal_4_4_CreateFcn(hObject, eventdata, handles)
  416. % Hint: edit controls usually have a white background on Windows.
  417. % See ISPC and COMPUTER.
  418. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  419. set(hObject,'BackgroundColor','white');
  420. end
  421. function cal_4_5_Callback(hObject, eventdata, handles)
  422. temp = str2double(get(hObject, 'String'));
  423. if isnan(temp)
  424. set(hObject, 'String', 0);
  425. errordlg('Input must be a number','Error');
  426. end
  427. handles.cal(4,5) = temp;
  428. guidata(gcbo,handles)
  429. function cal_4_5_CreateFcn(hObject, eventdata, handles)
  430. % Hint: edit controls usually have a white background on Windows.
  431. % See ISPC and COMPUTER.
  432. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  433. set(hObject,'BackgroundColor','white');
  434. end
  435. function cal_4_6_Callback(hObject, eventdata, handles)
  436. temp = str2double(get(hObject, 'String'));
  437. if isnan(temp)
  438. set(hObject, 'String', 0);
  439. errordlg('Input must be a number','Error');
  440. end
  441. handles.cal(4,6) = temp;
  442. guidata(gcbo,handles)
  443. function cal_4_6_CreateFcn(hObject, eventdata, handles)
  444. % Hint: edit controls usually have a white background on Windows.
  445. % See ISPC and COMPUTER.
  446. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  447. set(hObject,'BackgroundColor','white');
  448. end
  449. function cal_4_7_Callback(hObject, eventdata, handles)
  450. temp = str2double(get(hObject, 'String'));
  451. if isnan(temp)
  452. set(hObject, 'String', 0);
  453. errordlg('Input must be a number','Error');
  454. end
  455. handles.cal(4,7) = temp;
  456. guidata(gcbo,handles)
  457. function cal_4_7_CreateFcn(hObject, eventdata, handles)
  458. % Hint: edit controls usually have a white background on Windows.
  459. % See ISPC and COMPUTER.
  460. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  461. set(hObject,'BackgroundColor','white');
  462. end
  463. function cal_4_8_Callback(hObject, eventdata, handles)
  464. temp = str2double(get(hObject, 'String'));
  465. if isnan(temp)
  466. set(hObject, 'String', 0);
  467. errordlg('Input must be a number','Error');
  468. end
  469. handles.cal(4,8) = temp;
  470. guidata(gcbo,handles)
  471. function cal_4_8_CreateFcn(hObject, eventdata, handles)
  472. % Hint: edit controls usually have a white background on Windows.
  473. % See ISPC and COMPUTER.
  474. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  475. set(hObject,'BackgroundColor','white');
  476. end
  477. function figure1_CloseRequestFcn(hObject, eventdata, handles)
  478. calibration=handles.cal;
  479. save('cal.set', 'calibration', '-ascii')
  480. setappdata(handles.single_otr_general_panel,'calibration',handles.cal)
  481. delete(hObject);
  482. function edit29_Callback(hObject, eventdata, handles)
  483. % hObject handle to edit29 (see GCBO)
  484. % eventdata reserved - to be defined in a future version of MATLAB
  485. % handles structure with handles and user data (see GUIDATA)
  486. temp = str2double(get(hObject, 'String'));
  487. if isnan(temp) || temp<=0 || temp>10
  488. set(hObject, 'String', 0.5);
  489. return
  490. end
  491. handles.cal(1,9) = temp;
  492. guidata(gcbo,handles)
  493. % --- Executes during object creation, after setting all properties.
  494. function edit29_CreateFcn(hObject, eventdata, handles)
  495. % hObject handle to edit29 (see GCBO)
  496. % eventdata reserved - to be defined in a future version of MATLAB
  497. % handles empty - handles not created until after all CreateFcns called
  498. % Hint: edit controls usually have a white background on Windows.
  499. % See ISPC and COMPUTER.
  500. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  501. set(hObject,'BackgroundColor','white');
  502. end
  503. function edit30_Callback(hObject, eventdata, handles)
  504. % hObject handle to edit30 (see GCBO)
  505. % eventdata reserved - to be defined in a future version of MATLAB
  506. % handles structure with handles and user data (see GUIDATA)
  507. temp = str2double(get(hObject, 'String'));
  508. if isnan(temp) || temp<=0 || temp>10
  509. set(hObject, 'String', 0.5);
  510. return
  511. end
  512. handles.cal(2,9) = temp;
  513. guidata(gcbo,handles)
  514. % --- Executes during object creation, after setting all properties.
  515. function edit30_CreateFcn(hObject, eventdata, handles)
  516. % hObject handle to edit30 (see GCBO)
  517. % eventdata reserved - to be defined in a future version of MATLAB
  518. % handles empty - handles not created until after all CreateFcns called
  519. % Hint: edit controls usually have a white background on Windows.
  520. % See ISPC and COMPUTER.
  521. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  522. set(hObject,'BackgroundColor','white');
  523. end
  524. function edit31_Callback(hObject, eventdata, handles)
  525. % hObject handle to edit31 (see GCBO)
  526. % eventdata reserved - to be defined in a future version of MATLAB
  527. % handles structure with handles and user data (see GUIDATA)
  528. temp = str2double(get(hObject, 'String'));
  529. if isnan(temp) || temp<=0 || temp>10
  530. set(hObject, 'String', 0.5);
  531. return
  532. end
  533. handles.cal(3,9) = temp;
  534. guidata(gcbo,handles)
  535. % --- Executes during object creation, after setting all properties.
  536. function edit31_CreateFcn(hObject, eventdata, handles)
  537. % hObject handle to edit31 (see GCBO)
  538. % eventdata reserved - to be defined in a future version of MATLAB
  539. % handles empty - handles not created until after all CreateFcns called
  540. % Hint: edit controls usually have a white background on Windows.
  541. % See ISPC and COMPUTER.
  542. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  543. set(hObject,'BackgroundColor','white');
  544. end
  545. function edit32_Callback(hObject, eventdata, handles)
  546. % hObject handle to edit32 (see GCBO)
  547. % eventdata reserved - to be defined in a future version of MATLAB
  548. % handles structure with handles and user data (see GUIDATA)
  549. temp = str2double(get(hObject, 'String'));
  550. if isnan(temp) || temp<=0 || temp>10
  551. set(hObject, 'String', 0.5);
  552. return
  553. end
  554. handles.cal(4,9) = temp;
  555. guidata(gcbo,handles)
  556. % --- Executes during object creation, after setting all properties.
  557. function edit32_CreateFcn(hObject, eventdata, handles)
  558. % hObject handle to edit32 (see GCBO)
  559. % eventdata reserved - to be defined in a future version of MATLAB
  560. % handles empty - handles not created until after all CreateFcns called
  561. % Hint: edit controls usually have a white background on Windows.
  562. % See ISPC and COMPUTER.
  563. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  564. set(hObject,'BackgroundColor','white');
  565. end