Jump to content
The simFlight Network Forums

FSUIPC offsets in a gauge


Recommended Posts

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

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

 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 &gt; </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 &lt;</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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

 

 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...

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.

 

Link to comment
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
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.