c-true / fsconnect Goto Github PK
View Code? Open in Web Editor NEWWrapper for Flight Simulator 2020 SimConnect library
Wrapper for Flight Simulator 2020 SimConnect library
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.
I have a question:
Is it possible to subscribe to a SimVar, so that a function gets called everytime, the Simvar changes?
If it is already possible, could you please specify how and add it to your readme?
That would be great.
Yours Andreas
The environmental and program data simulation variables have no corresponding enums in FsConnect.
From ABSOLUTE TIME and down in this list:
https://docs.flightsimulator.com/html/Programming_Tools/SimConnect/Status/Status_Of_Simulation_Variables.htm
Hello Timian,
Thanks for the Library, which is really easy to use.
I use this code to set the Com Stby Frequency in MSFS:
`
fsConnect.MapClientEventToSimEvent(TestEnums.GroupId, TestEnums.EventId, FsEventNameId.ComStbyRadioSet);
fsConnect.SetNotificationGroupPriority(TestEnums.GroupId);
fsConnect.TransmitClientEvent(TestEnums.EventId, (uint)bcdStbyFreq, TestEnums.GroupId);
`
The problem is, that an uint BCD only has 4 digits. I'm Able to set com Frequency to 124.000 and 124.010 (using uint16 BCD 2400 and 2401 (the leading "1" in 100.000 is ommited)), but not to 124.005, which i am able in Garmin GNS 530.
So i would need a TransmitClientEvent with an uint64, i guess.
Greetings
Andreas
Hi,
I successfully connected to FS2020 and received the heading bug setting using RequestData on FsSimVar.AutopilotHeadingLockDir.
However, I was unable to set the value using a client event. I basically followed the example in the README. After successful connection I call:
fsConnect.MapClientEventToSimEvent(ev.group, ev.setHeadingBug, FsEventNameId.HeadingBugSet);
fsConnect.SetNotificationGroupPriority(ev.group);
fsConnect.TransmitClientEvent(ev.setHeadingBug, (uint) 0, ev.group);
I expected the AP heading selector to switch to 0, but it stays at the heading dialed in. I tried several alternatives (e.g. binding my event to FsEventNameId.HeadingBugInc, FsEventNameId.FlapsIncr), but none worked. However, a call to SetText does show a text popup in MSFS (so, it's probably not a connection issue).
Any help appreciated.
EDIT: Inserted 2nd code line
I'm currently developing an application that tracks a lot of simvars and I have grouped them into two separate structs based on the sampling rate required. I initially thought I would just create
But that created some weird results:
The only way I was able to work around it was to create two FsConnect instances with only the one registered struct each, and since both are requesting data quite often and need to be running anyways I was ok with that.
But now I'm developing a "plane ground operations" step that requires a few more variables, but only for a limited amount of time, so I would be looking at a third connection to the sim - not sure if I'm still comfortable with that. Did I do/understand something wrong about the struct registrations? Or is this a limitation of SimConnect that it only supports one?
The SimConnect.cfg file is currently written to Executing assembly's location. This may be in an area where the process does not have access to write to.
Consider writing to the user's documents folder as the SimConnect.dll also looks here.
Hi, I've been playing with FsConnect, and cannot get it to return transponder codes. I think I'm doing it right - just wanted to check.
When setting up the response I have this:
[SimVar(NameId = FsSimVar.TransponderCode, UnitId = FsUnit.Bco16)]
public uint TransponderCode;
And then use it like this:
uint transponder_code = Bcd.Bcd2Dec(r.TransponderCode);
It always returns 0... Any thoughts ?
CJ4 mod team contacted me about conflict with my Kinetic Assistant, which uses your fsConnect.DLL, that SimConnect.cfg in My Documents cause their WASM module functionality problems. I have fixed it on my end, but you should consider to set local CFG placement as default:
public SimConnectFileLocation SimConnectFileLocation { get; set; } = SimConnectFileLocation.Local;
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.