Jump to content
The simFlight Network Forums

Simconnect Menu and Messages from FSUIPC


Recommended Posts

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

 

Link to comment
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

 

Link to comment
Share on other sites

  • 2 weeks later...
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

 

Link to comment
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

 

Link to comment
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

 

 

Link to comment
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

 

Link to comment
Share on other sites

  • 2 weeks later...

Hi Yves,

Quote

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

I've now added the 'TextFileForDisplay' functionality into FSUIPC5. Could you please try the following build:

FSUIPC5150i.zip

It uses the same ini parameters as WideClient but in the '[General]' section (not '[User]').

Note that the 'wnd' and 'display' libraries are still WideClient only, so you cannot use these to display the file. If you want to do this, you could always run a WideClient on your sim PC (setting ClassInstance=1).

I still need to discuss a few issues that arose from implementing this with Pete, but it would be useful if you could test and let me know if it works for your requirements.

Cheers,

John

Edited by John Dowson
Corrected attached zip file
Link to comment
Share on other sites

Hi Yves,

I should point out that the strings in the string table returned to the lua function will have a nul ('\0') character at the end, included in the length of the string. I am not sure this is correct, but it is also the way WideClient handles the strings in the string table so I've kept this implementation the same. These can be handled how you wish in the lua code (for most purposes, this won't matter).

Cheers,

John

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.