Jump to content
The simFlight Network Forums

andhog

Members
  • Posts

    34
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling
  • Location
    Sweden

andhog's Achievements

Newbie

Newbie (1/14)

  • One Year In Rare
  • Week One Done
  • One Month Later Rare

Recent Badges

1

Reputation

  1. Unfortunately there's apparently something seriously wrong with the latest world update. Having a standalone WASM module in your community folder causes CTD when starting MSFS 😕
  2. @John DowsonYou have a pull request 🙂 https://github.com/jldowson/FSUIPC_WAPI/pulls
  3. You can expect a pull request with that soon 🙂
  4. Exactly, but that's only half true now. You can get LVar values by name but you can only set them by ID.
  5. My application is based around an .ini file with the names of the variables the user like to save/load, so I guess I'm using your API in the opposite direction from what you intended 🙂
  6. So, first I rebuilt the FSUIPC_WDLL with the latest WAPI lib (that's not necessary now that John have done it for you 🙂). Then I have the DLL functions declared like this (the ones I'm using in my app): [DllImport("FSUIPC_WAPID.dll", CallingConvention = CallingConvention.Cdecl)] private static extern void fsuipcw_init(IntPtr hWnd); [DllImport("FSUIPC_WAPID.dll", CallingConvention = CallingConvention.Cdecl)] private static extern void fsuipcw_start(); [DllImport("FSUIPC_WAPID.dll", CallingConvention = CallingConvention.Cdecl)] private static extern void fsuipcw_end(); [UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate void lvarValueRecvFunc(string lvarName, double value); [DllImport("FSUIPC_WAPID.dll", CallingConvention = CallingConvention.Cdecl)] private static extern void fsuipcw_getLvarValues(lvarValueRecvFunc callback); [UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate void lvarIDRecvFunc(string lvarName, int id); [DllImport("FSUIPC_WAPID.dll", CallingConvention = CallingConvention.Cdecl)] private static extern void fsuipcw_getLvarList(lvarIDRecvFunc callback); [DllImport("FSUIPC_WAPID.dll", CallingConvention = CallingConvention.Cdecl)] private static extern void fsuipcw_setLvarAsShort(int id, int value); Calling the functions fsuipcw_init, fsuipcw_getLvarValues and fsuipcw_getLvarList with: fsuipcw_init(this.Handle); var result = new Dictionary<string, double>(); fsuipcw_getLvarValues(result.Add); var lvars = new Dictionary<string, int>(); fsuipcw_getLvarList(lvars.Add); NOTE: I modified the code for fsuipcw_getLvarList so that it takes (const char*, int) instead of (int, const char*). Since there's no function to set an Lvar by name I use this function to get the Lvar ID for the fsuipcw_setLvarAs...(). Having a Dictionary/map with the name as key and id as value serves that purpose much better. Hope this helps. It's my first C# application ever so I had to google it all up, but if it seems to work 🙂 I'm not part of the VIP cabal with access to that part of the forum 🙂, so it would be super appreciated if you could do that.
  7. Now it works perfectly! I have also tried the dll in a C# WinForms application and it works as well. Thank you!
  8. Sorry, copy&paste error there. I can only access 1168 Lvars, as you can see in the log files.
  9. So I've finally tested version 0.4.8 and it finds more LVars than the previous version, but unfortunately not 2044. The CRJ has 1738 LVars and when I create the LVar file(s) it lists all of them (in 14 files), but I've only access to 1738 with the client and using the WAPI in my app. FSUIPC_WASMIF.log FSUIPC_WASM.log
  10. I have gone through all your posts on the forum now but I can't find that description. Could you please give me a link to it?
  11. The app I've built around your module and the API is for saving and loading the cockpit state (switches, knobs etc) in the CRJ (for now, but it should be relatively easy to apply it to other aircraft as well). At the moment one have to do this manually, but I would like to add an option so that it loads the state automatically when you start a flight and saves it when the flight ends. Super! I will look it up. It was just a side note, nothing I expect you to help me with. But I appreciate that you explained a little bit about it. Perhaps I should skip the idea of subscribing to the events, keeping the manual loading and do the saving on a regular interval instead.
  12. I've not been at home for a while, but now that I am I will have a look at your latest accomplishments 🙂. I must also learn some SimConnect and figure out a way to trigger the read and write of LVars when the sim is paused and started. I recon it's a pretty basic task, but without any prior experience in this particular department it's a challenge. But hey, who doesn't like a challenge? 🙂 I'll let you know as soon as I've tested.
  13. @John Dowson you have a pull request 🙂
  14. Unfortunately that didn't go so well. First I tried with the WASM client (see the log files that I for once managed to attach!). Then I compiled my application with the new FSUIPC_WAPI lib and that worked, but when I started the app I got "Microsoft C++ exception: std::out_of_range". I think I might have found the reason in WASM.h: typedef struct _CONFIG_CDA { char CDA_Names[MAX_NO_LVAR_CDAS + MAX_NO_HVAR_CDAS + 1][MAX_CDA_NAME_SIZE]; int CDA_Size[MAX_NO_LVAR_CDAS + MAX_NO_HVAR_CDAS + 1]; CDAType CDA_Type[MAX_NO_LVAR_CDAS + MAX_NO_HVAR_CDAS + 1]; } CONFIG_CDA; And since you increased MAX_NO_VALUE_CDAS it gets out of range here in WASMIF.cpp: for (int i = 0; i < MAX_NO_LVAR_CDAS + MAX_NO_HVAR_CDAS + MAX_NO_VALUE_CDAS; i++) FSUIPC_WASM.log FSUIPC_WASMIF.log
  15. Hi there! Hope you had a great easter! I will try that right away. The LVar files created by your WASM client gives me 1738 LVars. However, I don't think anyone need access to all of those at the same time so your suggestion to have a file with variables of interest together with the module would be great.
×
×
  • 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.