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.

xml - what am I doing wrong?

Featured Replies

A little section of code for another one of my gauges. Trying to display 1 of 4 images based on a value range. Found that dividing the ADF1 Signal by 180 gives about the right distance for each of the imgaes to display. Also found that using "div" verus "/" gives whole number with no fraction. Used String to display and results look good 0,1,2,3,4 and so on... But with the following only the "RH_Sig0.bmp" will display..?? ((A:ADF1 SIGNAL, enum) 180 div)Qustion; Can "Case Value =" support conditonal ranges? ex: Case Value= "0 = ! 140 %lt"Many thanks....

  • Commercial Member

I'd probably have to test this to get it right, but as I recall, the maximum value of a signal strength is 256, so dividing that by 180 is going to give you a maximum value of 1 with rounding. Try dividing by 64 instead of 180. Also, try using (A:ADF1 signal, NUMBER), instead of ENUM.I'd say you're problem probably stems from rounding in any case. If you're only getting Sig0 to display it means you're only getting a 0 result. When you display your string for testing purposes, make sure you're displaying the value as an integer.--Jon

  • Commercial Member

Oh, the second part of your question about the value of "case". You cannot use arguments there as far as I know.--Jon

Thanks so much for the reply - The ADF max singal is 50,000 and the range from 0 to 255 is no or poor signal. Anything 256 and above is a good signal. With the following; %((A:ADF1 SIGNAL, enum) 180 div)%!06.2f!I can watch the signal level change as I move from the NDB. I tried other values to dive by but 180 is about the best to give me 4 equal points along the signal path.I also tried using "number" instead of "enum", but same result. Rounding should not be a problem with using "div" since it returns only a whole number. Still stuck....??

Not tested, but you can try to use (A:ADF1 SIGNAL, enum) 180 div 0 > (A:ADF1 SIGNAL, enum) 180 div 1 < && (A:ADF1 SIGNAL, enum) 180 div 1 > (A:ADF1 SIGNAL, enum) 180 div 2 < &&Hope it helps,Jan"Beatus Ille Procul Negotiis"

Jan

 

 

 

"Beatus ille qui procul negotiis..."

Thank you so much for the help from both of you, I now have it working correctly!! Removing the extra parentheses did the trick, but in the case of the statement, both sets of parentheses are still needed. If you remove the parentheses like that in the statement the display shows some like "%!06.2f!". After final tweaking found that a value of "144 div" results in the following singal; (@3000')image0 (grayed out,no signal) >36 miles from NDBimage1 (one colored bar on) 36 to 31 miles from NDBimage2 (two colored bars on) 30 to 21 miles from NDBimage3 (three colored bars on) 20 to 15 miles from NDBimage4 (all 4 colored bars on) <15 miles from NDB-----------------------;-)Any Landing You can Walk Away from is a Good Landing!!!!

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.