- Messages
- 26
- Country
[If the below feels like I am a "Grumpy old man" then please humor me. 57 years and developing since before the 8086 and 8088 came around should entitle me to that. I still have the TRS-80 version of Flight Simulator somewhere, if the floppy is still readable]
I am a reasonably experienced developer in C/C++, a very experienced one in Java, and a beginner in C#. My background is mostly server-side with quite a bit of HTML UI interfacing, but only some (very) limited experience in old-school Windows UI interfacing. I have done some experiments with C++ and SimConnect, but my sense of "Good Programming" led me to immediately hide the (IMHO) ugly SimConnect API in a few classes, using multi-threading to take care of the communication. Send in a request that will eventually get me a reply in the stream of messages? Good, that's a "Future" and I'll provide a lambda to pick up the reply whenever it comes. Works beautifully, until I want a UI.
Writing UIs in Windows is a total mess. The Windows XP age is definitely gone, so I'd rather not go down the path of CWindows and CDialogs, which are still supported and happily used by a lot of FlightSim tools I see around but force me to constantly worry about their implementation details. Also, the messaging infrastructure of Windows keeps rearing its ugly head in the most unfortunate places, which forces you to lug HWND values around even if you don't care about using anything graphical. C# and XAML are a lot closer to what you'd want to use nowadays, but make the wrong choice when you create the project and your application won't run until you send it in for distribution through the Microsoft Store. Don't mind, to be honest, but the hassle of registration and packaging takes the fun out of it quickly.
So Microsoft is now into .Net and the CLR, with C# (and to some degree F#) as the big stars, and there is even DotNet Core which allows you to (somewhat) forget Windows altogether and create applications that are (source) compatible across platforms, allowing you to write something that will work on Linux and macOS just as well as on Windows, meaning I can write server software that does not need a monitor and mouse/keyboard combo to work. XAML UIs even work using Xamarin, so that is actually pretty neat. Great, but SimConnect is stuck in the past. There is a network protocol for it; must be because I can connect across networks to Prepar3D (and probably/eventually MSFS), but it is not very well documented or at least not well published. Somebody wrote "jsimconnect", so there is a reverse-engineered Java implementation of it, but let's not go into that... for now.
So I took a look at the Prepar3D documentation for the Managed Code version of SimConnect, and it is like someone grudgingly acknowledged that such a thing needs to exist, but let's not put too much effort into being fancy about it. Maybe they're still mad that Adobe finally pulled the plug on Flash (didn't that feel like a relief?) just when they were set to allow Flash gauges.
So, time to do some serious Software Architecting and Developing, which is what my daytime job states I should do, and find or build something that means I can do productive and modern software development while communicating with a flight simulator. Am I duplicating efforts here? I am not intending to build a commercial empire around this, so my intention is that all the source code will end up on GitHub.
Bert Laverman
I am a reasonably experienced developer in C/C++, a very experienced one in Java, and a beginner in C#. My background is mostly server-side with quite a bit of HTML UI interfacing, but only some (very) limited experience in old-school Windows UI interfacing. I have done some experiments with C++ and SimConnect, but my sense of "Good Programming" led me to immediately hide the (IMHO) ugly SimConnect API in a few classes, using multi-threading to take care of the communication. Send in a request that will eventually get me a reply in the stream of messages? Good, that's a "Future" and I'll provide a lambda to pick up the reply whenever it comes. Works beautifully, until I want a UI.
Writing UIs in Windows is a total mess. The Windows XP age is definitely gone, so I'd rather not go down the path of CWindows and CDialogs, which are still supported and happily used by a lot of FlightSim tools I see around but force me to constantly worry about their implementation details. Also, the messaging infrastructure of Windows keeps rearing its ugly head in the most unfortunate places, which forces you to lug HWND values around even if you don't care about using anything graphical. C# and XAML are a lot closer to what you'd want to use nowadays, but make the wrong choice when you create the project and your application won't run until you send it in for distribution through the Microsoft Store. Don't mind, to be honest, but the hassle of registration and packaging takes the fun out of it quickly.
So Microsoft is now into .Net and the CLR, with C# (and to some degree F#) as the big stars, and there is even DotNet Core which allows you to (somewhat) forget Windows altogether and create applications that are (source) compatible across platforms, allowing you to write something that will work on Linux and macOS just as well as on Windows, meaning I can write server software that does not need a monitor and mouse/keyboard combo to work. XAML UIs even work using Xamarin, so that is actually pretty neat. Great, but SimConnect is stuck in the past. There is a network protocol for it; must be because I can connect across networks to Prepar3D (and probably/eventually MSFS), but it is not very well documented or at least not well published. Somebody wrote "jsimconnect", so there is a reverse-engineered Java implementation of it, but let's not go into that... for now.
So I took a look at the Prepar3D documentation for the Managed Code version of SimConnect, and it is like someone grudgingly acknowledged that such a thing needs to exist, but let's not put too much effort into being fancy about it. Maybe they're still mad that Adobe finally pulled the plug on Flash (didn't that feel like a relief?) just when they were set to allow Flash gauges.
So, time to do some serious Software Architecting and Developing, which is what my daytime job states I should do, and find or build something that means I can do productive and modern software development while communicating with a flight simulator. Am I duplicating efforts here? I am not intending to build a commercial empire around this, so my intention is that all the source code will end up on GitHub.
Bert Laverman