Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selective array writing #80

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Conversation

StefanLobas
Copy link
Contributor

Changed behaviour: Arrays are now written selectively. Only changed values of an array are written to X-Plane to circumvent problems like here: https://forums.x-plane.org/index.php?/forums/topic/232388-toliss-and-hardware-cockpit/

typedef struct {
int lower;
int upper;
} indexPair;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you could just use a pair here:

using indexPair = std::pair<int>;

Then just use first and second instead of lower and upper.

Copy link
Owner

@vranki vranki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but you might check the small comment on converting a struct to pair before merging. I also assume you have tested this and it works.

@StefanLobas
Copy link
Contributor Author

Thanks for your suggestion, using std::pair makes it look even cleaner. I hope I will find some time to implement and test this end of this week :-)

Was different here compared to FloatArrayDataref and caused X-Plane to crash.
…to scope-bound resource managed allocation instead of dynamic allocation for the list of pairs.
@StefanLobas
Copy link
Contributor Author

StefanLobas commented Mar 11, 2022

I tested my changes quite intensive and it works as expected (after locating and fixing the bug for the IntArrayDataref causing X-Plane to crash ;-)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants