Advertisement
Guest User

Untitled

a guest
Mar 28th, 2015
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.81 KB | None | 0 0
  1. 19c19
  2. < var svg_keys = ["LindSpeed","SpeedNonLint","SpeedLastDigitLint", "Horizon","bankPointer","bankPointerLineL", "bankPointerLineR","Compass","AltNonLintBig","AltNonLintSmall","AltLint","SlipSkid","CompassText","VSI","VSIText","PitchScale","HorizonLine"];
  3. ---
  4. > var svg_keys = ["LindSpeed","SpeedNonLint","SpeedLastDigitLint", "Horizon","bankPointer","bankPointerLineL", "bankPointerLineR","Compass","AltNonLintBig","AltNonLintSmall","AltLint","SlipSkid","CompassText","VSI","VSIText","HorizonLine", "PitchScale"];
  5. 22,27c22,27
  6. < m[key] = {};
  7. < m[key].Element = pfd.getElementById(key);
  8. < m[key].Element.updateCenter();
  9. < m[key].center = m[key].Element.getCenter();
  10. < m[key].roll = m[key].Element.createTransform();
  11. < m[key].pitch = m[key].Element.createTransform();
  12. ---
  13. > m[key] = nil;
  14. > m[key] = pfd.getElementById(key);
  15. > m[key].updateCenter();
  16. > m[key].trans = m[key].createTransform();
  17. > m[key].rot = m[key].createTransform();
  18. >
  19. 32,35c32,34
  20. <
  21. < m.bankPointerLineL.Element.set("clip", "rect(0,1024,768,459.500)");
  22. < m.bankPointerLineR.Element.set("clip", "rect(0,459.500,768,0)");
  23. < m.PitchScale.Element.set("clip", "rect(134,590,394,330)");
  24. ---
  25. > m.bankPointerLineL.set("clip", "rect(0,1024,768,459.500)");
  26. > m.bankPointerLineR.set("clip", "rect(0,459.500,768,0)");
  27. > m.PitchScale.set("clip", "rect(134,590,394,330)");
  28. 40,60c39,61
  29. < updateAi: func(Roll,Pitch){
  30. < #offset = 392.504021806/2;
  31. < offset = 10;
  32. < #if(Pitch < 1.3962634)
  33. < #{
  34. < # Pitch = 1.3962634;
  35. < #}
  36. < #elsif (Pitch > -1.3962634)
  37. < #{
  38. < # Pitch = 1.3962634;
  39. < #};
  40. < RollR = -Roll*D2R;
  41. <
  42. < Bpc = me.bankPointer.Element.getCenter();
  43. < me.bankPointer.roll.setRotation(RollR, Bpc);
  44. < me.bankPointerLineL.roll.setRotation(RollR, Bpc);
  45. < me.bankPointerLineR.roll.setRotation(RollR, Bpc);
  46. <
  47. < me.Horizon.roll.setRotation(RollR, Bpc);
  48. < me.HorizonLine.roll.setRotation(RollR, Bpc);
  49. < me.PitchScale.roll.setRotation(RollR, Bpc);
  50. ---
  51. > updateAi: func(roll,pitch){
  52. > if (pitch > 80 )
  53. > {
  54. > pitch = 80;
  55. > }
  56. > elsif(pitch < -80)
  57. > {
  58. > pitch = -80;
  59. > }
  60. >
  61. > RollR = -roll*D2R;
  62. >
  63. > me.Horizon.rot.setRotation(RollR, me.PitchScale.getCenter());
  64. > me.Horizon.trans.setTranslation(0,pitch*6.8571428);
  65. > me.HorizonLine.rot.setRotation(RollR, me.PitchScale.getCenter());
  66. > me.HorizonLine.trans.setTranslation(0,pitch*6.8571428);
  67. > me.PitchScale.rot.setRotation(RollR, me.PitchScale.getCenter());
  68. > me.PitchScale.trans.setTranslation(0,pitch*6.8571428);
  69. >
  70. > brot = me.bankPointer.getCenter();
  71. > me.bankPointer.rot.setRotation(RollR,brot);
  72. > me.bankPointerLineL.rot.setRotation(RollR,brot);
  73. > me.bankPointerLineR.rot.setRotation(RollR,brot);
  74. 62d62
  75. < print(Bpc);
  76. 65,66c65,66
  77. < me.bankPointerLineL.Element.set("clip", "rect(0,1,1,0)"); #459,500
  78. < me.bankPointerLineR.Element.set("clip", "rect(0,459.500,768,0)");
  79. ---
  80. > me.bankPointerLineL.set("clip", "rect(0,1,1,0)"); #459,500
  81. > me.bankPointerLineR.set("clip", "rect(0,459.500,768,0)");
  82. 70,71c70,71
  83. < me.bankPointerLineL.Element.set("clip", "rect(0,1024,768,459.500)"); #459,500
  84. < me.bankPointerLineR.Element.set("clip", "rect(0,1,1,0)");
  85. ---
  86. > me.bankPointerLineL.set("clip", "rect(0,1024,768,459.500)"); #459,500
  87. > me.bankPointerLineR.set("clip", "rect(0,1,1,0)");
  88. 75,76c75,76
  89. < me.bankPointerLineL.Element.set("clip", "rect(0,1024,768,459.500)"); #459,500
  90. < me.bankPointerLineR.Element.set("clip", "rect(0,459.500,768,0)");
  91. ---
  92. > me.bankPointerLineL.set("clip", "rect(0,1024,768,459.500)"); #459,500
  93. > me.bankPointerLineR.set("clip", "rect(0,459.500,768,0)");
  94. 78,80d77
  95. < me.Horizon.pitch.setTranslation(0,Pitch*offset);
  96. < me.HorizonLine.pitch.setTranslation(0,Pitch*offset);
  97. < me.PitchScale.pitch.setTranslation(0,Pitch*offset);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement