calibx / msfsdeck

MSFS Plugin for LoupeDeck Live & CT
Apache License 2.0
48 stars 13 forks source link

Fixes for WP display and centralization of notification code #245

Closed JesperJorg closed 6 months ago

JesperJorg commented 6 months ago

Fixes for WP display: 1) Fixed the bearing value display 2) Made display of distance more accurate

A new class, CommonEntity, is introduced. It centralizes code that was previously duplicated in DefaultFolder, DefaultEncoder and DefaultInput: 1) Code implementing the INotifier interface. 2) Registering a binding with a certain key and initial value and adding it to the collection used for notification. 3) The collection of bindings in a folder, encoder or input.

Apart from that a lot of refactoring in folders: They now all use meaningful names of bindings rather than indexing in a list. The array still exists but is now hidden in CommonEntity. Similar refactorization of encoders and inputs will be made soon and then the binding collection in CommonEntity will be made private.

JesperJorg commented 6 months ago

Hi @calibx : I have pulled the latest code from the develop branch, but cannot compile it due to a missing file: MobiflightCnxStateInput.cs

If I remove the (nonexisting) file from the solution explorer, it seems to compile, so maybe just a slight problem with the project file. If you can confirm that, I will fix it and make a PR with this change as well as removal of some private fields that have gotten duplicated in SimConnectDAO.cs (I think they have appeared in a merge that I made due to some conflicts in PR 239, sorry about that).