June 19, 200421 yr 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....
June 20, 200421 yr 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 Jon Blum Vertical Reality Simulations
June 20, 200421 yr 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 Jon Blum Vertical Reality Simulations
June 20, 200421 yr 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....??
June 20, 200421 yr Try removing the enclosing parentheses ( ) ((A:ADF1 SIGNAL, enum) 180 div) (A:ADF1 SIGNAL, enum) 180 divRegards,Roman FS RTWR SHRS F-111 JoinFS Little Navmap
June 20, 200421 yr 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..."
June 20, 200421 yr 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