calibx / msfsdeck

MSFS Plugin for LoupeDeck Live & CT
Apache License 2.0
47 stars 12 forks source link

Simconnect and Debug buttons now show clearly whether they are active or not #234

Closed JesperJorg closed 4 months ago

JesperJorg commented 5 months ago
JesperJorg commented 5 months ago

Hi @calibx , Hope you will get time to look at this PR too. It is much smaller than the first one :-)

calibx commented 4 months ago

Ok ... all is merge in a temp branch because I can't cheery pick commit as each contains multiple changes (formating, optmization, new feature, ...).

I have read all your changes, the first thing I would like to say is "Thank you very much !!!". You made lots of things I didn't make because of time or C# knowledge. I think I will merge 99% of your code but I need some more details to understand :

The split of my ugly SimConnectDAO is very welcome !

JesperJorg commented 4 months ago

Thanks for merging so far. You have some very good questions, that I will try to answer here:

  1. I added them because there were new version of them with SU14. I hoped that maybe there were changes that we could benefit from, but I did not manage to find any. I also thought that it was nice to be able to see exactly which version of the dll’s I had compiled against.
  2. I have understood things correctly, then the presence of different Binding objects would not minimize the number of redraws, because DataTransferIn would call SetMsfsValue for all of the bindings when a new value came back from MSFS, for example see the removed lines in DataTransferIn for the commit for lights: 35240f8aefc367fc9293a65a3c1c8f4b5d14b829. And even if there was more being redrawn: you don’t have both the AP folder and the Airline folder open at the same time.
  3. I had some difficulties remembering exactly what the problem was, but luckily I added some unittests. If I run them with the “old” logic in ApplyAdjustment, a number of the tests fail: a. TestComDecimals, TestNavDecimals, TestNavIntegers: when wrapping around with a negative amount of steps, it would return the max value rather than stepping back the right number of steps. b. TestCourse, TestHdg: the same but wrapping around with multiple positive steps, it would return the min value rather than stepping forth the right number of steps.

BTW: Do you have the possibility to check that I did not break anything for Loupedeck CT and Live S? I only have a Loupedeck Live and thus only tested on that.