Archived

This topic is now archived and is closed to further replies.

spokes2112

Question....

Recommended Posts

Is there anyone who worked out a speed trend indicator in xml? Still coding on my Fokker PFD, but i really haven't got a clue how to create this one ( sadly math is not my strong point ;-) ) regards Gert Polkerman

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

My best untested guess would beIn FS9 XML...(L:switch to turn on and off_If Req'd,bool) 1 == (L:Lock out variable,bool) 0 == &&if{ (P:Absolute Time,seconds) 0.20 + (>L:trend_timer,seconds)(A:indicated airspeed, knots) (>L:speed sample1,number)1 (>L:Lock out variable,bool) }__________________________________________________________________(L:Lock out variable,bool) 1 == (L:trend_timer,seconds) (P:Absolute Time,seconds) > && if{ (A:indicated airspeed, knots) (>L:speed sample2,number)0 (>L:Lock out variable,bool) }__________________________________________________________________(Put any variables you want to deactivate the code here...like pitot heat blockage, failures, or even if the indicator is inactive below certain speeds or altitudes) if{ (L:speed sample1,number) (L:speed sample2,number) + 5 * (>L:trend value,number) }___________________________________________________________________in display gauge be sure to add a visible tag: (L:trend_timer,seconds) 0 !=So it should work like this:Check switch on and Lock out 0...if so...if{current time in seconds + 0.20 seconds = trend timer Current speed number sent to Speed sample1Set lock out variable to 1 }___________________________________________________________________Check if lock out is 1...which can only be done by the previous line...and trend timer is now 0.20 seconds in the future...if so...if{Send current speed to speed sample2 and set lock out back to 0 to restart cycle }____________________________________________________________________deactivation codes...if none found...if{ speed sample1 + speed sample2 X 5 = rate of change per second...Send the results to (L:Trend_Value, number) this is the shift on the speed tape.multiply the 5 by the number of seconds in the future you want the guage the show...for example to show the trend in ten seconds would be X 50. This is the simplest calculation of how many knots of change is expected. There are much more complex math solutions but I don't understand them myself.The basic idea here is if you are increasing airspeed by 0.20 knots per sample that is 1 knots per second...so 0.20 X 5 would render the prediction 1 knots faster 1 second from now. Likewise, 0.20 X 50 would render the prediction 10 knots faster 10 seconds from now.Hope that helps. I'm glad you asked the question because I am making a similar gauge and this post forced me to think it out in a simple way!Thanks

Share this post


Link to post
Share on other sites

Hello Try (L:Sel_1,number) 9 < if{ (L:Sel_1,number) ++ (>L:Sel_1,number) } els{ 0 (>L:Sel_1,number) }(L:Sel_1,number) 1 == if{ (A:Airspeed select indicated or true, knots) (>L:Sel_2,number) } (L:Sel_1,number) 9 == if{ (A:Airspeed select indicated or true, knots) (>L:Sel_3,number) } (L:Sel_1,number) 0 == if{ (L:Sel_3,number) (L:Sel_2,number) - 10 * (>L:SpeedTrend,number) }

Share this post


Link to post
Share on other sites

Here is another one, based on a 737 "bracket type" trend indicator with samples every 0.1 second computed for a 10 second trend. It was done for FS2002 so some things would have to be changed for your gauge, size, axis, ImageSizes=" " etc...(P:Local Time, seconds) 0.2 % 10 * int 0 == if{ (A:Airspeed indicated, knot) (>G:Var1) }(P:Local Time, seconds) 0.2 % 10 * int 1 == if{ (A:Airspeed indicated, knot) s1 (G:Var1) - 0.1 / 10 * l1 + (>G:Var3) }(G:Var3) (A:Airspeed indicated, knot) >(A:Airspeed indicated, knot) 45 < if{ 0 } els{ (G:Var3) (A:Airspeed indicated, knot) - }(G:Var3) (A:Airspeed indicated, knot) <(A:Airspeed indicated, knot) 45 < if{ 0 } els{ (G:Var3) (A:Airspeed indicated, knot) - } Regards,Roman

Share this post


Link to post
Share on other sites

Guys, Lots of thanx for showing the way, I will with your permission ofcourse use the examples to make it work in my fokker PFD. now..... going to work !!! regards Gert Polkerman

Share this post


Link to post
Share on other sites

At what rate is that clocking? Is that 3 times in one pass?I like short code lol

Share this post


Link to post
Share on other sites

I've "quoted" and "edited" Roman's original post to recover the XML script that's been "hidden" by the new forum software, and remove some extra "bits" that somehow snuck into the XML script... :(

Here is another one, based on a 737 "bracket type" trend indicator with samples every 0.1 second computed for a 10 second trend. It was done for FS2002 so some things would have to be changed for your gauge, size, axis, ImageSizes=" " etc...Regards,Roman
<Element>  <Select>	<Value>	  (P:Local Time, seconds) 0.2 % 10 * int 0 == if{ (A:Airspeed indicated, knot) (>G:Var1) }	</Value>  </Select></Element><Element>  <Select>	<Value>	  (P:Local Time, seconds) 0.2 % 10 * int 1 == if{ (A:Airspeed indicated, knot) s1 (G:Var1) - 0.1 / 10 * l1 + (>G:Var3) }	</Value>  </Select></Element><Element>  <Position X="0" Y="0"/>  <Visible>	(G:Var3) (A:Airspeed indicated, knot) >  </Visible>  <MaskImage Name="EADI_TREND_UP_MASK.bmp" Bright="Yes">	<Axis X="43" Y="89.5"/>  </MaskImage>  <Image Name="EADI_TREND_UP.bmp" Bright="Yes">	<Nonlinearity>	  <Item Value="2" X="5" Y="0"/>	  <Item Value="50" X="5" Y="90"/>	</Nonlinearity>  </Image>  <Shift>	<Value Minimum="2" Maximum="50">	  (A:Airspeed indicated, knot) 45 < if{ 0 } els{ (G:Var3) (A:Airspeed indicated, knot) - }	</Value>	<Delay PixelsPerSecond="10"/>  </Shift></Element><Element>  <Position X="0" Y="0"/>  <Visible>	(G:Var3) (A:Airspeed indicated, knot) <   </Visible>  <MaskImage Name="EADI_TREND_DN_MASK.bmp" Bright="Yes">	<Axis X="43" Y="89.5"/>  </MaskImage>  <Image Name="EADI_TREND_DN.bmp" Bright="Yes">	<Nonlinearity>	  <Item Value="2" X="5" Y="90"/>	  <Item Value="-50" X="5" Y="0"/>	</Nonlinearity>  </Image>  <Shift>	<Value Minimum="-50" Maximum="2">	  (A:Airspeed indicated, knot) 45 < if{ 0 } els{ (G:Var3) (A:Airspeed indicated, knot) - }	</Value>	<Delay PixelsPerSecond="10"/>  </Shift></Element>

Share this post


Link to post
Share on other sites