dmap_page.nas 4.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. # ==============================================================================
  2. # Original Boeing 747-400 pfd by Gijs de Rooy
  3. # Modified for 737-800 by Michael Soitanen
  4. # Modified for EC145 by litzi
  5. # ==============================================================================
  6. # include some helper functions for the NAVD page if not already loaded
  7. var ROSER=165;
  8. # check if the function lib is already loaded
  9. if (!defined("FND_FUNC_LOADED"))
  10. io.include(HELIONIXPATH ~ "Nasal/fnd_func.nas");
  11. page_setup["dmap"] = func (i) {
  12. p = mfd[i].add_page("dmap", HELIONIXPATH~"svg/dmap.svg");
  13. # MFD top row button labels
  14. # ============================
  15. p.add_cond("fndBtn", {offset: isin("fnd", mfd[i].pages) > -1 } );
  16. p.add_cond("vmdBtn", {offset: isin("vmd", mfd[i].pages) > -1 } );
  17. p.add_cond("navdBtn", {offset: isin("navd", mfd[i].pages) > -1 } );
  18. p.add_cond("dmapBtn", {offset: 0 } );
  19. p.add_cond("miscBtn", {offset: isin("misc", mfd[i].pages) > -1 } );
  20. p.add_cond("efbBtn", {offset: isin("efb", mfd[i].pages) > -1 } );
  21. # lots of text
  22. # for nav aids to update
  23. # ============================
  24. p.add_text("navSrctop", {sensor: adc.add({function: func navSrcType(adc.navsrc[i].val), timer:SLOW, type:"STRING" }) });
  25. p.add_text("navDMEtop", {sensor: adc.add({function: func navSrcDist(adc.navsrc[i].val), timer: SLOW, type:"STRING" }) });
  26. p.add_text("navIDtop", {sensor: adc.add({function: func navSrcId(adc.navsrc[i].val), timer: SLOW, type:"STRING"}) });
  27. p.add_text("navBrgtop", {sensor: adc.add({function: func navSrcBear(adc.navsrc[i].val), timer: SLOW}), format: "%3.0f°" });
  28. p.add_text("crs", {sensor: adc.add({function: func navSrcCrs(adc.navsrc[i].val), timer:SLOW }), format: "%3.0f" });
  29. #p.add_text("rngNum", {sensor: adc.add({prop: rngprop }), format: "%3.0f" });
  30. p.add_cond_grp(["navDMEtop","navIDtop","navBrgtop"], {sensor: adc.add({function: func navSrcInrange(adc.navsrc[i].val), timer: SLOW}) });
  31. # FMS col
  32. p.add_text("navSrc", {offset: "FMS"});
  33. p.add_text("navBrg", {sensor: adc.add( {function: func navSrcBear("FMS"), timer:SLOW }), format: "%3.0f°" });
  34. p.add_text("fmsToID", {sensor: adc.fmstoid }); # for FMS from nav ID
  35. p.add_text("fmsFromID", {sensor: adc.fmsfromid }); # for FMS to nav ID
  36. p.add_text("navTTG", {sensor: adc.fmsttg, scale: 1/60, format: "%i MIN"});
  37. p.add_cond("navTTG", {sensor: adc.fmsttg , between: [60, 10000]});
  38. p.add_text("navDME", {sensor: adc.add( {function: func navSrcDist("FMS"), timer: SLOW, type:"STRING" }) });
  39. p.add_cond("navDME", {sensor: adc.add( {function: func navSrcInrange("FMS"), timer: SLOW, type:"BOOL"}) });
  40. p.add_text("gsNum", {sensor: adc.gs, format: "%3.0i"});
  41. p.add_text("tasNum", {sensor: adc.tas, format: "%3.0i"});
  42. # NAV1 and NAV2 cols
  43. p.add_text("bearingSrc1", {sensor: adc.add( {function: func navSrcType("NAV1"), timer:SLOW, type:"STRING"}) });
  44. p.add_text("bearingSrc2", {sensor: adc.add( {function: func navSrcType("NAV2"), timer:SLOW, type:"STRING"}) });
  45. p.add_text("bearingFrq1", {sensor: adc.add( {function: func navSrcFrq("NAV1"), timer: SLOW, type:"STRING"}) });
  46. p.add_text("bearingFrq2", {sensor: adc.add( {function: func navSrcFrq("NAV2"), timer: SLOW, type:"STRING"}) });
  47. p.add_text("bearingDME1", {sensor: adc.add( {function: func DME_format(adc.nav0dist.val), timer: SLOW, type:"STRING"}) });
  48. p.add_cond("bearingDME1", {sensor: adc.nav0inrange });
  49. p.add_text("bearingDME2", {sensor: adc.add( {function: func DME_format(adc.nav1dist.val), timer: SLOW, type:"STRING"}) });
  50. p.add_cond("bearingDME2", {sensor: adc.nav1inrange });
  51. p.add_text("bearingTTG1", {sensor: adc.nav0ttg, scale: 1/60, format: "%i MIN" });
  52. p.add_text("bearingTTG2", {sensor: adc.nav1ttg, scale: 1/60, format: "%i MIN" });
  53. p.add_cond("bearingTTG1", {sensor: adc.nav0ttg, between: [60, 10000]});
  54. p.add_cond("bearingTTG2", {sensor: adc.nav1ttg, between: [60, 10000]});
  55. p.add_text("bearing1", {sensor: adc.nav0bear, format: "%3.0f°"});
  56. p.add_text("bearing2", {sensor: adc.nav1bear, format: "%3.0f°"});
  57. # /instrumentation/nav[0]/has-gs --> navSrc VOR1/ILS1
  58. #p.add_cond("navETE", {offset:0}); # hide ETE
  59. # GPS
  60. #
  61. # ======================================
  62. p.add_text("gpsLatNum", {sensor: adc.gpslat, trunc:"abs", format: "%8.4f°"});
  63. p.add_text("gpsLonNum", {sensor: adc.gpslon, trunc:"abs", format: "%08.4f°"});
  64. p.add_text("gpsLat", {sensor: adc.gpsLatNS});
  65. p.add_text("gpsLon", {sensor: adc.gpsLonWE});
  66. Generatewindbarb(p, s = "winddir");
  67. }; # func