PageRenderTime 43ms CodeModel.GetById 10ms RepoModel.GetById 0ms app.codeStats 0ms

/Lucretia/src/Floodland/testApps/mOTR/cal_settings.m

http://atf2flightsim.googlecode.com/
MATLAB | 601 lines | 370 code | 129 blank | 102 comment | 60 complexity | 828239f177601779a1ad5d43b5cf3f2b MD5 | raw file
Possible License(s): BSD-2-Clause, LGPL-2.0, IPL-1.0, BSD-3-Clause
  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 09-Sep-2010 13:04:07
  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. %for j=2:8
  62. % set(handles.(sprintf('cal_%d_%d',1+otr_numb,j)),'Enable','on');
  63. %end
  64. % Update handles structure
  65. guidata(hObject, handles);
  66. % UIWAIT makes cal_settings wait for user response (see UIRESUME)
  67. % uiwait(handles.figure1);
  68. % --- Outputs from this function are returned to the command line.
  69. function varargout = cal_settings_OutputFcn(hObject, eventdata, handles)
  70. % varargout cell array for returning output args (see VARARGOUT);
  71. % hObject handle to figure
  72. % eventdata reserved - to be defined in a future version of MATLAB
  73. % handles structure with handles and user data (see GUIDATA)
  74. % Get default command line output from handles structure
  75. varargout{1} = handles.output;
  76. function cal_1_2_Callback(hObject, eventdata, handles)
  77. temp = str2double(get(hObject, 'String'));
  78. if isnan(temp)
  79. set(hObject, 'String', 0);
  80. errordlg('Input must be a number','Error');
  81. end
  82. handles.cal(1,2) = temp;
  83. guidata(gcbo,handles)
  84. function cal_1_2_CreateFcn(hObject, eventdata, handles)
  85. % Hint: edit controls usually have a white background on Windows.
  86. % See ISPC and COMPUTER.
  87. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  88. set(hObject,'BackgroundColor','white');
  89. end
  90. function cal_1_3_Callback(hObject, eventdata, handles)
  91. temp = str2double(get(hObject, 'String'));
  92. if isnan(temp)
  93. set(hObject, 'String', 0);
  94. errordlg('Input must be a number','Error');
  95. end
  96. handles.cal(1,3) = temp;
  97. guidata(gcbo,handles)
  98. function cal_1_3_CreateFcn(hObject, eventdata, handles)
  99. % Hint: edit controls usually have a white background on Windows.
  100. % See ISPC and COMPUTER.
  101. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  102. set(hObject,'BackgroundColor','white');
  103. end
  104. function cal_1_4_Callback(hObject, eventdata, handles)
  105. temp = str2double(get(hObject, 'String'));
  106. if isnan(temp)
  107. set(hObject, 'String', 0);
  108. errordlg('Input must be a number','Error');
  109. end
  110. handles.cal(1,4) = temp;
  111. guidata(gcbo,handles)
  112. function cal_1_4_CreateFcn(hObject, eventdata, handles)
  113. % Hint: edit controls usually have a white background on Windows.
  114. % See ISPC and COMPUTER.
  115. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  116. set(hObject,'BackgroundColor','white');
  117. end
  118. function cal_1_5_Callback(hObject, eventdata, handles)
  119. temp = str2double(get(hObject, 'String'));
  120. if isnan(temp)
  121. set(hObject, 'String', 0);
  122. errordlg('Input must be a number','Error');
  123. end
  124. handles.cal(1,5) = temp;
  125. guidata(gcbo,handles)
  126. function cal_1_5_CreateFcn(hObject, eventdata, handles)
  127. % Hint: edit controls usually have a white background on Windows.
  128. % See ISPC and COMPUTER.
  129. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  130. set(hObject,'BackgroundColor','white');
  131. end
  132. function cal_1_6_Callback(hObject, eventdata, handles)
  133. temp = str2double(get(hObject, 'String'));
  134. if isnan(temp)
  135. set(hObject, 'String', 0);
  136. errordlg('Input must be a number','Error');
  137. end
  138. handles.cal(1,6) = temp;
  139. guidata(gcbo,handles)
  140. function cal_1_6_CreateFcn(hObject, eventdata, handles)
  141. % Hint: edit controls usually have a white background on Windows.
  142. % See ISPC and COMPUTER.
  143. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  144. set(hObject,'BackgroundColor','white');
  145. end
  146. function cal_1_7_Callback(hObject, eventdata, handles)
  147. temp = str2double(get(hObject, 'String'));
  148. if isnan(temp)
  149. set(hObject, 'String', 0);
  150. errordlg('Input must be a number','Error');
  151. end
  152. handles.cal(1,7) = temp;
  153. guidata(gcbo,handles)
  154. function cal_1_7_CreateFcn(hObject, eventdata, handles)
  155. % Hint: edit controls usually have a white background on Windows.
  156. % See ISPC and COMPUTER.
  157. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  158. set(hObject,'BackgroundColor','white');
  159. end
  160. function cal_1_8_Callback(hObject, eventdata, handles)
  161. temp = str2double(get(hObject, 'String'));
  162. if isnan(temp)
  163. set(hObject, 'String', 0);
  164. errordlg('Input must be a number','Error');
  165. end
  166. handles.cal(1,8) = temp;
  167. guidata(gcbo,handles)
  168. function cal_1_8_CreateFcn(hObject, eventdata, handles)
  169. % Hint: edit controls usually have a white background on Windows.
  170. % See ISPC and COMPUTER.
  171. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  172. set(hObject,'BackgroundColor','white');
  173. end
  174. function cal_2_2_Callback(hObject, eventdata, handles)
  175. temp = str2double(get(hObject, 'String'));
  176. if isnan(temp)
  177. set(hObject, 'String', 0);
  178. errordlg('Input must be a number','Error');
  179. end
  180. handles.cal(2,2) = temp;
  181. guidata(gcbo,handles)
  182. function cal_2_2_CreateFcn(hObject, eventdata, handles)
  183. % Hint: edit controls usually have a white background on Windows.
  184. % See ISPC and COMPUTER.
  185. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  186. set(hObject,'BackgroundColor','white');
  187. end
  188. function cal_2_3_Callback(hObject, eventdata, handles)
  189. temp = str2double(get(hObject, 'String'));
  190. if isnan(temp)
  191. set(hObject, 'String', 0);
  192. errordlg('Input must be a number','Error');
  193. end
  194. handles.cal(2,3) = temp;
  195. guidata(gcbo,handles)
  196. function cal_2_3_CreateFcn(hObject, eventdata, handles)
  197. % Hint: edit controls usually have a white background on Windows.
  198. % See ISPC and COMPUTER.
  199. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  200. set(hObject,'BackgroundColor','white');
  201. end
  202. function cal_2_4_Callback(hObject, eventdata, handles)
  203. temp = str2double(get(hObject, 'String'));
  204. if isnan(temp)
  205. set(hObject, 'String', 0);
  206. errordlg('Input must be a number','Error');
  207. end
  208. handles.cal(2,4) = temp;
  209. guidata(gcbo,handles)
  210. function cal_2_4_CreateFcn(hObject, eventdata, handles)
  211. % Hint: edit controls usually have a white background on Windows.
  212. % See ISPC and COMPUTER.
  213. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  214. set(hObject,'BackgroundColor','white');
  215. end
  216. function cal_2_5_Callback(hObject, eventdata, handles)
  217. temp = str2double(get(hObject, 'String'));
  218. if isnan(temp)
  219. set(hObject, 'String', 0);
  220. errordlg('Input must be a number','Error');
  221. end
  222. handles.cal(2,5) = temp;
  223. guidata(gcbo,handles)
  224. function cal_2_5_CreateFcn(hObject, eventdata, handles)
  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 cal_2_6_Callback(hObject, eventdata, handles)
  231. temp = str2double(get(hObject, 'String'));
  232. if isnan(temp)
  233. set(hObject, 'String', 0);
  234. errordlg('Input must be a number','Error');
  235. end
  236. handles.cal(2,6) = temp;
  237. guidata(gcbo,handles)
  238. function cal_2_6_CreateFcn(hObject, eventdata, handles)
  239. % Hint: edit controls usually have a white background on Windows.
  240. % See ISPC and COMPUTER.
  241. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  242. set(hObject,'BackgroundColor','white');
  243. end
  244. function cal_2_7_Callback(hObject, eventdata, handles)
  245. temp = str2double(get(hObject, 'String'));
  246. if isnan(temp)
  247. set(hObject, 'String', 0);
  248. errordlg('Input must be a number','Error');
  249. end
  250. handles.cal(2,7) = temp;
  251. guidata(gcbo,handles)
  252. function cal_2_7_CreateFcn(hObject, eventdata, handles)
  253. % Hint: edit controls usually have a white background on Windows.
  254. % See ISPC and COMPUTER.
  255. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  256. set(hObject,'BackgroundColor','white');
  257. end
  258. function cal_2_8_Callback(hObject, eventdata, handles)
  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.cal(2,8) = temp;
  265. guidata(gcbo,handles)
  266. function cal_2_8_CreateFcn(hObject, eventdata, handles)
  267. % Hint: edit controls usually have a white background on Windows.
  268. % See ISPC and COMPUTER.
  269. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  270. set(hObject,'BackgroundColor','white');
  271. end
  272. function cal_3_2_Callback(hObject, eventdata, handles)
  273. temp = str2double(get(hObject, 'String'));
  274. if isnan(temp)
  275. set(hObject, 'String', 0);
  276. errordlg('Input must be a number','Error');
  277. end
  278. handles.cal(3,2) = temp;
  279. guidata(gcbo,handles)
  280. function cal_3_2_CreateFcn(hObject, eventdata, handles)
  281. % Hint: edit controls usually have a white background on Windows.
  282. % See ISPC and COMPUTER.
  283. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  284. set(hObject,'BackgroundColor','white');
  285. end
  286. function cal_3_3_Callback(hObject, eventdata, handles)
  287. temp = str2double(get(hObject, 'String'));
  288. if isnan(temp)
  289. set(hObject, 'String', 0);
  290. errordlg('Input must be a number','Error');
  291. end
  292. handles.cal(3,3) = temp;
  293. guidata(gcbo,handles)
  294. function cal_3_3_CreateFcn(hObject, eventdata, handles)
  295. % Hint: edit controls usually have a white background on Windows.
  296. % See ISPC and COMPUTER.
  297. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  298. set(hObject,'BackgroundColor','white');
  299. end
  300. function cal_3_4_Callback(hObject, eventdata, handles)
  301. temp = str2double(get(hObject, 'String'));
  302. if isnan(temp)
  303. set(hObject, 'String', 0);
  304. errordlg('Input must be a number','Error');
  305. end
  306. handles.cal(3,4) = temp;
  307. guidata(gcbo,handles)
  308. function cal_3_4_CreateFcn(hObject, eventdata, handles)
  309. % Hint: edit controls usually have a white background on Windows.
  310. % See ISPC and COMPUTER.
  311. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  312. set(hObject,'BackgroundColor','white');
  313. end
  314. function cal_3_5_Callback(hObject, eventdata, handles)
  315. temp = str2double(get(hObject, 'String'));
  316. if isnan(temp)
  317. set(hObject, 'String', 0);
  318. errordlg('Input must be a number','Error');
  319. end
  320. handles.cal(3,5) = temp;
  321. guidata(gcbo,handles)
  322. function cal_3_5_CreateFcn(hObject, eventdata, handles)
  323. % Hint: edit controls usually have a white background on Windows.
  324. % See ISPC and COMPUTER.
  325. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  326. set(hObject,'BackgroundColor','white');
  327. end
  328. function cal_3_6_Callback(hObject, eventdata, handles)
  329. temp = str2double(get(hObject, 'String'));
  330. if isnan(temp)
  331. set(hObject, 'String', 0);
  332. errordlg('Input must be a number','Error');
  333. end
  334. handles.cal(3,6) = temp;
  335. guidata(gcbo,handles)
  336. function cal_3_6_CreateFcn(hObject, eventdata, handles)
  337. % Hint: edit controls usually have a white background on Windows.
  338. % See ISPC and COMPUTER.
  339. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  340. set(hObject,'BackgroundColor','white');
  341. end
  342. function cal_3_7_Callback(hObject, eventdata, handles)
  343. temp = str2double(get(hObject, 'String'));
  344. if isnan(temp)
  345. set(hObject, 'String', 0);
  346. errordlg('Input must be a number','Error');
  347. end
  348. handles.cal(3,7) = temp;
  349. guidata(gcbo,handles)
  350. function cal_3_7_CreateFcn(hObject, eventdata, handles)
  351. % Hint: edit controls usually have a white background on Windows.
  352. % See ISPC and COMPUTER.
  353. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  354. set(hObject,'BackgroundColor','white');
  355. end
  356. function cal_3_8_Callback(hObject, eventdata, handles)
  357. temp = str2double(get(hObject, 'String'));
  358. if isnan(temp)
  359. set(hObject, 'String', 0);
  360. errordlg('Input must be a number','Error');
  361. end
  362. handles.cal(3,8) = temp;
  363. guidata(gcbo,handles)
  364. function cal_3_8_CreateFcn(hObject, eventdata, handles)
  365. % Hint: edit controls usually have a white background on Windows.
  366. % See ISPC and COMPUTER.
  367. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  368. set(hObject,'BackgroundColor','white');
  369. end
  370. function cal_4_2_Callback(hObject, eventdata, handles)
  371. temp = str2double(get(hObject, 'String'));
  372. if isnan(temp)
  373. set(hObject, 'String', 0);
  374. errordlg('Input must be a number','Error');
  375. end
  376. handles.cal(4,2) = temp;
  377. guidata(gcbo,handles)
  378. function cal_4_2_CreateFcn(hObject, eventdata, handles)
  379. % Hint: edit controls usually have a white background on Windows.
  380. % See ISPC and COMPUTER.
  381. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  382. set(hObject,'BackgroundColor','white');
  383. end
  384. function cal_4_3_Callback(hObject, eventdata, handles)
  385. temp = str2double(get(hObject, 'String'));
  386. if isnan(temp)
  387. set(hObject, 'String', 0);
  388. errordlg('Input must be a number','Error');
  389. end
  390. handles.cal(4,3) = temp;
  391. guidata(gcbo,handles)
  392. function cal_4_3_CreateFcn(hObject, eventdata, handles)
  393. % Hint: edit controls usually have a white background on Windows.
  394. % See ISPC and COMPUTER.
  395. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  396. set(hObject,'BackgroundColor','white');
  397. end
  398. function cal_4_4_Callback(hObject, eventdata, handles)
  399. temp = str2double(get(hObject, 'String'));
  400. if isnan(temp)
  401. set(hObject, 'String', 0);
  402. errordlg('Input must be a number','Error');
  403. end
  404. handles.cal(4,4) = temp;
  405. guidata(gcbo,handles)
  406. function cal_4_4_CreateFcn(hObject, eventdata, handles)
  407. % Hint: edit controls usually have a white background on Windows.
  408. % See ISPC and COMPUTER.
  409. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  410. set(hObject,'BackgroundColor','white');
  411. end
  412. function cal_4_5_Callback(hObject, eventdata, handles)
  413. temp = str2double(get(hObject, 'String'));
  414. if isnan(temp)
  415. set(hObject, 'String', 0);
  416. errordlg('Input must be a number','Error');
  417. end
  418. handles.cal(4,5) = temp;
  419. guidata(gcbo,handles)
  420. function cal_4_5_CreateFcn(hObject, eventdata, handles)
  421. % Hint: edit controls usually have a white background on Windows.
  422. % See ISPC and COMPUTER.
  423. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  424. set(hObject,'BackgroundColor','white');
  425. end
  426. function cal_4_6_Callback(hObject, eventdata, handles)
  427. temp = str2double(get(hObject, 'String'));
  428. if isnan(temp)
  429. set(hObject, 'String', 0);
  430. errordlg('Input must be a number','Error');
  431. end
  432. handles.cal(4,6) = temp;
  433. guidata(gcbo,handles)
  434. function cal_4_6_CreateFcn(hObject, eventdata, handles)
  435. % Hint: edit controls usually have a white background on Windows.
  436. % See ISPC and COMPUTER.
  437. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  438. set(hObject,'BackgroundColor','white');
  439. end
  440. function cal_4_7_Callback(hObject, eventdata, handles)
  441. temp = str2double(get(hObject, 'String'));
  442. if isnan(temp)
  443. set(hObject, 'String', 0);
  444. errordlg('Input must be a number','Error');
  445. end
  446. handles.cal(4,7) = temp;
  447. guidata(gcbo,handles)
  448. function cal_4_7_CreateFcn(hObject, eventdata, handles)
  449. % Hint: edit controls usually have a white background on Windows.
  450. % See ISPC and COMPUTER.
  451. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  452. set(hObject,'BackgroundColor','white');
  453. end
  454. function cal_4_8_Callback(hObject, eventdata, handles)
  455. temp = str2double(get(hObject, 'String'));
  456. if isnan(temp)
  457. set(hObject, 'String', 0);
  458. errordlg('Input must be a number','Error');
  459. end
  460. handles.cal(4,8) = temp;
  461. guidata(gcbo,handles)
  462. function cal_4_8_CreateFcn(hObject, eventdata, handles)
  463. % Hint: edit controls usually have a white background on Windows.
  464. % See ISPC and COMPUTER.
  465. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  466. set(hObject,'BackgroundColor','white');
  467. end
  468. function figure1_CloseRequestFcn(hObject, eventdata, handles)
  469. calibration=handles.cal;
  470. save('cal.set', 'calibration', '-ascii')
  471. setappdata(handles.single_otr_general_panel,'calibration',handles.cal)
  472. delete(hObject);