Jump to content
The simFlight Network Forums

OOM warning


Recommended Posts

 Here is the soltion to VAS Usage display through FUSiPC. Thanks to  Canada Avsim member

 

Here is the instruction:

 

1-Open the FSUIPC setup screen. Go to the "logging" tab, and in one of the "specific value checks" enter the value 024C (first character is zero, not the letter"O".

2-Change the "type" for that value from S8 to S32.

3-Click on the checkboxes to display the value either at the upper window bar, or within the main FSX screen.

Now save and exit. Going forward, you will have a continuously-updated readout in-game of free VAS remaining.

 

 

http://img543.imageshack.us/img543/5156/jglv.jpg

 

My remaining VAS memory before OOM 1,403,260 Kb/1,4GB

Link to comment
Share on other sites

Since I already use the top window bar to display my 'mode' for my controls (offset 0x66C0 - I have multiple 'modes' for

each aircraft's button/switch assignments)  I needed another way to display the VAS. The log to window is really not a

good solution for me as that red text on grean background is extremely difficult to read! (Damn you Microsoft for not

making the colors and font size user-definable!!)

 

My soulution was to create a small Lua script that periodically reads 0x024C (ipc.readUD) and than sends the

value to the Lua display window (ipc.display).

 

The Lua display window can be positioned wherever you wish on the screen and the text color is white.

 

One can set that display to occur at fixed intervals or when VAS gets below a certain amount or using an

event.button or event.key  function to allow the display to appear when a button/switch of key-combo is pressed.

 

The display window can be set to remain active for a pre-assigned interval...1,2,3 etc seconds.

 

My Lua script below uses the event.offset to execute the function "VAS" each time that value chages.

I assign that value to a local variable, as I use it elsewhere as well, and then output the VAS value to

the lua display when it becomes less than 500000.

 

The display remains active for 2 seconds.

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

I have a 2D window for the RaytheonANR75 radar gauge installed in all my aircraft so it is often 'in view'.

I used the local variable I used in the Lua script,'L:VAS",   to display that value continuously at the top of

the radar gauge window.

 

Here is the xml code I inserted into that radar gauge.

//------------------- VAS Display ----------------------

      <Element id="VASReadout">
        <FloatPosition>410.000,20.000</FloatPosition> 
        <GaugeText id="VAS Readout">
          <BackgroundColor>0x000000</BackgroundColor>
          <Bold>True</Bold>
          <Bright>True</Bright>
          <FontColor>0xffffff</FontColor>
          <FontFace>Arial</FontFace>
          <FontHeight>20</FontHeight>
          <GaugeString>%((L:VAS, enum))%!07d!%</GaugeString>
          <HorizontalAlign>LEFT</HorizontalAlign>
          <Size>70,70</Size>
          <Transparent>True</Transparent>
        </GaugeText>
      </Element>
            
//--------------------------------------------------------------------

So, there are a couple more ways to 'skin a cat', as the saying goes :)

 

   Paul

Link to comment
Share on other sites

  • 6 months later...

Now,   :)  , how is it possible to port the display of VAS number to ShowText window via WideFS?

 

Several ways. Here are three Lua plug-ins. Try each and see which you like. JUst save them as .lua files in the WideClient folder.

w = wnd.open("My Display", WND_FIXED, 30,300,217,50)
wnd.backcol(w, 0x000)
wnd.textcol(w, 0x0f0)
wnd.font(w, WND_ARIAL,-2,WND_BOLD)

-- Update the display at 500 msec intervals (see event at end)
function mytimer(time)

        wnd.clear(w)

fr = ipc.readUW(0x0274)
if fr ~= 0 then fr = 32768/fr end
fr = math.floor((fr * 10) + 0.5)/10
mem = ipc.readUD(0x024C)
memmb = math.floor((mem/1024) + 0.5)

wnd.text(w, "Frame Rate " .. fr .. " fps\nMemory free " .. memmb .. " Mb")

end

-- Adjust timing to taste: 500 = 1/2 second
event.timer(500, "mytimer")

or:

 

-- Create the display window for 2 values, position x=800, y=400
h = display.create("My next display", 2, 800, 400)


