• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

UnMap / Remove ClientEventToSimEvent

Messages
26
Country
newzealand
Does anyone know of a means to undo a MapClientEventToSimEvent, so that the same Enum can then be remapped to a different Sim Event ?

MapClientEventToSimEvent(EVENTS.ReusableID, "PITOT_HEAT_TOGGLE")
transmit event....
Unmap
and later on
MapClientEventToSimEvent(EVENTS.ReusableID, "a different event")
transmit event.... etc

Events are read from a file of variable length, so rather than guessing what max number of events would be and setting up a big Enum, it would be far nicer to have a single one that gets remapped as necessary.

Sending a second MapClientEventToSimEvent generates an exception, as does sending a "", Nothing, 0 etc in an attempt to clear it.

Any help appreciated.
 
EVENTS.ID+variable_x

Edit: Misread what he was trying to say.
 
Last edited:
Are you suggesting I have EVENTS.ID0, EVENTS.ID1......EVENTS.IDn ?
I know I can do that, but that isn't the problem I'm trying to solve. I want a single EVENTS.ID and have the capability to remove the existing SimEvent mapping in order to map a different SimEvent.
Simconnect has capability to Remove items from notification groups, input groups etc, but doesn't appear to have the capability as far as I can see of removing a Client Event to Sim Event mapping.
 
I'm not quite sure what the importance is of using a single event id.
When you map the events, the id doesn't have to be a static enum, it just has to be an integer.
If it were me, I would either use a linked list, or; I would read through the config file to count the items, allocate a block of memory, then reset the file pointer and reread the file to map each event to its own id.
 
ddawson - would you mind elaborating on how to use an Integer rather than an Enum in MapClientEventToSimEvent? In VB.NET I get "Value of type 'Integer' cannot be converted to 'System.Enum" when trying to do so, and the first parameter of MapClientEventToSimEvent() is a System.Enum
I can Cast from Int to Enum ** IF ** I have set up an Enum sequence beforehand, but the issue is I don't think I can set it up the Enum sequence dynamically, so it must be hard coded and I don't know how big the Enum sequence needs to be.
What I am doing is setting up the sequence bigger than I expect will be needed, but I was hoping there would be a tidier means of doing it.

Regards

Richard
 
You may be up against a limitation of vb.net.
Sorry, I was thinking in terms of c++.
 
Back
Top