gr8guitar Posted June 19, 2016 Report Posted June 19, 2016 Hello. has anyone ever developed an XML gauge that can read/write to FSUIPC offsets? I particularly use (66C0, etc but only 4 can be seen when logging) would prefer to make a gauge, if it's possible.
Pete Dowson Posted June 20, 2016 Report Posted June 20, 2016 I don't know if that's possible or not -- I don't know XML nor how gauges are written with them. However, i think you can read and write local panel variables (L:Vars) in XML gauges, right? FSUIPC can also read and write L:Vars, even (with a recently added facility) through the offset interface too. So, you could either change your 66C0 etc using methods to use L:Vars, or have a little Lua plug-in with copies 66C0 etc changes to L:Vars and vice versa, Pete
gr8guitar Posted June 20, 2016 Author Report Posted June 20, 2016 Well XML gauges are okay, have to use RPN logic, awkward for me to keep straight in my head. It is computer memory-efficient though. So, yes, I suppose I'll have to go back to lua's. I tried to avoid those - if possible but "one must do what one must do. Thanks for your reply.
Pete Dowson Posted June 20, 2016 Report Posted June 20, 2016 1 hour ago, gr8guitar said: I suppose I'll have to go back to lua's. Unless whatever it is you have using offset 66C0 etc can be changed to use the offsets which read and write L:Vars. Pete
Gypsy Baron Posted June 21, 2016 Report Posted June 21, 2016 gr8guitar, Here is an example of a small Lua script I use to read the VAS data at offset 0x024C and store it to an L:Var. I then use that L:Var in an XML gauge to display the current VAS so that I have a constant readout while flying. The display will change color from white text to red text when VAS gets below a pre-set amount. When VAS gets below 500000 the Lua script will display the low value as well as the XML display turning 'red'. ======================================================================= function VAS(control, vas) vas_in = ipc.readUD(0x024C) ipc.writeLvar("L:VAS", vas_in) if vas_in < 500000 then ipc.display("VAS = "..vas_in,2) end end event.offset(0x024C,"UW","VAS") ===================================================== The XML code is here, which is part of a gauge that I created to do a number of things. Just the VAS postion is shown here. The BMP is just a rectangle with labels, etc for the various items that I display. <Gauge Name="DME" Version="1.0"> <!-- Version 1.2 29 November 2012 P.D. Strogen --> <!-- Fixed the relative bearing drift correction code 11/24/12 --> <!-- Added red outline when the Norden Alert Light is triggered 11/27/12 --> <!-- Added Alarm Bell and Gear Lamp to the Alert state 11/29/12 --> <!-- Added conditional statement for drift calculation 12/30/12 --> <Image Name="Dual_DME_Background.bmp"/> //========================== DISPLAY VAS =================================== <Element> <Visible>(L:VAS, number) 499999 > </Visible> <Position X="25" Y="138"/> <Text X="80" Y="12" Length="8" Fixed="Yes" Font="arial" Adjust="Left" VerticalAdjust="Top" Color="#EAEAEA" Bright="Yes"> <String>%((L:VAS, number))%!07d!</String> </Text> </Element> <Element> <Visible>(L:VAS, number) 500000 <</Visible> <Position X="25" Y="138"/> <Text X="80" Y="12" Length="8" Fixed="Yes" Font="arial" Adjust="Left" VerticalAdjust="Top" Color="#FF0000" Bright="Yes"> <String>%((L:VAS, number))%!07d!</String> </Text> </Element> </Gauge> ==================================================== The Lua -> XML process is pretty straight forward. You can do all your necessary calculations in the Lua script or later, in XML. Paul
gr8guitar Posted June 27, 2016 Author Report Posted June 27, 2016 Hello Gypsy Baron. Sorry I didn't get back sooner. I don't know if you had to re-install FS but it's a hassle. I have many USB devices but of course, they don't install in the same order of the previous computer. I do have a software that allows re-assignment but even though I copied the fs9.cfg to the new computer, I still had to delete all the assignments of all the buttons and axes, re-install purchased products, etc. - ugh. Thank you for your time and information. I will see about applying that information for my usage. I used the 66C0, etc very simplistically, as I try to do everything else. I use one rotary switch to cycle the 66CX's values for selection of panel windows, gauges, buttons, ATC reply and then use another rotary switch to activate as needed using the lua's.
Pete Dowson Posted June 27, 2016 Report Posted June 27, 2016 11 minutes ago, gr8guitar said: I have many USB devices but of course, they don't install in the same order of the previous computer. I do have a software that allows re-assignment but even though I copied the fs9.cfg to the new computer, I still had to delete all the assignments of all the buttons and axes Best to enable the joy letters facility so that FSUIPC can identify them by name in future. Pete
gr8guitar Posted June 28, 2016 Author Report Posted June 28, 2016 True, but once I re-ordered USB game controllers, FSUIPC ran fine with the FSUIPC.ini I had transferred. I found the program a few years ago, free - somewhere. It's called JoyIDsInstall.exe. It's good for other programs I have that use the game controllers.
Pete Dowson Posted June 28, 2016 Report Posted June 28, 2016 5 hours ago, gr8guitar said: JoyIDsInstall.exe Thanks. I don't know that one. I'll look that one up. There is a JoyIds.exe program I recommend for those moving to Win10 where some drivers (Saitek predominantly) don't put the full information in the Registry which FSUIPC needs. I refer to it with a link in the FAQ thread entitled Fixing joystick connections not seen by FSUIPC. That can be used too, to change IDs around to match whatever you used to have. However, it is easier to let FSUIPC sort it ot for you if possible. And another advantage of using letters for Ids instead of numbers is that you can assign your own more meaningful ones, like T for Throttle, Y for Yoke, R for Rudders. Pete
gr8guitar Posted July 6, 2016 Author Report Posted July 6, 2016 Hello. Actually, we are discussing the same program (following your URL - please see attached pic). Yes, It's a good one. Many other programs do not have a "FSUIPC" to make life easier - wouldn't know what to do with out it.
gr8guitar Posted October 3, 2016 Author Report Posted October 3, 2016 Update: Thanks to Gypsy Baron's information, I was able to make a gauge that displays offsets like 66C0, etc. Even though it added more lua's and xml's, it's cleaner than using ipc.display and/or using FSUIPC's logging of the offsets. Although it did work and I used it for many years, the gauge is nicer and can be placed as desired. So again, thanks.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now