-- Update the display at 500 msec intervals (see event at end)
function mytimer(time)


    -- display 1 = frame rate
    fr = ipc.readUW(0x0274)
    if fr ~= 0 then fr = 32768/fr end
    fr = math.floor((fr * 10) + 0.5)/10
    display.show(h, 1, "Frame Rate " .. fr .. " fps")
   
    -- display 2 = memory left free
    mem = ipc.readUD(0x024C)
    memmb = math.floor((mem/1024) + 0.5)
    display.show(h, 2, "Memory free " .. mem .. " kb (" .. memmb .. " Mb)")
   
end


-- Adjust timing to taste: 500 = 1/2 second
event.timer(500, "mytimer")

Or:

 

w = wnd.open("My third display", 2)
wnd.backcol(w, 0x000)
wnd.textcol(w, 0x0f0)
wnd.font(w, WND_ARIAL,-2,WND_BOLD)


-- Update the display at 500 msec intervals (see event at end)
function mytimer(time)


wnd.clear(w)


    fr = ipc.readUW(0x0274)
    if fr ~= 0 then fr = 32768/fr end
    fr = math.floor((fr * 10) + 0.5)/10
    mem = ipc.readUD(0x024C)
    memmb = math.floor((mem/1024) + 0.5)
    
    wnd.text(w, "Frame Rate " .. fr .. " fps\nMemory free " .. memmb .. " Mb")


end


-- Adjust timing to taste: 500 = 1/2 second
event.timer(500, "mytimer")
 
Please yourself. Adjust at will.
 
Pete
 

 

Link to comment
Share on other sites

Strange but true: I created 3 Lua files kindly suggested by Pete and named them: VAS.lua1 ,  VAS.lua2 and VAS.lua3 as I wanted to switch between them by renaming each to VAS.lua when needed. Turns out WideFS reads *.lua1 , lua2 and lua3 extensions as well, simultaneously.

 

Cheers,

Dirk.

Link to comment
Share on other sites

Is it possible to display the info in AdvDisplay though? It is easier to resize and place ontop all other opened windows.

 

One of those three Lua programs has a re-sizeable and positionable window, and you can easily change the default size and position -- just look at the code. AdvDisplay is a long dead FS module which doesn't run on a client, it used to be part of the FS9 (and before) process.  I hope you aren't still using that!

 

 

Strange but true: I created 3 Lua files kindly suggested by Pete and named them: VAS.lua1 ,  VAS.lua2 and VAS.lua3 as I wanted to switch between them by renaming each to VAS.lua when needed. Turns out WideFS reads *.lua1 , lua2 and lua3 extensions as well, simultaneously.

 

WideClient runs any Lua program it finds in its folder. Adding characters to the end of a filetype never has changed the filetype -- that's a Windows function, not in WideClient's control. If you want to change the filetype so it won't load use a prefix not a suffix. e.g. 1lua, 2lua, 3lua. (I use ".xlua" to disable lua programs.

 

Pete

Link to comment
Share on other sites

One of those three Lua programs has a re-sizeable and positionable window, and you can easily change the default size and position -- just look at the code. AdvDisplay is a long dead FS module which doesn't run on a client, it used to be part of the FS9 (and before) process.  I hope you aren't still using that!

 

 

Pete, how come?! I'm still using it very well in FSX with RC4 on my networked PC. What would you suggest using instead? What is bad about it and how can it be replaced if you recommend to?

 

Thanks,

Dirk.

Link to comment
Share on other sites

One of those three Lua programs has a re-sizeable and positionable window, and you can easily change the default size and position -- just look at the code. AdvDisplay is a long dead FS module which doesn't run on a client, it used to be part of the FS9 (and before) process.  I hope you aren't still using that!

Pete

 

Pete, the window is resizeable indeed (not scalable though), unfortunately it seems there's no word wrap that can be really useful when resizing directly with the mouse (convenient!).

 

Thanks,

Dirk.

Link to comment
Share on other sites

w = wnd.open("My Display", WND_FIXED, 30,300,217,50)
wnd.backcol(w, 0x000)
wnd.textcol(w, 0x0f0)
wnd.font(w, WND_ARIAL,-2,WND_BOLD)

-- Update the display at 500 msec intervals (see event at end)
function mytimer(time)

        wnd.clear(w)

