Sign in to follow this  
Guest Ron Freimuth

triggering a custom gauge by using an unused command

Recommended Posts

Hi!I have little experience in working with XML and gauges although I work with Flash programming and web design. I would very much appreciate some advice on a problem I am having!I am in the process of building a hardware panel for a SAAB 105, but there are a few custom electricity and fuel pump gauges that the designers has created. There are no default events for these, so I can't trigger these with a keyboard command. This means I can't get them to work with the hardware panels either. Unfortunately, I can't use Key2Mouse to circumvent this problem.However, I was thinking about a possible solution, where the gauges are modified so that they are looking for the status of another event, like water rudder, or concorde nose and visor or what ever event else that is available.Would this be possible, or do you have a better suggestion as to how this can be accomplished? Anyone willing to assist and advice in how to modify these two gauges?(L:FUELBOOST_L,bool)(L:FUELBOOST_L,bool) 0 == (A:TURB ENG1 N1, percent) 94 > && if{ (>K:MIXTURE1_LEAN) }(L:FUELBOOST_L, bool) ! (>L:FUELBOOST_L, bool)(L:UMFSW_I,bool)(A:Circuit general panel on, bool) (L:UMFSW_I, bool) && if{ 1 (>L:UMF_I, bool) } els{ 0 (>L:UMF_I, bool) }(L:UMFSW_I, bool) ! (>L:UMFSW_I, bool)Thanks!Roger

Share this post


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

I can send you a gauge which will read a block of 32 FSUIPC offsets and write the values read to 32 user specified XML L:variables. If you can make the hardware write into FSUIPC address space, this should solve your problem - you wouldn't have to find unused commands to trigger the gauges.Doug

Share this post


Link to post
Share on other sites

I would very much like to take a look at this gauge and try to figure out how to work with it, although I have to confess that I don't fully understand it now. I guess it gets easier when I have the gauge to look at!I have seen the offsets in FSUIPC, but never really understood what I could use them for. But I assume that using your gauge, I can attach a key or button to an offset that will trigger the variables in my gauges via your gauge. I will of course have to define my gauges in yours.The hardware is a simple MJoy16 circuit boards that are interpreted as joysticks. These will be attached to a bunch of switches on a GoFlight-compatible panel that I am in the process of building:http://www.paravoid.se/msfsprojects/panel12.jpghttp://www.paravoid.se/msfsprojects/chassi_v4.jpgPlease send the file to: roger.norling@paravoid.comThanks for taking the time to help! I really appreciate it!Roger

Share this post


Link to post
Share on other sites

Hi Roger,The solution that Doug proposes would be the best IMO.IF that's not an option for you: yes, what you propose is possible and easy solution.Especially if you use it for one specific aircraft.Note the following however: if a function (like Waterrudder or Afterburner) is not enabled for an aircraft, the result of the event will NOT be reflected in the corresponding A: variables.But instead, you can trap the event itself, which does work.Example: (G:Var1) ++ (>G:Var1) So G:Var1 is incremented for each TOGGLE_AFTERBURNER event, and you can test the value of G:Var1 in other code.Given a specific aircraft type, there are always a number of "unused" events available for that type. However, be carefull with the event you select, because some may given funny results.A "famous" example:Suppose you have a Cessna (or other one-engine non-jet engine).Triggering the events TOGGLE_AFTERBURNER, TOGGLE_AFTERBURNER2, TOGGLE_AFTERBURNER3 and TOGGLE_AFTERBURNER4 will work fine, but event TOGGLE_AFTERBURNER1 will crash FS2004.Regards, Rob Barendregt

Share this post


Link to post
Share on other sites

Thanks Rob for helping with this! I am getting more and more excited about building this simpit panel as everything is coming together. I am still amazed at all the friendly advice and help I have received in this project. Just wish I had a better grasp on programming XML-gauges.Best,Roger

Share this post


Link to post
Share on other sites

I'd love a copy, if possible. Sounds very interesting.Thanks,Glenngooseglas@wmconnect.com

Share this post


Link to post
Share on other sites

Hi Roger,"Just wish I had a better grasp on programming XML-gauges"Just DO it :-)We all had to begin somewhere, and learned these things by just doing it the trial-and-error way ....Success...Rob

Share this post


Link to post
Share on other sites

I know, but inbetween building this hardware panel, learning about circuit boards and electronics, writing reviews for FSNordic, repainting various addon aircraft, learning GMax and FSDS, running my own company and trying to keep the rest of the family happy there's so very little time left... The modifications for the FSQuality SAAB105 I made took me almost six months to complete. ;) Considering how much of my life this currently takes up, I fear one of these days I will experience a divine transformation into the physical embodiment of FS10, finally jumping the gap between this and the metaphysical world of virtual flying, leaving a small, silvery disc with a microsoft logo on it on my chair. I can almost feel it happening./Roger

Share this post


Link to post
Share on other sites

>I can send you a gauge which will read a block of 32 FSUIPC>offsets and write the values read to 32 user specified XML>L:variables. If you can make the hardware write into FSUIPC>address space, this should solve your problem - you wouldn't>have to find unused commands to trigger the gauges.>>Doug Doug, Would it be feasible to do a C gauge that reads a set of FS undocumented variables directly, then makes them available as L:Variables? Say a gauge that used an argument to define the starting offset into FS9. Then, each offset from 0x00 to 0xff. With some way to separate the different sets of base offsets that might be required. Say 0x1234:0x05. Further, could one write to the same, or a similar L:Variable and get it into the writable FS address space? Or, does FSUIPC handle reads and writes in a way more appropriate to FS address space? I have the list of discovered variables from FSInterrogate; there may be some useful ones I'd like to get my hands on! I also know the registered FSUIPC can be set with user defined key scans to trigger a variety of events. --- Further, can't FSUIPC access the JS output and make it available independently of the FS aileron, rudder, and trim commands? I've never written code for FSUIPC, but have skimmed the SDK. What I really need to do is be able to kill the JS Rudder input that goes to the rudder. But, add some rudder command to a Yaw Damper which I have already done in XML. My YD pretty much takes over the rudder movement, so I can't get pilot rudder movements into it. 'A:Rudder Pedal Position' doesn't help, since it's based on Rudder Deflection divided by 'Rudder deflection vs q'. Ron

Share this post


Link to post
Share on other sites

Ron,It is easy enough to make a gauge that will read a group of FSUIPC offsets and write the values found into L:Vars. That

Share this post


Link to post
Share on other sites

>Ron,>>It is easy enough to make a gauge that will read a group of>FSUIPC offsets and write the values found into L:Vars. That

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