Sign in to follow this  
spokes2112

Number-buttons working in xml-gauge?

Recommended Posts

Hello there!I have a question about the possibilities to use number-buttons. What I intend is to have a Up Front Controller (UFC) where I can adjust frequencies and autopilot. The gauge I design for a Pilatus PC-21 panel will resemble the original's "CMC Electronics CMA-9000 Flight Management System" (see attached graphic and - still unfinished - cab-file):A top 'screen' will display and control Com1, Nav1 and DMA1 info and on two lower screens additional info (Com2, Nav2, AD; XPDR,...) will be displayed and adjusted. The buttons between the displays will select Autopilot and the Adio for coms and nav radios. The green buttons left and right of the lower displays will toggle autopilot modes or standby frequencies.With the great help of the wonderful people here in the forum I've now successfully managed to get those three displays working and some of the action areas are also ready.Now my problem: I am wondering wheter it is possible to get the 'number buttons' to work?Let me explain: I once saw a gau-gauge where clicking on numbered buttons in sequence adjusted the transponder: so for a Transponder code "1200" I'd just have to click the corrsponding numbers on the buttons, "1", "2", "0", "0" - very comfortable...Also, I would be interested in using the +/- buttons to increase/decrease a value. I haven't so far found anything there in the forum which might point me in the right directon. So I don't know if this actually can be done for xml-gauges - but then maybe I'm just looking for the wrong thing, ignorant xml-beginner that I am...Is it possible to program an xml-gauge so that I can first click on a displayed value (e.g. the ADF frequency) and then click on the number buttons to enter the desired frequency? And would that only be linked to a single value or could I use the same number buttons to enter numbers in any field? Like click on ADF and enter the frequency, then click on Nav1 and enter that frequency on the same buttons?Oh, and yet another question: In the gauge I have so far the C1 and N1 frequencies can be adjusted by clicking on the propper spots - nothing fancy here. I do however also like to use the mousewheel to incresae and decrease the values, but this only works partially: no matter wheter I am on a decrease or increase area, scrolling up results in WHOLE number to increase, scrolling down in FRACT number to decrease - and to make things even worse sometimes if I scroll over the NAV1 the COM1 changes!I compared my entries with corresponding entries of similar gauges which work, but can not see any difference. Does anyone have an idea where I go wrong?Sorry for bothering you with this long question and thanks for any info you might have!With kind regards from Switzerland,Markus

Share this post


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

Hi Marcus,You can try to search the File Library for a fs2004 transponder gauge called garmin_gtx330.zip. I think that xml gauge has the functionality with buttons that you are looking for.BrgdsEugen

Share this post


Link to post
Share on other sites

Markus, Numpad entry is possible.. works something like: It's kind of crude psuedo code like - hope you understand.-When first number is entered it goes into a user variable.-When second number is entered the user variable gets multipled by 10 then the pressed value gets added and then stored in the same user variable.- When the third number is entered the user variable gets multipled by 10 then the pressed value gets added and then stored in the same user variable.- On and on EX.. press 1 ---> Variable = 0 * 10 = 0 + 1 = 1 --> Variablepress 2 ---> Variable = 1 * 10 = 10 + 2 = 12 --> Variablepress 3 ---> Variable = 12 * 10 = 120 + 3 = 123 --> Variablepress 4 ---> Variable = 123 * 10 = 1230 + 4 = 1234 --> VariableNow comes the point of the decimal place.. There should be a variable to tell what side of the decimal place you are on --number, 0= whole number, any other number is a fractional part. The above will only work when number = 0Press the "." ( the decimal should only work if number = 0 ) that changes number from 0 ++ --> 1Now there's probably a mathematical formula to do this better ( Arne ?? ) but since you are only going to be using maybe up to 3 or 4 decimal places this will work.number = 0 ! if{press 5, ->> 10000 1000 100 10 4 case (number) / variable + -->variable ,, number ++ ->> numbersince "number" = 1 the 5 gets divided by 10 and added to variable, and the "number" is incremented.5 / 10 = 0.5 + variable ( 1234 ) = 1234.5 increment "number" from 1 to 2press 6, ->> 10000 1000 100 10 4 case (number) / variable + -->variable ,, "number" ++ ->> "number"since "number" = 2 the 6 gets divided by 100 and added to variable, and the "number" is incremented.6 / 100 = 0.06 + variable ( 1234.5 ) = 1234.56 increment "number" from 2 to 3 press 7, ->> 10000 1000 100 10 4 case (number) / variable + -->variable ,, "number" ++ ->> "number"since "number" = 3 the 7 gets divided by 1000 and added to variable, and the "number" is incremented.7 / 1000 = 0.006 + variable ( 1234.56 ) = 1234.567 increment number from 3 to 4 ( 4 max ) same thing for 8 to equal 1234.5678====================================================================When "clear" is pressed all variables get set to zero...Now to enter -When enter is pressed there are checks that need to be done before actually entering into FS. Some these may be independant as the buttons to the side of freqs. may be the select/enter buttons for each type. Donot really know how it works in real ops. Basicaly some/all below may have to be done depend on how it works. 1. See what mode you're in for entry2. Check to see if number in variable is a valid number for COMM, NAV, ADF etc.. If so got to three otherwise error....3. According to mode selected find what "Scheme" needed to convert your entered number into the proper format for direct entry. ( see XML facts at very top of Panel forum )4. Once checked, converted, go ahead and tell FS to change Freq.5. Reset all variables to zeroA boat load of other things should be checked also, primarily for display. IE when the keyboard entry shows, or the actual frequency tuned. The type of string for display IE !04d! or !6.3f! etc..====================================================================The best way to do all of this since it is a repeating procedure is to use the function. ( Only good for FS2004 )===================================================================As for your problem with increment decrement most likely you have overlapping s even a 1 pixel overlap will cause problems like you're describing. Another thing also, the wheel function is semi-automatic unless stated in the attribute. The area must be clicked first to activate that area, otherwise the previous area used will get adjusted by the wheel. This phenomena is hit/miss, best bet is to use WheelUp & WheelDown in the click type attribute..Hope this can help..Nice Project :-) Regards,Roman

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this