boeing.nas 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694
  1. var input = func(v) {
  2. setprop("/instrumentation/cdu/input",getprop("/instrumentation/cdu/input")~v);
  3. }
  4. var input = func(v) {
  5. setprop("/instrumentation/cdu/input",getprop("/instrumentation/cdu/input")~v);
  6. }
  7. var key = func(v) {
  8. var cduDisplay = getprop("/instrumentation/cdu/display");
  9. var serviceable = getprop("/instrumentation/cdu/serviceable");
  10. var eicasDisplay = getprop("/instrumentation/eicas/display");
  11. var cduInput = getprop("/instrumentation/cdu/input");
  12. if (serviceable == 1){
  13. if (v == "LSK1L"){
  14. if (cduDisplay == "DEP_ARR_INDEX"){
  15. cduDisplay = "RTE1_DEP";
  16. }
  17. if (cduDisplay == "EICAS_MODES"){
  18. eicasDisplay = "ENG";
  19. }
  20. if (cduDisplay == "EICAS_SYN"){
  21. eicasDisplay = "ELEC";
  22. }
  23. if (cduDisplay == "INIT_REF"){
  24. cduDisplay = "IDENT";
  25. }
  26. if (cduDisplay == "NAV_RAD"){
  27. setprop("/instrumentation/nav[0]/frequencies/selected-mhz",cduInput);
  28. cduInput = "";
  29. }
  30. if (cduDisplay == "RTE1_1"){
  31. setprop("/autopilot/route-manager/departure/airport",cduInput);
  32. cduInput = "";
  33. }
  34. if (cduDisplay == "RTE1_LEGS"){
  35. if (cduInput == "DELETE"){
  36. setprop("/autopilot/route-manager/input","@DELETE1");
  37. cduInput = "";
  38. }
  39. else{
  40. setprop("/autopilot/route-manager/input","@INSERT2:"~cduInput);
  41. }
  42. }
  43. if (cduDisplay == "TO_REF"){
  44. setprop("/instrumentation/fmc/to-flap",cduInput);
  45. cduInput = "";
  46. }
  47. }
  48. if (v == "LSK1R"){
  49. if (cduDisplay == "EICAS_MODES"){
  50. eicasDisplay = "FUEL";
  51. }
  52. if (cduDisplay == "EICAS_SYN"){
  53. eicasDisplay = "HYD";
  54. }
  55. if (cduDisplay == "NAV RAD"){
  56. setprop("/instrumentation/nav[1]/frequencies/selected-mhz",cduInput);
  57. cduInput = "";
  58. }
  59. if (cduDisplay == "RTE1_1"){
  60. setprop("/autopilot/route-manager/destination/airport",cduInput);
  61. cduInput = "";
  62. }
  63. if (cduDisplay == "RTE1_LEGS"){
  64. setprop("/autopilot/route-manager/route/wp[1]/altitude-ft",cduInput);
  65. if (substr(cduInput,0,2) == "FL"){
  66. setprop("/autopilot/route-manager/route/wp[1]/altitude-ft",substr(cduInput,2)*100);
  67. }
  68. cduInput = "";
  69. }
  70. }
  71. if (v == "LSK2L"){
  72. if (cduDisplay == "EICAS_MODES"){
  73. eicasDisplay = "STAT";
  74. }
  75. if (cduDisplay == "EICAS_SYN"){
  76. eicasDisplay = "ECS";
  77. }
  78. if (cduDisplay == "POS_INIT"){
  79. setprop("/instrumentation/fmc/ref-airport",cduInput);
  80. cduInput = "";;
  81. }
  82. if (cduDisplay == "INIT_REF"){
  83. cduDisplay = "POS_INIT";
  84. }
  85. if (cduDisplay == "RTE1_1"){
  86. setprop("/autopilot/route-manager/departure/runway",cduInput);
  87. cduInput = "";;
  88. }
  89. if (cduDisplay == "RTE1_LEGS"){
  90. if (cduInput == "DELETE"){
  91. setprop("/autopilot/route-manager/input","@DELETE2");
  92. cduInput = "";
  93. }
  94. else{
  95. setprop("/autopilot/route-manager/input","@INSERT3:"~cduInput);
  96. }
  97. }
  98. }
  99. if (v == "LSK2R"){
  100. if (cduDisplay == "DEP_ARR_INDEX"){
  101. cduDisplay = "RTE1_ARR";
  102. }
  103. else if (cduDisplay == "EICAS_MODES"){
  104. eicasDisplay = "GEAR";
  105. }
  106. else if (cduDisplay == "EICAS_SYN"){
  107. eicasDisplay = "DRS";
  108. }
  109. else if (cduDisplay == "MENU"){
  110. eicasDisplay = "EICAS_MODES";
  111. }
  112. else if (cduDisplay == "RTE1_LEGS"){
  113. setprop("/autopilot/route-manager/route/wp[2]/altitude-ft",cduInput);
  114. if (substr(cduInput,0,2) == "FL"){
  115. setprop("/autopilot/route-manager/route/wp[2]/altitude-ft",substr(cduInput,2)*100);
  116. }
  117. cduInput = "";
  118. }
  119. }
  120. if (v == "LSK3L"){
  121. if (cduDisplay == "INIT_REF"){
  122. cduDisplay = "PERF_INIT";
  123. }
  124. if (cduDisplay == "RTE1_LEGS"){
  125. if (cduInput == "DELETE"){
  126. setprop("/autopilot/route-manager/input","@DELETE3");
  127. cduInput = "";
  128. }
  129. else{
  130. setprop("/autopilot/route-manager/input","@INSERT4:"~cduInput);
  131. }
  132. }
  133. }
  134. if (v == "LSK3R"){
  135. if (cduDisplay == "RTE1_LEGS"){
  136. setprop("/autopilot/route-manager/route/wp[3]/altitude-ft",cduInput);
  137. if (substr(cduInput,0,2) == "FL"){
  138. setprop("/autopilot/route-manager/route/wp[3]/altitude-ft",substr(cduInput,2)*100);
  139. }
  140. cduInput = "";
  141. }
  142. }
  143. if (v == "LSK4L"){
  144. if (cduDisplay == "INIT_REF"){
  145. cduDisplay = "THR_LIM";
  146. }
  147. if (cduDisplay == "RTE1_LEGS"){
  148. if (cduInput == "DELETE"){
  149. setprop("/autopilot/route-manager/input","@DELETE4");
  150. cduInput = "";
  151. }
  152. else{
  153. setprop("/autopilot/route-manager/input","@INSERT5:"~cduInput);
  154. }
  155. }
  156. }
  157. if (v == "LSK4R"){
  158. if (cduDisplay == "RTE1_LEGS"){
  159. setprop("/autopilot/route-manager/route/wp[4]/altitude-ft",cduInput);
  160. if (substr(cduInput,0,2) == "FL"){
  161. setprop("/autopilot/route-manager/route/wp[4]/altitude-ft",substr(cduInput,2)*100);
  162. }
  163. cduInput = "";
  164. }
  165. }
  166. if (v == "LSK5L"){
  167. if (cduDisplay == "INIT_REF"){
  168. cduDisplay = "TO_REF";
  169. }
  170. if (cduDisplay == "RTE1_LEGS"){
  171. if (cduInput == "DELETE"){
  172. setprop("/autopilot/route-manager/input","@DELETE5");
  173. cduInput = "";
  174. }
  175. else{
  176. setprop("/autopilot/route-manager/input","@INSERT6:"~cduInput);
  177. }
  178. }
  179. }
  180. if (v == "LSK5R"){
  181. if (cduDisplay == "RTE1_LEGS"){
  182. setprop("/autopilot/route-manager/route/wp[5]/altitude-ft",cduInput);
  183. if (substr(cduInput,0,2) == "FL"){
  184. setprop("/autopilot/route-manager/route/wp[5]/altitude-ft",substr(cduInput,2)*100);
  185. }
  186. cduInput = "";
  187. }
  188. }
  189. if (v == "LSK6L"){
  190. if (cduDisplay == "INIT_REF"){
  191. cduDisplay = "APP_REF";
  192. }
  193. if (cduDisplay == "APP_REF"){
  194. cduDisplay = "INIT_REF";
  195. }
  196. if ((cduDisplay == "IDENT") or (cduDisplay = "MAINT") or (cduDisplay = "PERF_INIT") or (cduDisplay = "POS_INIT") or (cduDisplay = "POS_REF") or (cduDisplay = "THR_LIM") or (cduDisplay = "TO_REF")){
  197. cduDisplay = "INIT_REF";
  198. }
  199. }
  200. if (v == "LSK6R"){
  201. if (cduDisplay == "THR_LIM"){
  202. cduDisplay = "TO_REF";
  203. }
  204. else if (cduDisplay == "APP_REF"){
  205. cduDisplay = "THR_LIM";
  206. }
  207. else if ((cduDisplay == "RTE1_1") or (cduDisplay == "RTE1_LEGS")){
  208. setprop("/autopilot/route-manager/input","@ACTIVATE");
  209. }
  210. else if ((cduDisplay == "POS_INIT") or (cduDisplay == "DEP") or (cduDisplay == "RTE1_ARR") or (cduDisplay == "RTE1_DEP")){
  211. cduDisplay = "RTE1_1";
  212. }
  213. else if ((cduDisplay == "IDENT") or (cduDisplay == "TO_REF")){
  214. cduDisplay = "POS_INIT";
  215. }
  216. else if (cduDisplay == "EICAS_SYN"){
  217. cduDisplay = "EICAS_MODES";
  218. }
  219. else if (cduDisplay == "EICAS_MODES"){
  220. cduDisplay = "EICAS_SYN";
  221. }
  222. else if (cduDisplay == "INIT_REF"){
  223. cduDisplay = "MAINT";
  224. }
  225. }
  226. setprop("/instrumentation/cdu/display",cduDisplay);
  227. if (eicasDisplay != nil){
  228. setprop("/instrumentation/eicas/display",eicasDisplay);
  229. }
  230. setprop("/instrumentation/cdu/input",cduInput);
  231. }
  232. }
  233. var delete = func {
  234. var length = size(getprop("/instrumentation/cdu/input")) - 1;
  235. setprop("/instrumentation/cdu/input",substr(getprop("/instrumentation/cdu/input"),0,length));
  236. }
  237. var i = 0;
  238. var plusminus = func {
  239. var end = size(getprop("/instrumentation/cdu/input"));
  240. var start = end - 1;
  241. var lastchar = substr(getprop("/instrumentation/cdu/input"),start,end);
  242. if (lastchar == "+"){
  243. me.delete();
  244. me.input('-');
  245. }
  246. if (lastchar == "-"){
  247. me.delete();
  248. me.input('+');
  249. }
  250. if ((lastchar != "-") and (lastchar != "+")){
  251. me.input('+');
  252. }
  253. }
  254. var cdu = func{
  255. var display = getprop("/instrumentation/cdu/display");
  256. var serviceable = getprop("/instrumentation/cdu/serviceable");
  257. title = ""; page = "";
  258. line1l = ""; line2l = ""; line3l = ""; line4l = ""; line5l = ""; line6l = "";
  259. line1lt = ""; line2lt = ""; line3lt = ""; line4lt = ""; line5lt = ""; line6lt = "";
  260. line1c = ""; line2c = ""; line3c = ""; line4c = ""; line5c = ""; line6c = "";
  261. line1ct = ""; line2ct = ""; line3ct = ""; line4ct = ""; line5ct = ""; line6ct = "";
  262. line1r = ""; line2r = ""; line3r = ""; line4r = ""; line5r = ""; line6r = "";
  263. line1rt = ""; line2rt = ""; line3rt = ""; line4rt = ""; line5rt = ""; line6rt = "";
  264. if (display == "MENU") {
  265. title = "MENU";
  266. line1l = "<FMC";
  267. line1rt = "EFIS CP";
  268. line1r = "SELECT>";
  269. line2l = "<ACARS";
  270. line2rt = "EICAS CP";
  271. line2r = "SELECT>";
  272. line6l = "<ACMS";
  273. line6r = "CMC>";
  274. }
  275. if (display == "ALTN_NAV_RAD") {
  276. title = "ALTN NAV RADIO";
  277. }
  278. if (display == "APP_REF") {
  279. title = "APPROACH REF";
  280. line1lt = "GROSS WT";
  281. line1rt = "FLAPS VREF";
  282. if (getprop("/instrumentation/fmc/vspeeds/Vref") != nil){
  283. line1l = getprop("/instrumentation/fmc/vspeeds/Vref");
  284. }
  285. if (getprop("/autopilot/route-manager/destination/airport") != nil){
  286. line4lt = getprop("/autopilot/route-manager/destination/airport");
  287. }
  288. line6l = "<INDEX";
  289. line6r = "THRUST LIM>";
  290. }
  291. if (display == "DEP_ARR_INDEX") {
  292. title = "DEP/ARR INDEX";
  293. line1l = "<DEP";
  294. line1ct = "RTE 1";
  295. if (getprop("/autopilot/route-manager/departure/airport") != nil){
  296. line1c = getprop("/autopilot/route-manager/departure/airport");
  297. }
  298. line1r = "ARR>";
  299. if (getprop("/autopilot/route-manager/destination/airport") != nil){
  300. line2c = getprop("/autopilot/route-manager/destination/airport");
  301. }
  302. line2r = "ARR>";
  303. line3l = "<DEP";
  304. line3r = "ARR>";
  305. line4r = "ARR>";
  306. line6lt ="DEP";
  307. line6l = "<----";
  308. line6c = "OTHER";
  309. line6rt ="ARR";
  310. line6r = "---->";
  311. }
  312. if (display == "EICAS_MODES") {
  313. title = "EICAS MODES";
  314. line1l = "<ENG";
  315. line1r = "FUEL>";
  316. line2l = "<STAT";
  317. line2r = "GEAR>";
  318. line5l = "<CANC";
  319. line5r = "RCL>";
  320. line6r = "SYNOPTICS>";
  321. }
  322. if (display == "EICAS_SYN") {
  323. title = "EICAS SYNOPTICS";
  324. line1l = "<ELEC";
  325. line1r = "HYD>";
  326. line2l = "<ECS";
  327. line2r = "DOORS>";
  328. line5l = "<CANC";
  329. line5r = "RCL>";
  330. line6r = "MODES>";
  331. }
  332. if (display == "FIX_INFO") {
  333. title = "FIX INFO";
  334. line1l = sprintf("%3.2f", getprop("/instrumentation/nav[0]/frequencies/selected-mhz-fmt"));
  335. line1r = sprintf("%3.2f", getprop("/instrumentation/nav[1]/frequencies/selected-mhz-fmt"));
  336. line2l = sprintf("%3.2f", getprop("/instrumentation/nav[0]/radials/selected-deg"));
  337. line2r = sprintf("%3.2f", getprop("/instrumentation/nav[1]/radials/selected-deg"));
  338. line6l = "<ERASE FIX";
  339. }
  340. if (display == "IDENT") {
  341. title = "IDENT";
  342. line1lt = "MODEL";
  343. if (getprop("/instrumentation/cdu/ident/model") != nil){
  344. line1l = getprop("/instrumentation/cdu/ident/model");
  345. }
  346. line1rt = "ENGINES";
  347. line2lt = "NAV DATA";
  348. if (getprop("/instrumentation/cdu/ident/engines") != nil){
  349. line1r = getprop("/instrumentation/cdu/ident/engines");
  350. }
  351. line6l = "<INDEX";
  352. line6r = "POS INIT>";
  353. }
  354. if (display == "INIT_REF") {
  355. title = "INIT/REF INDEX";
  356. line1l = "<IDENT";
  357. line1r = "NAV DATA>";
  358. line2l = "<POS";
  359. line3l = "<PERF";
  360. line4l = "<THRUST LIM";
  361. line5l = "<TAKEOFF";
  362. line6l = "<APPROACH";
  363. line6r = "MAINT>";
  364. }
  365. if (display == "MAINT") {
  366. title = "MAINTENANCE INDEX";
  367. line1l = "<CROS LOAD";
  368. line1r = "BITE>";
  369. line2l = "<PERF FACTORS";
  370. line3l = "<IRS MONITOR";
  371. line6l = "<INDEX";
  372. }
  373. if (display == "NAV_RAD") {
  374. title = "NAV RADIO";
  375. line1lt = "VOR L";
  376. line1l = sprintf("%3.2f", getprop("/instrumentation/nav[0]/frequencies/selected-mhz-fmt"));
  377. line1rt = "VOR R";
  378. line1r = sprintf("%3.2f", getprop("/instrumentation/nav[1]/frequencies/selected-mhz-fmt"));
  379. line2lt = "CRS";
  380. line2ct = "RADIAL";
  381. line2c = sprintf("%3.2f", getprop("/instrumentation/nav[0]/radials/selected-deg"))~" "~sprintf("%3.2f", getprop("/instrumentation/nav[1]/radials/selected-deg"));
  382. line2rt = "CRS";
  383. line3lt = "ADF L";
  384. line3l = sprintf("%3.2f", getprop("/instrumentation/adf[0]/frequencies/selected-khz"));
  385. line3rt = "ADF R";
  386. }
  387. if (display == "PERF_INIT") {
  388. title = "PERF INIT";
  389. line1lt = "GR WT";
  390. line1rt = "CRZ ALT";
  391. line1r = getprop("/autopilot/route-manager/cruise/altitude-ft");
  392. line2lt = "FUEL";
  393. line3lt = "ZFW";
  394. line4lt = "RESERVES";
  395. line4rt = "CRZ CG";
  396. line5lt = "COST INDEX";
  397. line5rt = "STEP SIZE";
  398. line6l = "<INDEX";
  399. line6r = "THRUST LIM>";
  400. if (getprop("/sim/flight-model") == "jsb") {
  401. line1l = sprintf("%3.1f", (getprop("/fdm/jsbsim/inertia/weight-lbs")/1000));
  402. line2l = sprintf("%3.1f", (getprop("/fdm/jsbsim/propulsion/total-fuel-lbs")/1000));
  403. line3l = sprintf("%3.1f", (getprop("/fdm/jsbsim/inertia/empty-weight-lbs")/1000));
  404. }
  405. elsif (getprop("/sim/flight-model") == "yasim") {
  406. line1l = sprintf("%3.1f", (getprop("/yasim/gross-weight-lbs")/1000));
  407. line2l = sprintf("%3.1f", (getprop("/consumables/fuel/total-fuel-lbs")/1000));
  408. yasim_emptyweight = getprop("/yasim/gross-weight-lbs");
  409. yasim_emptyweight -= getprop("/consumables/fuel/total-fuel-lbs");
  410. yasim_weights = props.globals.getNode("/sim").getChildren("weight");
  411. for (i = 0; i < size(yasim_weights); i += 1) {
  412. yasim_emptyweight -= yasim_weights[i].getChild("weight-lb").getValue();
  413. }
  414. line3l = sprintf("%3.1f", yasim_emptyweight/1000);
  415. }
  416. }
  417. if (display == "POS_INIT") {
  418. title = "POS INIT";
  419. line6l = "<INDEX";
  420. line6r = "ROUTE>";
  421. }
  422. if (display == "POS_REF") {
  423. title = "POS REF";
  424. line1lt = "FMC POST";
  425. line1l = getprop("/position/latitude-string")~" "~getprop("/position/longitude-string");
  426. line1rt = "GS";
  427. line1r = sprintf("%3.0f", getprop("/velocities/groundspeed-kt"));
  428. line5l = "<PURGE";
  429. line5r = "INHIBIT>";
  430. line6l = "<INDEX";
  431. line6r = "BRG/DIST>";
  432. }
  433. if (display == "RTE1_1") {
  434. title = "RTE 1";
  435. page = "1/2";
  436. line1lt = "ORIGIN";
  437. if (getprop("/autopilot/route-manager/departure/airport") != nil){
  438. line1l = getprop("/autopilot/route-manager/departure/airport");
  439. }
  440. line1rt = "DEST";
  441. if (getprop("/autopilot/route-manager/destination/airport") != nil){
  442. line1r = getprop("/autopilot/route-manager/destination/airport");
  443. }
  444. line2lt = "RUNWAY";
  445. if (getprop("/autopilot/route-manager/departure/runway") != nil){
  446. line2l = getprop("/autopilot/route-manager/departure/runway");
  447. }
  448. line2rt = "FLT NO";
  449. line3rt = "CO ROUTE";
  450. line5l = "<RTE COPY";
  451. line6l = "<RTE 2";
  452. if (getprop("/autopilot/route-manager/active") == 1){
  453. line6r = "PERF INIT>";
  454. }
  455. else {
  456. line6r = "ACTIVATE>";
  457. }
  458. }
  459. if (display == "RTE1_2") {
  460. title = "RTE 1";
  461. page = "2/2";
  462. line1lt = "VIA";
  463. line1rt = "TO";
  464. if (getprop("/autopilot/route-manager/route/wp[1]/id") != nil){
  465. line1r = getprop("/autopilot/route-manager/route/wp[1]/id");
  466. }
  467. if (getprop("/autopilot/route-manager/route/wp[2]/id") != nil){
  468. line2r = getprop("/autopilot/route-manager/route/wp[2]/id");
  469. }
  470. if (getprop("/autopilot/route-manager/route/wp[3]/id") != nil){
  471. line3r = getprop("/autopilot/route-manager/route/wp[3]/id");
  472. }
  473. if (getprop("/autopilot/route-manager/route/wp[4]/id") != nil){
  474. line4r = getprop("/autopilot/route-manager/route/wp[4]/id");
  475. }
  476. if (getprop("/autopilot/route-manager/route/wp[5]/id") != nil){
  477. line5r = getprop("/autopilot/route-manager/route/wp[5]/id");
  478. }
  479. line6l = "<RTE 2";
  480. line6r = "ACTIVATE>";
  481. }
  482. if (display == "RTE1_ARR") {
  483. if (getprop("/autopilot/route-manager/destination/airport") != nil){
  484. title = getprop("/autopilot/route-manager/destination/airport")~" ARRIVALS";
  485. }
  486. else{
  487. title = "ARRIVALS";
  488. }
  489. line1lt = "STARS";
  490. line1rt = "APPROACHES";
  491. if (getprop("/autopilot/route-manager/destination/runway") != nil){
  492. line1r = getprop("/autopilot/route-manager/destination/runway");
  493. }
  494. line2lt = "TRANS";
  495. line3rt = "RUNWAYS";
  496. line6l = "<INDEX";
  497. line6r = "ROUTE>";
  498. }
  499. if (display == "RTE1_DEP") {
  500. if (getprop("/autopilot/route-manager/departure/airport") != nil){
  501. title = getprop("/autopilot/route-manager/departure/airport")~" DEPARTURES";
  502. }
  503. else{
  504. title = "DEPARTURES";
  505. }
  506. line1lt = "SIDS";
  507. line1rt = "RUNWAYS";
  508. if (getprop("/autopilot/route-manager/departure/runway") != nil){
  509. line1r = getprop("/autopilot/route-manager/departure/runway");
  510. }
  511. line2lt = "TRANS";
  512. line6l = "<ERASE";
  513. line6r = "ROUTE>";
  514. }
  515. if (display == "RTE1_LEGS") {
  516. if (getprop("/autopilot/route-manager/active") == 1){
  517. title = "ACT RTE 1 LEGS";
  518. }
  519. else {
  520. title = "RTE 1 LEGS";
  521. }
  522. if (getprop("/autopilot/route-manager/route/wp[1]/id") != nil){
  523. line1lt = sprintf("%3.0f", getprop("/autopilot/route-manager/route/wp[1]/leg-bearing-true-deg"));
  524. line1l = getprop("/autopilot/route-manager/route/wp[1]/id");
  525. line2ct = sprintf("%3.0f", getprop("/autopilot/route-manager/route/wp[1]/leg-distance-nm"))~" NM";
  526. line1r = sprintf("%5.0f", getprop("/autopilot/route-manager/route/wp[1]/altitude-ft"));
  527. if (getprop("/autopilot/route-manager/route/wp[1]/speed-kts") != nil){
  528. line4r = getprop("/autopilot/route-manager/route/wp[1]/speed-kts")~"/"~sprintf("%5.0f", getprop("/autopilot/route-manager/route/wp[1]/altitude-ft"));
  529. }
  530. }
  531. if (getprop("/autopilot/route-manager/route/wp[2]/id") != nil){
  532. if (getprop("/autopilot/route-manager/route/wp[2]/leg-bearing-true-deg") != nil){
  533. line2lt = sprintf("%3.0f", getprop("/autopilot/route-manager/route/wp[2]/leg-bearing-true-deg"));
  534. }
  535. line2l = getprop("/autopilot/route-manager/route/wp[2]/id");
  536. if (getprop("/autopilot/route-manager/route/wp[2]/leg-distance-nm") != nil){
  537. line3ct = sprintf("%3.0f", getprop("/autopilot/route-manager/route/wp[2]/leg-distance-nm"))~" NM";
  538. }
  539. line2r = sprintf("%5.0f", getprop("/autopilot/route-manager/route/wp[2]/altitude-ft"));
  540. if (getprop("/autopilot/route-manager/route/wp[2]/speed-kts") != nil){
  541. line4r = getprop("/autopilot/route-manager/route/wp[2]/speed-kts")~"/"~sprintf("%5.0f", getprop("/autopilot/route-manager/route/wp[2]/altitude-ft"));
  542. }
  543. }
  544. if (getprop("/autopilot/route-manager/route/wp[3]/id") != nil){
  545. if (getprop("/autopilot/route-manager/route/wp[3]/leg-bearing-true-deg") != nil){
  546. line3lt = sprintf("%3.0f", getprop("/autopilot/route-manager/route/wp[3]/leg-bearing-true-deg"));
  547. }
  548. line3l = getprop("/autopilot/route-manager/route/wp[3]/id");
  549. if (getprop("/autopilot/route-manager/route/wp[3]/leg-distance-nm") != nil){
  550. line4ct = sprintf("%3.0f", getprop("/autopilot/route-manager/route/wp[3]/leg-distance-nm"))~" NM";
  551. }
  552. line3r = sprintf("%5.0f", getprop("/autopilot/route-manager/route/wp[3]/altitude-ft"));
  553. if (getprop("/autopilot/route-manager/route/wp[3]/speed-kts") != nil){
  554. line3r = getprop("/autopilot/route-manager/route/wp[3]/speed-kts")~"/"~sprintf("%5.0f", getprop("/autopilot/route-manager/route/wp[3]/altitude-ft"));;
  555. }
  556. }
  557. if (getprop("/autopilot/route-manager/route/wp[4]/id") != nil){
  558. if (getprop("/autopilot/route-manager/route/wp[4]/leg-bearing-true-deg") != nil){
  559. line4lt = sprintf("%3.0f", getprop("/autopilot/route-manager/route/wp[4]/leg-bearing-true-deg"));
  560. }
  561. line4l = getprop("/autopilot/route-manager/route/wp[4]/id");
  562. if (getprop("/autopilot/route-manager/route/wp[4]/leg-distance-nm") != nil){
  563. line5ct = sprintf("%3.0f", getprop("/autopilot/route-manager/route/wp[4]/leg-distance-nm"))~" NM";
  564. }
  565. line4r = sprintf("%5.0f", getprop("/autopilot/route-manager/route/wp[4]/altitude-ft"));
  566. if (getprop("/autopilot/route-manager/route/wp[4]/speed-kts") != nil){
  567. line4r = getprop("/autopilot/route-manager/route/wp[4]/speed-kts")~"/"~sprintf("%5.0f", getprop("/autopilot/route-manager/route/wp[4]/altitude-ft"));
  568. }
  569. }
  570. if (getprop("/autopilot/route-manager/route/wp[5]/id") != nil){
  571. if (getprop("/autopilot/route-manager/route/wp[5]/leg-bearing-true-deg") != nil){
  572. line5lt = sprintf("%3.0f", getprop("/autopilot/route-manager/route/wp[5]/leg-bearing-true-deg"));
  573. }
  574. line5l = getprop("/autopilot/route-manager/route/wp[5]/id");
  575. line5r = sprintf("%5.0f", getprop("/autopilot/route-manager/route/wp[5]/altitude-ft"));
  576. if (getprop("/autopilot/route-manager/route/wp[5]/speed-kts") != nil){
  577. line4r = getprop("/autopilot/route-manager/route/wp[5]/speed-kts")~"/"~sprintf("%5.0f", getprop("/autopilot/route-manager/route/wp[5]/altitude-ft"));
  578. }
  579. }
  580. line6l = "<RTE 2 LEGS";
  581. if (getprop("/autopilot/route-manager/active") == 1){
  582. line6r = "RTE DATA>";
  583. }
  584. else{
  585. line6r = "ACTIVATE>";
  586. }
  587. }
  588. if (display == "THR_LIM") {
  589. title = "THRUST LIM";
  590. line1lt = "SEL";
  591. line1ct = "OAT";
  592. line1c = sprintf("%2.0f", getprop("/environment/temperature-degc"))~" °C";
  593. line1rt = "TO 1 N1";
  594. line2l = "<TO";
  595. line2r = "CLB>";
  596. line3lt = "TO 1";
  597. line3c = "<SEL> <ARM>";
  598. line3r = "CLB 1>";
  599. line4lt = "TO 2";
  600. line4r = "CLB 2>";
  601. line6l = "<INDEX";
  602. line6r = "TAKEOFF>";
  603. }
  604. if (display == "TO_REF") {
  605. title = "TAKEOFF REF";
  606. line1lt = "FLAP/ACCEL HT";
  607. line1l = getprop("/instrumentation/fmc/to-flap");
  608. line1rt = "REF V1";
  609. if (getprop("/instrumentation/fmc/vspeeds/V1") != nil){
  610. line1r = sprintf("%3.0f", getprop("/instrumentation/fmc/vspeeds/V1"));
  611. }
  612. line2lt = "E/O ACCEL HT";
  613. line2rt = "REF VR";
  614. if (getprop("/instrumentation/fmc/vspeeds/VR") != nil){
  615. line2r = sprintf("%3.0f", getprop("/instrumentation/fmc/vspeeds/VR"));
  616. }
  617. line3lt = "THR REDUCTION";
  618. line3rt = "REF V2";
  619. if (getprop("/instrumentation/fmc/vspeeds/V2") != nil){
  620. line3r = sprintf("%3.0f", getprop("/instrumentation/fmc/vspeeds/V2"));
  621. }
  622. line4lt = "WIND/SLOPE";
  623. line4rt = "TRIM CG%";
  624. if (getprop("/instrumentation/fmc/cg") != nil and getprop("/instrumentation/fmc/stab-trim-units")){
  625. line4r = sprintf("%1.1f", getprop("/instrumentation/fmc/stab-trim-units"))~" "~sprintf("%2.1f", getprop("/instrumentation/fmc/cg"))~"%";
  626. }
  627. line5rt = "POS SHIFT";
  628. line6l = "<INDEX";
  629. line6r = "POS INIT>";
  630. }
  631. if (serviceable != 1){
  632. title = ""; page = "";
  633. line1l = ""; line2l = ""; line3l = ""; line4l = ""; line5l = ""; line6l = "";
  634. line1lt = ""; line2lt = ""; line3lt = ""; line4lt = ""; line5lt = ""; line6lt = "";
  635. line1c = ""; line2c = ""; line3c = ""; line4c = ""; line5c = ""; line6c = "";
  636. line1ct = ""; line2ct = ""; line3ct = ""; line4ct = ""; line5ct = ""; line6ct = "";
  637. line1r = ""; line2r = ""; line3r = ""; line4r = ""; line5r = ""; line6r = "";
  638. line1rt = ""; line2rt = ""; line3rt = ""; line4rt = ""; line5rt = ""; line6rt = "";
  639. }
  640. setprop("/instrumentation/cdu/output/title",title);
  641. setprop("/instrumentation/cdu/output/page",page);
  642. setprop("/instrumentation/cdu/output/line1/left",line1l);
  643. setprop("/instrumentation/cdu/output/line2/left",line2l);
  644. setprop("/instrumentation/cdu/output/line3/left",line3l);
  645. setprop("/instrumentation/cdu/output/line4/left",line4l);
  646. setprop("/instrumentation/cdu/output/line5/left",line5l);
  647. setprop("/instrumentation/cdu/output/line6/left",line6l);
  648. setprop("/instrumentation/cdu/output/line1/left-title",line1lt);
  649. setprop("/instrumentation/cdu/output/line2/left-title",line2lt);
  650. setprop("/instrumentation/cdu/output/line3/left-title",line3lt);
  651. setprop("/instrumentation/cdu/output/line4/left-title",line4lt);
  652. setprop("/instrumentation/cdu/output/line5/left-title",line5lt);
  653. setprop("/instrumentation/cdu/output/line6/left-title",line6lt);
  654. setprop("/instrumentation/cdu/output/line1/center",line1c);
  655. setprop("/instrumentation/cdu/output/line2/center",line2c);
  656. setprop("/instrumentation/cdu/output/line3/center",line3c);
  657. setprop("/instrumentation/cdu/output/line4/center",line4c);
  658. setprop("/instrumentation/cdu/output/line5/center",line5c);
  659. setprop("/instrumentation/cdu/output/line6/center",line6c);
  660. setprop("/instrumentation/cdu/output/line1/center-title",line1ct);
  661. setprop("/instrumentation/cdu/output/line2/center-title",line2ct);
  662. setprop("/instrumentation/cdu/output/line3/center-title",line3ct);
  663. setprop("/instrumentation/cdu/output/line4/center-title",line4ct);
  664. setprop("/instrumentation/cdu/output/line5/center-title",line5ct);
  665. setprop("/instrumentation/cdu/output/line6/center-title",line6ct);
  666. setprop("/instrumentation/cdu/output/line1/right",line1r);
  667. setprop("/instrumentation/cdu/output/line2/right",line2r);
  668. setprop("/instrumentation/cdu/output/line3/right",line3r);
  669. setprop("/instrumentation/cdu/output/line4/right",line4r);
  670. setprop("/instrumentation/cdu/output/line5/right",line5r);
  671. setprop("/instrumentation/cdu/output/line6/right",line6r);
  672. setprop("/instrumentation/cdu/output/line1/right-title",line1rt);
  673. setprop("/instrumentation/cdu/output/line2/right-title",line2rt);
  674. setprop("/instrumentation/cdu/output/line3/right-title",line3rt);
  675. setprop("/instrumentation/cdu/output/line4/right-title",line4rt);
  676. setprop("/instrumentation/cdu/output/line5/right-title",line5rt);
  677. setprop("/instrumentation/cdu/output/line6/right-title",line6rt);
  678. settimer(cdu,0.2);
  679. }
  680. _setlistener("/sim/signals/fdm-initialized", cdu);