Sign in to follow this  
phjvh

Question for Arne (or anyone else who can help!)

Recommended Posts

I am wanting to take a "scratchpad" entry from a keypad and translate it to BCD to be used with a COM1_SET in a C gauge.Since I am using Easy Gauge, I don't have access to the math.h HornerScheme function, but can supply my own callback function.Can someone please let me know what the format would be? I cannot 'translate' the XML equivalent (I'm can't parse it!) :((L:NAV,number) 100 * 10000 % int d 10 % r 10 / int d 10 % r 10 / int d 10 % r 10 / int 16 * + 16 * + 16 * + (>K:NAV1_RADIO_SET) }BillAVSIM OmbudsmanFounder and Director,Creative Recycling of Aircraft Partshttp://catholic-hymns.com/frbill/FS2002/images/fartslogo.jpg

Share this post


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

123.45ABC.DEbcd = (B 8);bcd += (D << 4);bcd += E;trigger_key_event(KEY_COM_RADIO_SET, bcd);That should do it. You just have to use each digit seperatly.Matt

Share this post


Link to post
Share on other sites

Thanks Matt! That should do the trick nicely!I want to use the keypad on an FMC to allow for direct entry of frequencies from the "scratchpad" on the bottom line of the display, then click on Enter to shove it into the selected Com or Nav slot.BillAVSIM OmbudsmanFounder and Director,Creative Recycling of Aircraft Partshttp://catholic-hymns.com/frbill/FS2002/images/fartslogo.jpg

Share this post


Link to post
Share on other sites

That's exactly what I do with my F-16 panel. The user types in the new frequency, hits enter, and it sets the radios to the new one.Matt

Share this post


Link to post
Share on other sites

>That's exactly what I do with my F-16 panel. The user types>in the new frequency, hits enter, and it sets the radios to>the new one.That's a cool feature. How difficult was it to set up the keypad for direct entry?Lonny had it coded for his attempt, but couldn't master how to use the KEY_SET properly.I knew how to do the decimal &gt BCD conversion in XML, but not in C...Thanks again!BillAVSIM OmbudsmanFounder and Director,Creative Recycling of Aircraft Partshttp://catholic-hymns.com/frbill/FS2002/images/fartslogo.jpg

Share this post


Link to post
Share on other sites

I have a variable that stores the new frequency, like 12345, and another that stores the position I'm editing, like 1000 for the 2. When the user pushes, say 3, it multiplies 3 by what position I'm editing. So if I have 12000, it adds to it (3 * 100), so I get 12300. Then dividing the position by 10, so it adds the next one in the correct spot. When they hit enter, it divides by 100 to get 123.45 and then converts it to BCD and sets it. ;-)Pretty simple really.new_value += (DIGIT)*position;position /= 10;Matt

Share this post


Link to post
Share on other sites

Hallo,A small remark.I never used a FMC since Aerowinx 747-400.To my surprise a discussion is going on about the FMC.Myself busy to create one in xml.Not finished of course, but let me tell, what is possible at the moment:The FMC flyes the aircraft to ANY point on Earth, with SID, STAR, Approach and 95% "safe" Autoland.With LNAV, VNAV and FLCH switches on the MCP it sets the different speeds, flap- and spoiler settings, headings and altitudes, using parameters as Position, Time off the Day, Sun Angle, Restrictions, Weight, Amount of Fuel and Trans Alt.In the "Scratchpad" it is possible to type the 4 letter ICAO codes of Airports and the Frequency's of Navaids; pressing EXEC sets the Route and/or Radios.Enroute it is a matter of one click, to divert to an alternate or a next waypoint.After passing a waypoint the radios for the next are automatically set as of course speed, heading and altitude.It is possible to choose a Destination and fly direct, great circle route, or to fly a "Company Route" along known navaids.Well, it's a lot of fun to be busy to create the FMC.To make all the buttons work as real as possible.Most work is filling the databases with flightplans, navaids, Lat/Lons etc.But now the bad thing!:Even with things working as at present, the only thing left for me, after setting up the FMC (less than 10 clicks), is pressing TOGA and go to bed and see next morning that everything is OK.So my conclusion is:"Lots of pleasant hours in creating the thing, a good night sleep while using it"!Still going strong.Jan "Procul Negotiis"

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