stbyai_page.nas 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. #
  7. var ALTFACTOR2 = (651-464)/400;
  8. var FPS2FPM = 60;
  9. var SHIFT_THRES = 0.5;
  10. var ROT_THRES = 0.1;
  11. var STBYALTPOS = [-3, -2, -1, 0, 1 ,2, 3, 4];
  12. if (!defined("Rosenumerals"))
  13. io.include(HELIONIXPATH ~ "Nasal/fnd_func.nas");
  14. page_setup["stbyai"] = func (i) {
  15. p = mfd[i].add_page("stbyai", HELIONIXPATH~"svg/stbyai.svg");
  16. # alt tape generation
  17. generateAltLadder(p, pitch=ALTFACTOR2*100, post500=0);
  18. # move speed and fli tapes, animate ai elements
  19. # ============================
  20. p.add_direct("horizon", adc.pitch, func(o,c) o.setTranslation(0, math.clamp(adc.pitch.val, -90, 90)*3.6*2));
  21. p.add_direct("horizon", adc.roll, func(o,c) o.setRotation(-adc.roll.val*D2R,c[0],c[1]) );
  22. p.add_direct("horizonNums", adc.pitch, func(o,c) o.setTranslation(0, math.clamp(adc.pitch.val, -90, 90)*3.6*2));
  23. p.add_direct("horizonNums", adc.roll, func(o,c) o.setRotation(-adc.roll.val*D2R,c[0],c[1]) );
  24. p.add_direct("Alt_Group", adc.alt, func(o,c) o.setTranslation(0, adc.alt.val*ALTFACTOR2*2));
  25. p.add_direct("speedtape", adc.ias, func(o,c) o.setTranslation(0, math.clamp(adc.ias.val, -20, 350) *3.19*2));
  26. p.add_direct("rollPointer", adc.roll, func(o,c) o.setRotation(-adc.roll.val*D2R,c[0],c[1]) );
  27. p.add_direct("slipSkid", adc.slipskid, func(o,c) o.setTranslation( adc.slipskid.val*-25, 0) );
  28. p.add_text("qnh", {sensor: adc.qnhDisplay });
  29. }; # func