fr = ipc.readUW(0x0274)
if fr ~= 0 then fr = 32768/fr end
fr = math.floor((fr * 10) + 0.5)/10
mem = ipc.readUD(0x024C)
memmb = math.floor((mem/1024) + 0.5)

wnd.text(w, "Frame Rate " .. fr .. " fps\nMemory free " .. memmb .. " Mb")

end

-- Adjust timing to taste: 500 = 1/2 second
event.timer(500, "mytimer")

or:

 

-- Create the display window for 2 values, position x=800, y=400
h = display.create("My next display", 2, 800, 400)


-- Update the display at 500 msec intervals (see event at end)
function mytimer(time)


    -- display 1 = frame rate
    fr = ipc.readUW(0x0274)
    if fr ~= 0 then fr = 32768/fr end
    fr = math.floor((fr * 10) + 0.5)/10
    display.show(h, 1, "Frame Rate " .. fr .. " fps")
   
    -- display 2 = memory left free
    mem = ipc.readUD(0x024C)
    memmb = math.floor((mem/1024) + 0.5)
    display.show(h, 2, "Memory free " .. mem .. " kb (" .. memmb .. " Mb)")
   
end


-- Adjust timing to taste: 500 = 1/2 second
event.timer(500, "mytimer")

Or:

 

w = wnd.open("My third display", 2)
wnd.backcol(w, 0x000)
wnd.textcol(w, 0x0f0)
wnd.font(w, WND_ARIAL,-2,WND_BOLD)


-- Update the display at 500 msec intervals (see event at end)
function mytimer(time)


wnd.clear(w)


    fr = ipc.readUW(0x0274)
    if fr ~= 0 then fr = 32768/fr end
    fr = math.floor((fr * 10) + 0.5)/10
    mem = ipc.readUD(0x024C)
    memmb = math.floor((mem/1024) + 0.5)
    
    wnd.text(w, "Frame Rate " .. fr .. " fps\nMemory free " .. memmb .. " Mb")


end


-- Adjust timing to taste: 500 = 1/2 second
event.timer(500, "mytimer")
 
Please yourself. Adjust at will.
 
Pete
 

 

 

 

 

I'd like to be able to control font name and size in Lua #2 as well. How can it be done there?

 

Thanks,

Igor.

 

Perhaps it's the best Lua example for my needs, but the font is huge there.

 

PS: also, please, I'd like to add current (dynamic) Zoom in "display 3" to Lua#2/ Thanks!!!

Link to comment
Share on other sites

Pete, the window is resizeable indeed (not scalable though), unfortunately it seems there's no word wrap that can be really useful when resizing directly with the mouse (convenient!).

 

One of the examples (and they are only examples, for you to change as needed) is scalable. Please refer to the Lua library documentation for details of fonts, windows and displays.

 

I'd like to be able to control font name and size in Lua #2 as well. How can it be done there?

 

 

That one, using the display library, is using standard Windows dialogues, so the font etc is up to Windows settings. Not adjustable in Lua.

 

Please just refer to the library documentation. Surely one of them is a good basis/. Else you are being very awkward.

 

 

On your earlier post:

 

 

Pete, how come?! I'm still using it very well in FSX with RC4 on my networked PC. What would you suggest using instead? What is bad about it and how can it be replaced if you recommend to?

 

 

AdvDisplay.dll was never moved to FSX. I've no idea how you got it working. It was abandoned many years ago in favour of the built-in Windows displays, the semi-transparent ones when docked, the opaque ones when undocked. Fonts and font sizes in those aren't adjustable.

 

Anyway, I thought you were wanting a display on a Client, so you can't be using AdvDisplay.dll!!!

 

For use outside FS, as on a Client, Showtext was provided by a third party. To use that for VAS numbers you'd need to write your own Lua plug-in to read the VAS value and write it as an FS text essage.

 

Pete

Link to comment
Share on other sites

Pete,

 

Definitely I was asking about a display on a Client. Actually I was running ShowText.exe by R. van der Wiele, that says in the readme:

 

 

Version 1.1

