1
0

pph.nas 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. # =============================
  2. # system for 737-100 by helijah
  3. # =============================
  4. var loop = func {
  5. # =========================
  6. # gph -> pph by Helijah
  7. # =========================
  8. var FuelDensity=props.globals.getNode("consumables/fuel/tank[0]/density-ppg",1).getValue();
  9. if(FuelDensity == nil){FuelDensity = 6.72};
  10. var pph=getprop("/engines/engine[0]/fuel-flow-gph");
  11. if(pph == nil){pph = 0.0};
  12. setprop("/engines/engine[0]/fuel-flow-gph", pph * FuelDensity );
  13. var poundperhour = sprintf("%05.f", getprop("/engines/engine[0]/fuel-flow-gph") );
  14. setprop("/engines/engine[0]/fuel-flow-pph/unit10000", chr(poundperhour[0]));
  15. setprop("/engines/engine[0]/fuel-flow-pph/unit1000", chr(poundperhour[1]));
  16. setprop("/engines/engine[0]/fuel-flow-pph/unit100", chr(poundperhour[2]));
  17. setprop("/engines/engine[0]/fuel-flow-pph/unit10", chr(poundperhour[3]));
  18. setprop("/engines/engine[0]/fuel-flow-pph/unit1", chr(poundperhour[4]));
  19. var FuelDensity=props.globals.getNode("consumables/fuel/tank[0]/density-ppg",1).getValue();
  20. if(FuelDensity == nil){FuelDensity = 6.72};
  21. var pph=getprop("/engines/engine[1]/fuel-flow-gph");
  22. if(pph == nil){pph = 0.0};
  23. setprop("/engines/engine[1]/fuel-flow-gph", pph * FuelDensity );
  24. var poundperhour = sprintf("%05.f", getprop("/engines/engine[1]/fuel-flow-gph") );
  25. setprop("/engines/engine[1]/fuel-flow-pph/unit10000", chr(poundperhour[0]));
  26. setprop("/engines/engine[1]/fuel-flow-pph/unit1000", chr(poundperhour[1]));
  27. setprop("/engines/engine[1]/fuel-flow-pph/unit100", chr(poundperhour[2]));
  28. setprop("/engines/engine[1]/fuel-flow-pph/unit10", chr(poundperhour[3]));
  29. setprop("/engines/engine[1]/fuel-flow-pph/unit1", chr(poundperhour[4]));
  30. # =========================
  31. # Course for HSI by Helijah
  32. # =========================
  33. var rsd = sprintf("%03.f", getprop("/instrumentation/nav[1]/radials/selected-deg") );
  34. setprop("/instrumentation/nav[1]/radials/rsd/val100", chr(rsd[0]));
  35. setprop("/instrumentation/nav[1]/radials/rsd/val10", chr(rsd[1]));
  36. setprop("/instrumentation/nav[1]/radials/rsd/val1", chr(rsd[2]));
  37. # ==========================
  38. # Heading for HSI by Helijah
  39. # ==========================
  40. var dist = sprintf("%04.f", getprop("/instrumentation/tacan/indicated-distance-nm") );
  41. setprop("/instrumentation/tacan/dist/val1000", chr(dist[0]));
  42. setprop("/instrumentation/tacan/dist/val100", chr(dist[1]));
  43. setprop("/instrumentation/tacan/dist/val10", chr(dist[2]));
  44. setprop("/instrumentation/tacan/dist/val1", chr(dist[3]));
  45. settimer(loop, 0);
  46. }
  47. loop();