vemd_page.nas 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  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. var p=nil;
  7. # include some helper functions for the VMD page
  8. io.include(HELIONIXPATH ~ "Nasal/vmd_func.nas");
  9. adc["fli0"] = Sensor.new({prop: "instrumentation/VEMD/FLI[0]/fli", timer: FAST, thres:0.01 });
  10. adc["fli1"] = Sensor.new({prop: "instrumentation/VEMD/FLI[1]/fli", timer: FAST, thres:0.01 });
  11. adc["fli0limit"] = Sensor.new({prop: "instrumentation/VEMD/FLI[0]/limit", timer: SLOW, type: "STRING"});
  12. adc["fli1limit"] = Sensor.new({prop: "instrumentation/VEMD/FLI[1]/limit", timer: SLOW, type: "STRING"});
  13. if (!contains(adc, "blink")) {
  14. var CBARS = props.globals.getNode("instrumentation/efis/cad/cautionbars", 1);
  15. var cbartimer = maketimer(0.75, func CBARS.setValue(!CBARS.getValue()) );
  16. cbartimer.start();
  17. adc["blink"] = Sensor.new({ prop: CBARS.getPath() });
  18. }
  19. page_setup["vemd"] = func (i) {
  20. p = mfd[i].add_page("vemd", HELIONIXPATH~"svg/vemd.svg");
  21. var DMEFACTOR = 0.0005399;
  22. var ALTFACTOR = (651-464)/400;
  23. var FPS2FPM = 60;
  24. var SHIFT_THRES = 0.5;
  25. var ROT_THRES = 0.1;
  26. #
  27. # rotor and eng rmp
  28. # ============================
  29. p.add_text("trq1Num", {sensor: adc.trq_1, format: "%5.1f" });
  30. p.add_text("trq2Num", {sensor: adc.trq_2, format: "%5.1f" });
  31. p.add_text("tot1Num", {sensor: adc.tot_1, format: "%3.0f" });
  32. p.add_text("tot2Num", {sensor: adc.tot_2, format: "%3.0f" });
  33. p.add_text("n1-1Num", {sensor: adc.n1_1, format: "%5.1f" });
  34. p.add_text("n1-2Num", {sensor: adc.n1_2, format: "%5.1f" });
  35. # blinking eng. start annunciator
  36. p.add_cond("start1", {sensor: adc.add( {function: func { adc.start1.val > 0.01 and adc.blink.val==1 }}) });
  37. p.add_cond("start2", {sensor: adc.add( {function: func { adc.start2.val > 0.01 and adc.blink.val==1 }}) });
  38. p.add_cond("fail1", {sensor: adc.n1_1, lessthan: 50 });
  39. p.add_cond("fail2", {sensor: adc.n1_2, lessthan: 50 });
  40. # FLI Needles value 10 = 150 deg
  41. p.add_trans("fli1", "rotation", {sensor: adc.fli0, scale: 15.0, offset: -150.0 });
  42. p.add_trans("fli2", "rotation", {sensor: adc.fli1, scale: 15.0, offset: -150.0 });
  43. # FLI Limit indicators
  44. p.add_cond("trq1Lim", {sensor: adc.fli0limit, "equals": "TRQ" });
  45. p.add_cond("trq2Lim", {sensor: adc.fli1limit, "equals": "TRQ" });
  46. p.add_cond("tot1Lim", {sensor: adc.fli0limit, "equals": "TOT" });
  47. p.add_cond("tot2Lim", {sensor: adc.fli1limit, "equals": "TOT" });
  48. p.add_cond("n1_1Lim", {sensor: adc.fli0limit, "equals": "N1" });
  49. p.add_cond("n1_2Lim", {sensor: adc.fli1limit, "equals": "N1" });
  50. p.add_text("OAT", {sensor: adc.oat, format: "%4.1f" });
  51. p.add_text("GenVoltL", {sensor: adc.elecBus0, format: "%4.1f" });
  52. p.add_text("GenVoltR", {sensor: adc.elecBus1, format: "%4.1f" });
  53. #p.add_text("GenAmpL", {sensor: adc.elecAlt0, format: "%3.0f A" });
  54. #p.add_text("GenAmpR", {sensor: adc.elecAlt1, format: "%3.0f A" });
  55. #p.add_text("BattAmp", {sensor: adc.add( {function: func {
  56. #if (adc.batteryload.val > 0)
  57. #return adc.batteryload.val;
  58. #else
  59. #return adc.batterycharge.val;
  60. #},
  61. #timer: SLOW
  62. #}),
  63. #format: "%3.0f A",
  64. #name: "batt"
  65. #});
  66. p.copy_element("LinGauge_0","_1",[400,0]);
  67. p.copy_element("LinGauge_0","_2",[200,0]);
  68. make_LinGauge (
  69. adc.oil_t1,
  70. adc.oil_p1,
  71. _id="",
  72. _min1=-40,
  73. _max1=140,
  74. fmt1="%3.0f",
  75. unit1="°C",
  76. _min2=0,
  77. _max2=8.0,
  78. fmt2="%3.1f",
  79. unit2="BAR",
  80. name="ENGOIL 1",
  81. l1=0,
  82. h1=100,
  83. l2=1.7,
  84. h2=5,
  85. _size=88
  86. );
  87. make_LinGauge (
  88. adc.oil_t2,
  89. adc.oil_p2,
  90. _id="_1",
  91. _min1=-40,
  92. _max1=140,
  93. fmt1="%3.0f",
  94. unit1="°C",
  95. _min2=0,
  96. _max2=8.0,
  97. fmt2="%3.1f",
  98. unit2="BAR",
  99. name="ENGOIL 2",
  100. l1=0,
  101. h1=100,
  102. l2=1.7,
  103. h2=5,
  104. _size=88
  105. );
  106. make_LinGauge (
  107. adc.mgb_t,
  108. adc.mgb_p,
  109. _id="_2",
  110. _min1=-40,
  111. _max1=140,
  112. fmt1="%3.0f",
  113. unit1="°C",
  114. _min2=0,
  115. _max2=10,
  116. fmt2="%3.1f",
  117. unit2="BAR",
  118. name="XMSNOIL",
  119. l1=0,
  120. h1=100,
  121. l2=1.7,
  122. h2=5,
  123. _size=88
  124. );
  125. # add the color ranges animation for changing VEMD caution and warning indicators
  126. # only 3 ranges are possible below minimum, nominal, above maximum
  127. var n1limits = [
  128. [60, [1,1,0]],
  129. [nil, [0,0,0]],
  130. [95, [1,0,0]]
  131. ];
  132. p.add_color_range("n1_1Warn", adc.n1_1, n1limits);
  133. p.add_color_range("n1_2Warn", adc.n1_2, n1limits);
  134. var trqlimits = [
  135. [78, [0,0,0]],
  136. [nil, [1,1,0]],
  137. [95, [1,0,0]]
  138. ];
  139. p.add_color_range("trq1Warn", adc.trq_1, trqlimits);
  140. p.add_color_range("trq2Warn", adc.trq_2, trqlimits);
  141. var totlimits = [
  142. [900, [0,0,0]],
  143. [nil, [1,1,0]],
  144. [1000, [1,0,0]]
  145. ];
  146. p.add_color_range("tot1Warn", adc.tot_1, totlimits);
  147. p.add_color_range("tot2Warn", adc.tot_2, totlimits);
  148. }; # func