ec130-antenna-config-dialog.xml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608
  1. <?xml version="1.0"?>
  2. <!-- Eurocopter EC 130 Helicopter by Heiko Schulz, Michael Habarta
  3. This file is part of FlightGear, the free flight simulator
  4. http://www.flightgear.org/
  5. Copyright (C) 2009 Heiko Schulz, Heiko.H.Schulz@gmx.net
  6. (C) 2016 Michael Habarta, mhabarta@freenet.de
  7. This program is free software; you can redistribute it and/or
  8. modify it under the terms of the GNU General Public License as
  9. published by the Free Software Foundation; either version 2 of the
  10. License, or (at your option) any later version.
  11. This program is distributed in the hope that it will be useful, but
  12. WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. General Public License for more details.
  15. -->
  16. <PropertyList>
  17. <name>Antenna_Config</name>
  18. <layout>vbox</layout>
  19. <resizable>false</resizable>
  20. <modal>false</modal>
  21. <draggable>true</draggable>
  22. <default-padding>3</default-padding>
  23. <nasal>
  24. <open>
  25. <!-- flag for open dialog -->
  26. setprop("/sim/model/ec130/antenna_dialog_active",1);
  27. <!-- init roof antenna option -->
  28. var p = getprop("/sim/model/ec130/antenna_left");
  29. setprop("/sim/model/ec130/antenna_left_flag_0",0);
  30. setprop("/sim/model/ec130/antenna_left_flag_1",0);
  31. setprop("/sim/model/ec130/antenna_left_flag_2",0);
  32. if ( p == 1 ) { setprop("/sim/model/ec130/antenna_left_flag_0",1); }
  33. if ( p == 0 ) { setprop("/sim/model/ec130/antenna_left_flag_1",1); }
  34. if ( p == 2 ) { setprop("/sim/model/ec130/antenna_left_flag_2",1); }
  35. <!-- init tail square antenna option -->
  36. var p = getprop("/sim/model/ec130/antenna_square_tail");
  37. setprop("/sim/model/ec130/antenna_square_tail_flag_0",0);
  38. setprop("/sim/model/ec130/antenna_square_tail_flag_1",0);
  39. if ( p == 1 ) { setprop("/sim/model/ec130/antenna_square_tail_flag_0",1); }
  40. if ( p == 2 ) { setprop("/sim/model/ec130/antenna_square_tail_flag_1",1); }
  41. <!-- set title -->
  42. if ( getprop("/sim/model/variant") == "1" ) {
  43. setprop("/sim/gui/dialogs/ec130/antenna/dialog/group/text/label", "EC130-B4 Antenna Setup (Alt-a)");
  44. } else {
  45. setprop("/sim/gui/dialogs/ec130/antenna/dialog/group/text/label", "H130 Antenna Setup (Alt-a)");
  46. }
  47. </open>
  48. <close># just kept for educational purposes :-)</close>
  49. </nasal>
  50. <!-- Title with Esc knob for closing -->
  51. <group>
  52. <layout>hbox</layout>
  53. <empty><stretch>1</stretch></empty>
  54. <!-- title is set through nasal script above -->
  55. <text>
  56. <label>x</label>
  57. </text>
  58. <empty><stretch>true</stretch></empty>
  59. <button>
  60. <legend></legend>
  61. <key>Esc</key>
  62. <pref-width>16</pref-width>
  63. <pref-height>16</pref-height>
  64. <binding>
  65. <command>nasal</command>
  66. <script>
  67. if ( getprop("/sim/model/ec130/config_dialog_active") ) {
  68. ec130.config_dialog.toggle();
  69. }
  70. ec130.antenna_config_dialog.toggle();
  71. setprop("/sim/model/ec130/antenna_dialog_active",0);
  72. </script>
  73. </binding>
  74. </button>
  75. </group>
  76. <hrule/>
  77. <!-- BEGIN box with 2 columns left/right -->
  78. <group>
  79. <layout>hbox</layout>
  80. <default-padding>5</default-padding>
  81. <halign>left</halign>
  82. <!-- BEGIN left column -->
  83. <group>
  84. <layout>vbox</layout>
  85. <default-padding>0</default-padding>
  86. <halign>left</halign>
  87. <group>
  88. <layout>table</layout>
  89. <default-padding>5</default-padding>
  90. <halign>left</halign>
  91. <text>
  92. <row>0</row>
  93. <col>0</col>
  94. <label> Roof:</label>
  95. <halign>left</halign>
  96. </text>
  97. <text>
  98. <row>1</row>
  99. <col>0</col>
  100. <label> Radio Antenna:</label>
  101. <halign>left</halign>
  102. </text>
  103. </group>
  104. <group>
  105. <layout>table</layout>
  106. <default-padding>5</default-padding>
  107. <halign>left</halign>
  108. <!-- only to get a gap between left border and checkbox -->
  109. <text>
  110. <row>0</row>
  111. <col>0</col>
  112. <label> </label>
  113. <halign>left</halign>
  114. </text>
  115. <radio>
  116. <row>0</row>
  117. <col>1</col>
  118. <halign>left</halign>
  119. <label> left</label>
  120. <property>sim/model/ec130/antenna_left_flag_0</property>
  121. <live>true</live>
  122. <binding>
  123. <command>dialog-apply</command>
  124. </binding>
  125. <binding>
  126. <command>nasal</command>
  127. <script>
  128. <!--
  129. setprop("sim/model/ec130/antenna_left_flag_0",0);
  130. -->
  131. setprop("sim/model/ec130/antenna_left_flag_1",0);
  132. setprop("sim/model/ec130/antenna_left_flag_2",0);
  133. setprop("sim/model/ec130/antenna_left",1);
  134. </script>
  135. </binding>
  136. </radio>
  137. <radio>
  138. <row>0</row>
  139. <col>2</col>
  140. <halign>left</halign>
  141. <label> right</label>
  142. <property>sim/model/ec130/antenna_left_flag_1</property>
  143. <live>true</live>
  144. <binding>
  145. <command>dialog-apply</command>
  146. </binding>
  147. <binding>
  148. <command>nasal</command>
  149. <script>
  150. setprop("sim/model/ec130/antenna_left_flag_0",0);
  151. <!--
  152. setprop("sim/model/ec130/antenna_left_flag_1",0);
  153. -->
  154. setprop("sim/model/ec130/antenna_left_flag_2",0);
  155. setprop("sim/model/ec130/antenna_left",0);
  156. </script>
  157. </binding>
  158. </radio>
  159. <radio>
  160. <row>0</row>
  161. <col>3</col>
  162. <halign>left</halign>
  163. <label> both</label>
  164. <property>sim/model/ec130/antenna_left_flag_2</property>
  165. <live>true</live>
  166. <binding>
  167. <command>dialog-apply</command>
  168. </binding>
  169. <binding>
  170. <command>nasal</command>
  171. <script>
  172. setprop("sim/model/ec130/antenna_left_flag_0",0);
  173. setprop("sim/model/ec130/antenna_left_flag_1",0);
  174. <!--
  175. setprop("sim/model/ec130/antenna_left_flag_2",0);
  176. -->
  177. setprop("sim/model/ec130/antenna_left",2);
  178. </script>
  179. </binding>
  180. </radio>
  181. </group>
  182. <group>
  183. <layout>table</layout>
  184. <default-padding>5</default-padding>
  185. <halign>left</halign>
  186. <!-- only to get a empty line before next -->
  187. <text>
  188. <row>1</row>
  189. <col>0</col>
  190. <label> --------------</label>
  191. <halign>left</halign>
  192. </text>
  193. </group>
  194. <group>
  195. <layout>table</layout>
  196. <default-padding>5</default-padding>
  197. <halign>left</halign>
  198. <!-- only to get a gap between left border and checkbox -->
  199. <text>
  200. <row>0</row>
  201. <col>0</col>
  202. <label> </label>
  203. <halign>left</halign>
  204. </text>
  205. <checkbox>
  206. <row>0</row>
  207. <col>1</col>
  208. <halign>left</halign>
  209. <label> VOR/GLS Antenna</label>
  210. <property>/sim/model/ec130/vor_2_roof</property>
  211. <live>true</live>
  212. <binding>
  213. <command>dialog-apply</command>
  214. </binding>
  215. </checkbox>
  216. <checkbox>
  217. <row>1</row>
  218. <col>1</col>
  219. <halign>left</halign>
  220. <label> ADF Antenna</label>
  221. <property>/sim/model/ec130/adf_roof</property>
  222. <live>true</live>
  223. <binding>
  224. <command>dialog-apply</command>
  225. </binding>
  226. </checkbox>
  227. <checkbox>
  228. <row>2</row>
  229. <col>1</col>
  230. <halign>left</halign>
  231. <label> ADF Antenna left</label>
  232. <property>/sim/model/ec130/adf_roof_l</property>
  233. <live>true</live>
  234. <binding>
  235. <command>dialog-apply</command>
  236. </binding>
  237. </checkbox>
  238. <!-- only to get a gap before next -->
  239. <text>
  240. <row>3</row>
  241. <col>0</col>
  242. <label> </label>
  243. <halign>left</halign>
  244. </text>
  245. </group>
  246. <hrule/>
  247. <group>
  248. <layout>table</layout>
  249. <default-padding>5</default-padding>
  250. <halign>left</halign>
  251. <text>
  252. <row>0</row>
  253. <col>0</col>
  254. <label> </label>
  255. <halign>left</halign>
  256. </text>
  257. <text>
  258. <row>1</row>
  259. <col>0</col>
  260. <label> Floor:</label>
  261. <halign>left</halign>
  262. </text>
  263. </group>
  264. <group>
  265. <layout>table</layout>
  266. <default-padding>5</default-padding>
  267. <halign>left</halign>
  268. <!-- only to get a gap between left border and checkbox -->
  269. <text>
  270. <row>0</row>
  271. <col>0</col>
  272. <label> </label>
  273. <halign>left</halign>
  274. </text>
  275. <checkbox>
  276. <row>0</row>
  277. <col>1</col>
  278. <halign>left</halign>
  279. <label> GPS/ADF Antenna</label>
  280. <property>/sim/model/ec130/adf_bottom</property>
  281. <live>true</live>
  282. <binding>
  283. <command>dialog-apply</command>
  284. </binding>
  285. </checkbox>
  286. <!-- only to get a gap before next -->
  287. <text>
  288. <row>1</row>
  289. <col>0</col>
  290. <label> </label>
  291. <halign>left</halign>
  292. </text>
  293. </group>
  294. <!-- END left column -->
  295. </group>
  296. <vrule/>
  297. <!-- BEGIN right column -->
  298. <group>
  299. <layout>vbox</layout>
  300. <default-padding>0</default-padding>
  301. <halign>left</halign>
  302. <group>
  303. <layout>table</layout>
  304. <default-padding>5</default-padding>
  305. <halign>left</halign>
  306. <text>
  307. <row>0</row>
  308. <col>0</col>
  309. <label> Tail Antennas:</label>
  310. <halign>left</halign>
  311. </text>
  312. </group>
  313. <group>
  314. <layout>table</layout>
  315. <default-padding>5</default-padding>
  316. <halign>left</halign>
  317. <!-- only to get a gap between left border and checkbox -->
  318. <text>
  319. <row>0</row>
  320. <col>0</col>
  321. <label> </label>
  322. <halign>left</halign>
  323. </text>
  324. <checkbox>
  325. <row>0</row>
  326. <col>1</col>
  327. <halign>left</halign>
  328. <label> Radio front</label>
  329. <property>/sim/model/ec130/antenna_tail_front</property>
  330. <live>true</live>
  331. <binding>
  332. <command>dialog-apply</command>
  333. </binding>
  334. </checkbox>
  335. <checkbox>
  336. <row>1</row>
  337. <col>1</col>
  338. <halign>left</halign>
  339. <label> V/UHF front</label>
  340. <property>/sim/model/ec130/VUHF_front</property>
  341. <live>true</live>
  342. <binding>
  343. <command>dialog-apply</command>
  344. </binding>
  345. <binding>
  346. <command>nasal</command>
  347. <script>
  348. setprop("sim/model/ec130/VUHF",0);
  349. if ( getprop("sim/model/ec130/antenna_square_tail") == 1 ) {
  350. setprop("sim/model/ec130/antenna_square_tail",0);
  351. setprop("sim/model/ec130/antenna_square_tail_flag_0",0);
  352. }
  353. </script>
  354. </binding>
  355. </checkbox>
  356. <checkbox>
  357. <row>2</row>
  358. <col>1</col>
  359. <halign>left</halign>
  360. <label> V/UHF rear</label>
  361. <property>/sim/model/ec130/VUHF</property>
  362. <live>true</live>
  363. <binding>
  364. <command>dialog-apply</command>
  365. </binding>
  366. <binding>
  367. <command>nasal</command>
  368. <script>
  369. setprop("sim/model/ec130/VUHF_front",0);
  370. setprop("sim/model/ec130/DME_small",0);
  371. </script>
  372. </binding>
  373. </checkbox>
  374. <checkbox>
  375. <row>3</row>
  376. <col>1</col>
  377. <halign>left</halign>
  378. <label> DME</label>
  379. <property>/sim/model/ec130/DME</property>
  380. <live>true</live>
  381. <binding>
  382. <command>dialog-apply</command>
  383. </binding>
  384. <binding>
  385. <command>nasal</command>
  386. <script>
  387. setprop("sim/model/ec130/DME_small",0);
  388. if ( getprop("sim/model/ec130/antenna_square_tail") == 2 ) {
  389. setprop("sim/model/ec130/VUHF",0);
  390. setprop("sim/model/ec130/antenna_square_tail",0);
  391. setprop("sim/model/ec130/antenna_square_tail_flag_1",0);
  392. }
  393. </script>
  394. </binding>
  395. </checkbox>
  396. <checkbox>
  397. <row>4</row>
  398. <col>1</col>
  399. <halign>left</halign>
  400. <label> DME small</label>
  401. <property>/sim/model/ec130/DME_small</property>
  402. <live>true</live>
  403. <binding>
  404. <command>dialog-apply</command>
  405. </binding>
  406. <binding>
  407. <command>nasal</command>
  408. <script>
  409. setprop("sim/model/ec130/DME",0);
  410. setprop("sim/model/ec130/VUHF",0);
  411. </script>
  412. </binding>
  413. </checkbox>
  414. <checkbox>
  415. <row>5</row>
  416. <col>1</col>
  417. <halign>left</halign>
  418. <label> Square Flat front </label>
  419. <property>/sim/model/ec130/antenna_square_tail_flag_0</property>
  420. <live>true</live>
  421. <binding>
  422. <command>dialog-apply</command>
  423. </binding>
  424. <binding>
  425. <command>nasal</command>
  426. <script>
  427. if ( getprop("sim/model/ec130/antenna_square_tail_flag_0") ) {
  428. setprop("sim/model/ec130/antenna_square_tail_flag_1",0);
  429. setprop("sim/model/ec130/antenna_square_tail",1);
  430. setprop("sim/model/ec130/VUHF_front",0);
  431. } else {
  432. if ( !getprop("sim/model/ec130/antenna_square_tail_flag_1") ) {
  433. setprop("sim/model/ec130/antenna_square_tail",0);
  434. }
  435. }
  436. </script>
  437. </binding>
  438. </checkbox>
  439. <checkbox>
  440. <row>6</row>
  441. <col>1</col>
  442. <halign>left</halign>
  443. <label> Square Flat rear</label>
  444. <property>/sim/model/ec130/antenna_square_tail_flag_1</property>
  445. <live>true</live>
  446. <binding>
  447. <command>dialog-apply</command>
  448. </binding>
  449. <binding>
  450. <command>nasal</command>
  451. <script>
  452. if ( getprop("sim/model/ec130/antenna_square_tail_flag_1") ) {
  453. setprop("sim/model/ec130/antenna_square_tail_flag_0",0);
  454. setprop("sim/model/ec130/antenna_square_tail",2);
  455. setprop("sim/model/ec130/DME",0);
  456. setprop("sim/model/ec130/antenna_flat_tail",0);
  457. } else {
  458. if ( !getprop("sim/model/ec130/antenna_square_tail_flag_0") ) {
  459. setprop("sim/model/ec130/antenna_square_tail",0);
  460. }
  461. }
  462. </script>
  463. </binding>
  464. </checkbox>
  465. <checkbox>
  466. <row>7</row>
  467. <col>1</col>
  468. <halign>left</halign>
  469. <label> ADF</label>
  470. <property>/sim/model/ec130/antenna_flat_tail</property>
  471. <live>true</live>
  472. <binding>
  473. <command>dialog-apply</command>
  474. </binding>
  475. <binding>
  476. <command>nasal</command>
  477. <script>
  478. if ( getprop("sim/model/ec130/antenna_square_tail") == 2 ) {
  479. setprop("sim/model/ec130/antenna_square_tail",0);
  480. setprop("sim/model/ec130/antenna_square_tail_flag_1",0);
  481. }
  482. </script>
  483. </binding>
  484. </checkbox>
  485. <!-- only to get a gap before next -->
  486. <text>
  487. <row>8</row>
  488. <col>0</col>
  489. <label> </label>
  490. <halign>left</halign>
  491. </text>
  492. </group>
  493. <!-- END right column -->
  494. </group>
  495. <!-- END box with 2 columns left/right -->
  496. </group>
  497. <hrule/>
  498. <group>
  499. <layout>hbox</layout>
  500. <default-padding>3</default-padding>
  501. <button>
  502. <legend>Close</legend>
  503. <equal>true</equal>
  504. <key>Esc</key>
  505. <default>true</default>
  506. <binding>
  507. <command>nasal</command>
  508. <script>
  509. if ( getprop("/sim/model/ec130/config_dialog_active") ) {
  510. ec130.config_dialog.toggle();
  511. }
  512. ec130.antenna_config_dialog.toggle();
  513. setprop("/sim/model/ec130/antenna_dialog_active",0);
  514. </script>
  515. </binding>
  516. </button>
  517. </group>
  518. </PropertyList>