Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client event support #11

Closed
sushiat opened this issue Mar 31, 2021 · 7 comments · Fixed by #12
Closed

Client event support #11

sushiat opened this issue Mar 31, 2021 · 7 comments · Fixed by #12

Comments

@sushiat
Copy link

sushiat commented Mar 31, 2021

Hi, I'm finally far enough into my development that it was time to look at setting the time in the sim and enabling/disabling slew mode. Both those things can only by achieved by sending simconnect events not by setting sim vars.

So I checked out your feature/settime branch and copied the fsconnect changes into my project overriding the one from the published nuget package. I'm happy to say it worked flawlessly for both purposes. I did not test out the world manager class as I want to keep the dependency down to just the main package but my code is nearly identical so that should work.

Not sure when you were planning to release that branch into the main package but looking forward to removing a whole bunch of warnings regarding conflicting class definitions 😄 and to provide some additional testing feedback.

@homeavionicgroup
Copy link

Hi,
glad to hear. Regarding "Events" are you referring to "https://docs.flightsimulator.com/html/Programming_Tools/SimVars/Legacy_Event_IDs.htm"?

I am looking to set the COM Frequency and Transponder Code. It seems not possible through the Variables, but through the Events. On the otherside the documentation states that they are legacy and only there for legacy support.

@sushiat
Copy link
Author

sushiat commented Apr 1, 2021

I don't fully understand what they mean by that sentence up there but it also says "... for reference" and there is no such text in the sim events document that is part of the local help that get's installed with the sdk.

And at least as far as I know there is no other way of doing this via SimConnect, so if these event IDs work I would go with it.

KEY_XPNDR_SET | XPNDR_SET | Sets transponder code (BCD)

KEY_COM_RADIO_SET | COM_RADIO_SET | Sets COM frequency (BCD Hz)
or
KEY_COM_STBY_RADIO_SET | COM_STBY_RADIO_SET | Sets COM 1 standby frequency (BCD Hz)

If they ever wanted to replace these with a new method I'm pretty sure they would deprecate these first and giving developers some time to adjust their code - one would hope so anyway 😄

@TimianHeber
Copy link
Contributor

Hi @markuskorbel , I've been away but have some time this weekend to work on FsConnect. I'll push a new version with more support for events and specifically the set time feature.
Is it so that you would prefer to only be dependent on a single NuGet package? My thought was that FsConnect package would in time be a replacement for the SimConnect usage, and the FsConnect.Managers would provide convenient extensions to it and demonstrate how to do common tasks. But I could for easier use combine these into a single NuGet package, while still keeping the distinction between FsConnect / FsConnect.Manager.

@sushiat
Copy link
Author

sushiat commented Apr 1, 2021

No sorry, you misunderstood me. By all means keep them separate packages - makes sense.

I simply implemented that bit of code to set the time again in my own code so I wouldn't need the worldmanager and keep it down to just the one packet.

TimianHeber added a commit that referenced this issue Apr 5, 2021
- Fixes #11 by providing simple access to setting up client events
- Provides support for aspect/reflection based registering of data definitions through the SimProperty attribute.
- WorldManager support class for setting world time.
@homeavionicgroup
Copy link

Sweet, thanks

@sushiat
Copy link
Author

sushiat commented Apr 6, 2021

Yes, thank you very much indeed

@TimianHeber
Copy link
Contributor

You're welcome. Let me know if you need anything tweaked. I have not started using events myself yet, so there may be API adjustments that would make it easier to use. I will probably make enumerations for known events, which would be optional to use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants