Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Help wanted with delay code for a XML gauge

Featured Replies

Hi all,I

Hi, You can build in a timer.May be this one works:(A:general eng2 propeller lever position,part) 0.04 + 0.75 > if{ (P:Absolute Time, seconds) 5 + (>L:timer,number) (G:Var1) 0 == if{ 1 (>G:Var1) 1 (>L:dsd_xml_sound_id_20,number) } } els{ 0 (>G:Var1) }(A:general eng2 propeller lever position,part) 0.04 + 0.90 < if{ (G:Var3) 0 == (P:Absolute Time, seconds) (L:timer,number) > and if{ 1 (>G:Var3) 0 (>L:dsd_xml_sound_id_20,number) 1 (>L:dsd_xml_sound_id_21,number) } } els{ 0 (>G:Var3) }Jan"Beatus Ille Procul Negotiis"

Jan

 

 

 

"Beatus ille qui procul negotiis..."

Hi Dirk,If your problem is that one sound should be started when another is completed, you can solve that much simpler.If you start a sound (single shot) by setting the appropriate variable to "1", Dougs XMLsound gauge will set that variable back to "0" if the sound has completed playing. So just test for that.It's easier, and will even work OK if you decide to change the soundfiles (and duration) without the need to change the timer in the XML code.Cheers, Rob

Hi Jan, Thanks for your help.This is jus what I was looking for.I will try your code and comment.Kind Regards.Dirk Trotteyn (SANT)

Hi Rob,Thanks for your help.What I

Hi Jan, I tested your timer code. Needed change the position of '(P:Absolute Time,seconds) 5 + (>L:timer,number)', coz it was outside the (G:Var1).. 'do it once' control, and the L:timer was continued updated (in the first tag).--- (A:general eng2 propeller lever position,part) 0.04 + 0.75 > if{ (G:Var1) 0 == if{ (P:Absolute Time, seconds) 5 + (>L:timer,number) 1 (>G:Var1) 1 (>L:dsd_xml_sound_id_20,number) } } els{ 0 (>G:Var1) }------(A:general eng2 propeller lever position,part) 0.04 + 0.90 > if{ (G:Var2) 0 == (P:Absolute Time, seconds) (L:timer,number) > && if{ 1 (>G:Var2) 2 (>L:dsd_xml_sound_id_21,number) 0 (>L:dsd_xml_sound_id_20,number) } } els{ 0 (>G:Var2) }---This works OK! And do what I need to do in my gauge.Thanks again for your help and for your time.Kind Regards.Dirk Trotteyn (SANT)

  • 8 months later...

This topic appears to have been dead for a while but is exactly what I am trying to implement in my MFD.I am trying to build in the Built-In-Test function, which requires the MFD to scroll through 8 coloured screens at 1 sec intervals, then the last screen is shown for 2 seconds then returns to the original page.I am happy with setting up variables etc for it, but I am wondering if anyone can offer any light on an easy way to cycle through the images. I am NOT sure of how to use Update cycles yet - I am getting there slowly though.Thanks in advance guys.taipan

Hi,You could experiment with:(G:Var1) 0 == if{ (P:Absolute time,seconds) 2 + (>G:Var2) 1 (>G:Var1) } (G:Var1) 1 == (P:Absolute time,seconds) (G:Var2) > and if{ (P:Absolute time,seconds) 2 + (>G:Var2) 2 (>G:Var1) } (G:Var1) 2 == (P:Absolute time,seconds) (G:Var2) > and if{ (P:Absolute time,seconds) 2 + (>G:Var2) 3 (>G:Var1) } (G:Var1) 3 == (P:Absolute time,seconds) (G:Var2) > and if{ (P:Absolute time,seconds) 2 + (>G:Var2) 4 (>G:Var1) } (G:Var1) 4 == (P:Absolute time,seconds) (G:Var2) > and if{ 5 (>G:Var1) } etc. etc.(G:Var1)etc. etc.Jan"Beatus ille qui procul negotiis..."

Jan

 

 

 

"Beatus ille qui procul negotiis..."

Thanks Jan,I'll give it a go and get back to you with the results.Cheers.taipan

Jan, no joy mate.If I tried to use an block here, would it simply be a case of removing the and and replacing with ?? Can I set a speed using Frequency=" " ??Cheers for your time.

