Jump to content
The simFlight Network Forums

Would love to display VAS usage in a gauge; can fsuipc help?


Recommended Posts

Hi,

 

1. First let me reiterate my profond respect and admiration from your backbone addon of fsx, without fsuipc there would not be any fsx simmer around.

 

2. as FSX OOM is sadly part of our daily simmer life, I am starting to fancy having a small gauge in fsx (and in my case either on my deportered GApanel cockpit or in a saitek fip) that would be displaying the fsx process memory usuage and blend nicely in the dashboard.

 

A solution I would suggest is to have an option in fsuipc that would overrite a hardly ever used fsx data with the mem usuage, so the new value can be trap by normal instruments (not sure I am clear) and displayed in the VC/FIP/Panel. As fsuipc is alrealdy monitoring this value (cf the DING from incoming OOM's death), this shouldnot be to much extre coding, but I may be wrong.

 

What do you think?

 

Regards,

 

Etienne

 

Link to comment
Share on other sites

FSUIPC already warns you with an audible and repeating warning sound when FSX is running out of memory (the amount to trigger the warning is user selectable via the ini, see the manual for details), why not simply use that to tell you when to save your flight. Better yet turn off the addons you are not using during your flight and don't get the OOM's at all.

Link to comment
Share on other sites

A solution I would suggest is to have an option in fsuipc that would overrite a hardly ever used fsx data with the mem usuag,

 

The amount of free memory, in kb, is already updated every 10 seconds in the offset 024C 32-bit integer). You could display it easily with a Lua plug-in, or, if you wish, try to overwrite something readable by gauges -- but most such are not writeable.

 

Incidentally, I don't really understand why OOMs are such a problem for some folks. There must be some really bad add-ons about with memory leaks. I've only ever had an OOM once, and that turned out to be a memory leak in one of my own private drivers.

 

Regards

Pete

Link to comment
Share on other sites

  • 1 month later...
  • 9 months later...

Thanks alot Pete for releasing the nice lua script that solve my issue through wideclient. It is nicely compatible with my panelbuilder cockpit which is great!

 

Some basis lua question, I dont seem to be able to format the vas and fps numbers through string.format, or do I do something wrong?

Would be nice to have a WND_DIGITAL_FONT (courier does the job though)

 

Also can fsuipc read the cpu and gpu temperature? those would be nice to display too in a similar manner.

 

Again, big thanks!

 

Etienne

Link to comment
Share on other sites

Here are a couple of VAS-related items. A quick & dirty Lua script to give you 'notice' when

the VAS is below a threshold that you can define as you like.

 

Also I include some XML code for a simple 2-D gauge to display VAS and when it drops below

a threshold, the normally white characters then turn red.

 

Read the comments and use as you wish. No guarantees or support :)

//==== A Lua Script to display VAS when it drops below threshold =======
//==== When the VAS value changes in offset 0x024C that event then =====
//==== triggers the function which then reads the offset and sends =====
//==== the current VAS to the L:Variable, L:VAS. The current value =====
//==== is then tested against an arbitrary threshold (500000 in my =====
/===== case and if the VAS is less than the threshold a small Lua  =====
//==== display opens on the FSX screen and displays the VAS for a  =====
//==== set time...2 seconds in the case below.                     =====
//==== To use this code, simply copy and paste it to a test file   =====
//==== and then save it as VAS.lua in your FSX modules folder.     =====
//==== You will also need to add it to the FSUIPC4.ini file [Auto] =====
//==== section so that is loaded and running when you start FSX.   =====
//====       [Auto]
//====       1=Lua KillAll
//====       2=Lua VAS
//====
//========== Paul "Gypsy Baron" Strogen August 05, 2014 ================

function VAS(control, vas)

<!-- The line below defines the position and size of the Lua display window -->
<!-- Adjust the values to suit your needs. I use the display for several other -->
<!-- Multi-line outputs so I set it larger than required here.  -->

  ipc.setdisplay(770, 50, 500, 100)

    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")

//===================== End of Lua Script ===============================

<!--  
//== In several of my aircraft I have a 2-D gauge that is open most of ====
//== the time so I extended the background BMP in the vertical (Y)     ====
//== dimension to allow for the continuos display of the current VAS.  ====
//== The original BMP was a 112x132 rectangle. I extended it to 112x166 ===
//== You could create a BMP of 112x34 to display the VAS and adjust the ===
//== Y="138" entries below to Y="6"  - NOTE: Edited to do that ============
//== As long as the VAS is equal or greater than my arbitraty threshold ===
//== of 500000, the display is white. When VAS goes below the threshold ===
//== the display is RED. This display code relies upon the above Lua ======
//== script running and saving the current VAS to "L:VAS". otherwise ======
//== this readout will always be zero! One could change/add code here to ==
//== read the offset directly, I suppose, but I already had the script ====
//== so chose to use the L:varible that it created. =======================  -->


<!--  ===================== DISPLAY VAS ===================================  -->

<Gauge Name="VAS Display" Version="1.0">

   <Image Name="VAS_Background.bmp"/>

   <Element>
      <Visible>(L:VAS, number) 499999 > </Visible>
      <Position X="25" Y="6"/>
      <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>          

<!--  === Change display color to RED when VAS is less than 500000 ======  -->

   <Element>
      <Visible>(L:VAS, number) 500000 <</Visible>
      <Position X="25" Y="6"/>
      <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>   

<!--  ==========================================================================   -->
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.