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

246 user defined thruster groups #250

Merged
merged 4 commits into from
Sep 27, 2022
Merged

Conversation

mschweiger
Copy link
Collaborator

  • User-defined thruster groups (THGROUP_USER+x with x >= 0) should now be fully supported by Vessel class methods and thruster-group related API functions.
  • Some cleanup of code in Vessel class; converted thruster and thruster-group related lists to std::vector and std::array
  • GetThrusterGroupLevel called with THGROUP_USER should no longer crash (see Spacex15 patch xrsound usersound #235)

Closes #246

@mschweiger mschweiger self-assigned this Sep 25, 2022
@mschweiger
Copy link
Collaborator Author

@spacex15 : It would be helpful if you can check if this pull request solves the problem identified in #235 (GetThrusterGroupLevel crashes with THGROUP_USER).

@spacex15
Copy link
Contributor

@mschweiger I can confirm that calling GetThrusterGroupLevel(THGROUP_USER) no longer crashes and returns the thruster level for the first user group
but I do not understand how to call GetThrusterGroupLevel for other id groups
calling GetThrusterGroupLevel(THGROUP_USER+ groupindex )? (does not compile)
add another argument for the user group index ?

…tic on THGROUP_USER can be performed, providing support for multiple user-defined thruster groups.
@mschweiger
Copy link
Collaborator Author

@spacex15 : you are correct, since the THGROUP_USER member of the THGROUP_TYPE enum was the upper bound of the enum, no valid addition was possible. I have now added an additional member to the enum to provide an extended upper bound. This should now allow constructs like this:

THGROUP_TYPE MyThrusterGroup = (THGROUP_TYPE)(THGROUP_USER+1);

which then allows to use MyThrusterGroup anywhere a THGROUP_TYPE is expected. Does this work for you?

@spacex15
Copy link
Contributor

Yes @mschweiger , I tried GetThrusterGroupLevel((THGROUP_TYPE)(THGROUP_USER + indexgroup))
and it works now

thanks

@mschweiger mschweiger merged commit 0cec014 into main Sep 27, 2022
@mschweiger mschweiger deleted the 246-user_defined_thruster_groups branch September 27, 2022 21:49
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.

Vessel class: thruster-group related functions don't fully support user-defined groups
2 participants