This little program works in combination with the program AdvDisp of Peter
Dowson (version 1.30 and higher) and will show the text displayed on AdvDisplay
on an other PC connected via a network FSUIPC / WideFS.
The Glas Cockpit software of Project Magenta (Enrico Schiratti) will also show
this text. So this program is intended for anybody who doesn't use this software
or wants to display the text on a different position.
A .ini file will be created when the program is run for the first time where all the
options will be saved (in the same directory where you put ShowText.exe). No
entries will be written in the registry.
It has a number of options:
Switches
Active - on /off
Title Bar - on/off (When title bar on, border is also on)
Border - on/off (When border switched off, title bar is switched off also)
Word wrap - on/off
Stay on Top - on/off
Config Dialog
Alignment of text:
Horizontal - Left/Center/Right
Vertical - Top/Center/Bottom
Timer Interval:
This value specifies how often the program will check for text changes.
(1000 ms = 1 sec).
Sound File:
A sound file (.wav) can be selected or cleared with the buttons next to the field.
This sound file will be played when there is a message coming in from the
AdvDisplay program. The sound will only be played when there was no message
displayed, so when there are 2 messages coming in after each other the sound is
only played once.
 

 

Remarks:

Move window
When no tltle bar is displayed it is still possible to move the window around, just
left click (and hold down) in the window and drag.
Startup
It is possible to start the program in an active state (program will try to get text
from AdvDisplay via FSUIPC/WideFS) before WideClient on Client PC is running
or FS on the server PC. ShowText will detect this situation and will establish a
link when possible.
Window position/options
The window position will be saved as well as all the options when stopping the
program via the 'exit ' menu.

 

The program has AdvDisplay.dll in the folder, but turns out it also shows text from RC4 even if AdvDisplay.dll is not there, I've just checked. Sorry for the confusion. (Edit: also this shows my own ignorance, re dll on a client lol, sorry!!)
 
Also, lastly, is it possible to show the current vc zoom number in one of those Lua?
 
Much thanks,
Dirk. 
Link to comment
Share on other sites

 

Definitely I was asking about a display on a Client. Actually I was running ShowText.exe by R. van der Wiele, that says in the readme:

 

Yes, ShowText has for a long time been the way to show things like the RC menu on a Client. AdvDisplay was made obsolete by FSX and the Window display option in FS took over in both FS9 and FSX.

 

There's a Lua plug-in which does something similar to ShowText -- it's actually used as the example of the Lua wnd library in the Lua library documentation.

 

If you prefer to use ShowText then you'd need to have a plug-in which read one location (the VAS) and wrote a text string, like those in the examples above, to the FSUIPC text display area. However, you should note that there is only one such area, so it would overwrite things like your RC menu display.

 

Also, lastly, is it possible to show the current vc zoom number in one of those Lua?

 

The value of any FSUIPC offset can be shown. You just have to read it (using the appropriate ipc.readXXX function, where XXX defines the size and type), format it into correct units and characters, using Lua arithmetic and the "string.format" function, and display it as shown in the examples above. In fact there are examples of all that there for you. 

 

Offsets details are in the Offset Status guide installed with FSUIPC. I just checked, and unfortunately the zoom value is not readable in FSX. It was one of the items still outstanding when FSX development ceased. It can be written (because there's a control for that), but not read.

 

Pete

Link to comment
Share on other sites

Yes, ShowText has for a long time been the way to show things like the RC menu on a Client. AdvDisplay was made obsolete by FSX and the Window display option in FS took over in both FS9 and FSX.

 

There's a Lua plug-in which does something similar to ShowText -- it's actually used as the example of the Lua wnd library in the Lua library documentation.

 

If you prefer to use ShowText then you'd need to have a plug-in which read one location (the VAS) and wrote a text string, like those in the examples above, to the FSUIPC text display area. However, you should note that there is only one such area, so it would overwrite things like your RC menu display.

 

 

 

The value of any FSUIPC offset can be shown. You just have to read it (using the appropriate ipc.readXXX function, where XXX defines the size and type), format it into correct units and characters, using Lua arithmetic and the "string.format" function, and display it as shown in the examples above. In fact there are examples of all that there for you. 

 

Pete

 

All is clear, It's like getting a fishing pole instead of free fish, and still free  :)

 

Thank you, Pete.

 

Dirk.

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.