You could try:(G:Var1) 0 == if{ (P:Absolute time,seconds) 2 + (>G:Var2) 1 (>G:Var1) } (G:Var1) 1 == (P:Absolute time,seconds) (G:Var2) > and if{ (P:Absolute time,seconds) 2 + (>G:Var2) 2 (>G:Var1) } (G:Var1) 2 == (P:Absolute time,seconds) (G:Var2) > and if{ (P:Absolute time,seconds) 2 + (>G:Var2) 3 (>G:Var1) } (G:Var1) 3 == (P:Absolute time,seconds) (G:Var2) > and if{ (P:Absolute time,seconds) 2 + (>G:Var2) 4 (>G:Var1) } etc. etc.somewhere back to 0!(G:Var1)etc. etc.Jan"Beatus ille qui procul negotiis..."

Jan

 

 

 

"Beatus ille qui procul negotiis..."

<>

Hi Jan,This works, but only displays the first image. I can't be sure, but I don't think the gauge is even acknowledging the block, and it is just going straight to the block for (G:Var8) = 0.Here is my code. The first is the overarching page in the MFD, the next one is the MFD background for the Built In Test page, and the next Element, which we are dealing with, it for the MFD test function, which is activated using the L varb (L:Lbit_MFD, bool) being 1.Any thoughts? I am probably doing something obviously wrong!(L:Lpage_select, enum) 1100 >= (L:Lpage_select, enum) 1199 <= &&(L:Lbit_MFD, bool) 0 ==(L:Lbit_MFD, bool) 1 ==(G:Var8) 0 == if{ (P:Absolute time, seconds) 2 + (>G:Var9) 1 (>G:Var8) } (G:Var8) 1 == (P:Absolute time, seconds) (G:Var9) > && if{ (P:Absolute time, seconds) 2 + (>G:Var9) 2 (>G:Var8) } (G:Var8) 2 == (P:Absolute time, seconds) (G:Var9) > && if{ (P:Absolute time, seconds) 2 + (>G:Var9) 3 (>G:Var8) } (G:Var8) 3 == (P:Absolute time, seconds) (G:Var9) > && if{ (P:Absolute time, seconds) 2 + (>G:Var9) 4 (>G:Var8) } (G:Var8) 4 == (P:Absolute time, seconds) (G:Var9) > && if{ (P:Absolute time, seconds) 2 + (>G:Var9) 5 (>G:Var8) } (G:Var8) 5 == (P:Absolute time, seconds) (G:Var9) > && if{ (P:Absolute time, seconds) 2 + (>G:Var9) 6 (>G:Var8) } (G:Var8) 6 == (P:Absolute time, seconds) (G:Var9) > && if{ (P:Absolute time, seconds) 2 + (>G:Var9) 7 (>G:Var8) } (G:Var8) 7 == (P:Absolute time, seconds) (G:Var9) > && if{ (P:Absolute time, seconds) 2 + (>G:Var9) 0 (>G:Var8) 0 (>L:Lbit_MFD, bool) } (G:Var8)and so on up to Case Value = 7..Any thoughts?

Hi,Put the update section at the top of the gauge, not in an element.(Didn't check the code)So:(G:Var8) 0 == if{ (P:Absolute time, seconds) 2 + (>G:Var9) 1 (>G:Var8) } (G:Var8) 1 == (P:Absolute time, seconds) (G:Var9) >&& if{ (P:Absolute time, seconds) 2 + (>G:Var9) 2 (>G:Var8) } (G:Var8) 2 == (P:Absolute time, seconds) (G:Var9) >&& if{ (P:Absolute time, seconds) 2 + (>G:Var9) 3 (>G:Var8) } (G:Var8) 3 == (P:Absolute time, seconds) (G:Var9) >&& if{ (P:Absolute time, seconds) 2 + (>G:Var9) 4 (>G:Var8) } (G:Var8) 4 == (P:Absolute time, seconds) (G:Var9) >&& if{ (P:Absolute time, seconds) 2 + (>G:Var9) 5 (>G:Var8) } (G:Var8) 5 == (P:Absolute time, seconds) (G:Var9) >&& if{ (P:Absolute time, seconds) 2 + (>G:Var9) 6 (>G:Var8) } (G:Var8) 6 == (P:Absolute time, seconds) (G:Var9) >&& if{ (P:Absolute time, seconds) 2 + (>G:Var9) 7 (>G:Var8) } (G:Var8) 7 == (P:Absolute time, seconds) (G:Var9) >&& if{ (P:Absolute time, seconds) 2 + (>G:Var9) 0 (>G:Var8) 0(>L:Lbit_MFD, bool) } Codeetc.Jan"Beatus ille qui procul negotiis..."

Jan

 

 

 

"Beatus ille qui procul negotiis..."

Hey Jan, it worked!Sorry, I should have told you the layout before hand. I probably also could have solved that myself looking at the DTD couldn't I.Thanks again mate, I am really indebted to you.taipan_daz.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.