Jump to content
The simFlight Network Forums
ylevesque

Simconnect Menu and Messages from FSUIPC

Recommended Posts

Hi

We can access Simconnect Menus and text messages from WideClient using event.textmenu().

Is it possible to access them from FSUIPC (using offsets, etc.)?

Thanks

Yves

Edited by ylevesque

Share this post


Link to post
Share on other sites
10 hours ago, ylevesque said:

We can access Simconnect Menus and text messages from WideClient using event.textmenu().

Is it possible to access them from FSUIPC (using offsets, etc.)?

In the latest version of FSUIPC5 you can use the event.textmenu() function in an FSUIPC plug-in. Is that sufficient for your needs? The transmission to WideFS is by private offsets, so I expect offset access would be possible if you wanted to monitor these yourself rather than use a plug-in. I'd have to check the code first, though.

Pete

 

Share this post


Link to post
Share on other sites

Hi Pete

I tried to implement event.textmenu() in a FSUIPC5 plugin to read a file from P3Dv4.4

I cannot make it work.

 I specified the path of the file in TextFileForDisplay parameter in the [Usr] section of FSIUPC5.ini.

The event is never triggered even when the plugin is started.

Is this the right place to specify the path?

It would be great to be able to specify the file inside the plugin itself. This would allow to use event.textmenu() with different files.

Thanks

Yves

 

Share this post


Link to post
Share on other sites
On 12/24/2018 at 4:04 PM, ylevesque said:

I specified the path of the file in TextFileForDisplay parameter in the [Usr] section of FSIUPC5.ini.

Sorry, but that facility is still WideClient only. The event.textmenu() in FSUIPC5 only deals with text messages and menus from SimConnect.

I expect the file display option could be implemented,in FSUIPC5, but it is a separate lump of code. Maybe it could be fitted into a future release.

Pete

 

Share this post


Link to post
Share on other sites

Hi Pete

Thanks for your response.

I will check the history to know when it is implemented.

Let me know if you want me to test it.

Yves

 

Share this post


Link to post
Share on other sites
On 12/22/2018 at 1:18 PM, Pete Dowson said:

The transmission to WideFS is by private offsets, so I expect offset access would be possible if you wanted to monitor these yourself rather than use a plug-in. I'd have to check the code first, though.

I've checked, and you should be okay accessing offsets if you prefer to use a program rather than a Lua plug-in. However, this won't deal with Text Files as the potential size of those will not match the offsets available. For programmed display of normal text files you can obviously simply read the directly files yourself.

If you are still interested in the offsets, here is a preview of the amended and new entries in the FSUIPC offsets list:

B000

4096

FSX and beyond: METAR weather reading and writing (i.e. using the special FSX extended METAR strings of up to 2000 characters each):

                B000–B7FF = Weather writing area (WRITE)

                                Just write string in FSX METAR format.

                B800–BFFF = Weather at requested location (READ)

                                For ICAO ID or Lat/Lon written in CCxx area.

Note: see next entry for other use of B000-B7FF when READING instead of WRITING

Ok-SimC
(but see next entry for reads of B000-B7FF)

Ok-SimC

 

B000

2048

FSUIPC4 and FSUIPC5: This area is used to hold the event.textmenu() data for WideClient Lua plug-ins. It can be accessed by FSUIPC applications wishing to process menus and messages themsellve, without having to use a Lua plug-in.

The format is as follows:

                B000      4 bytes   changed indicator (tick count at time)

                B004      4 bytes   type value (as documented for Lua)

                B008      4 bytes   display duration in secs (32-bit float)

                B00C     4 bytes   the ID of the SimConnect event

                B010      4 bytes   the length of the data following

                B014                      the text data received (<= 2028 bytes)

 

The text data is in the format provided to SimConnect for text displays and menus. The latter is a series of zero-terminated ASCII strings, with the title as the first string. The numbers displayed on screen are not included.

 

4 bytes

N/A
(see previous entry)

Pete

 

Share this post


Link to post
Share on other sites

Thanks Pete.

Is there a way in a LUA plugin to know when a file has changed.

I can use event.timer() to periodically check a file but what should I checked in the file to see if it has changed?

Yves

Share this post


Link to post
Share on other sites
1 hour ago, ylevesque said:

Is there a way in a LUA plugin to know when a file has changed.

You'd need to use one of the system functions ffor files available in the supplied filesystem library. Please check your FSUIPC Documents folder for "LuaFileSystem". 

Pete

 

 

Share this post


Link to post
Share on other sites

Great!

I will check this.

I look in FSUIPC LUA Library document for this kind of function. You should integrate LuaFileSystem with FSUIPC LUA Library document but I understand that LuaFileSystem is not a FSUIPC library.

Yves

Share this post


Link to post
Share on other sites
7 hours ago, ylevesque said:

I look in FSUIPC LUA Library document for this kind of function. You should integrate LuaFileSystem with FSUIPC LUA Library document but I understand that LuaFileSystem is not a FSUIPC library.

It's a library written by another Lua user, not one of the official libraries from the Lua organisation. There are many third party libraries and the documentation for those belongs with them. The only reason I provide the file system pdf is that the library is built into FSUIPC.

There are also many standard Lua libraries built in (string, math, etc). The documentation for all of those is provided by the Lua organisation in both printed books and on their website (see https://www.lua.org/docs.html). The only reason I supply the LFS PDF is that it comes with the complete code package, which you don't need to download because the code is built in.

The Lua library document I publish is solely concerned with NEW functions added only in FSUIPC.  None of those are to do with other authors or the Lua organisation.

Pete

 

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

×

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.