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

✨ Add rotation constructor with reversed flag #686

Open
wants to merge 1 commit into
base: develop-pros-4
Choose a base branch
from

Conversation

ion098
Copy link

@ion098 ion098 commented Jul 5, 2024

Summary:

Add a rotation sensor constructor that takes a reversed flag.

Motivation:

Some people prefer using a reversed flag instead of negative port numbers.

Test Plan:

  • Check it compiles
  • Check that both constructors work as expected

@BennyBot
Copy link
Member

BennyBot commented Jul 5, 2024

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

}
Rotation::Rotation(const std::int8_t port) : Rotation(abs(port), port < 0) {}

Rotation::Rotation(const std::uint8_t port, const bool reversed): Device(port, DeviceType::rotation) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Rotation::Rotation(const std::uint8_t port, const bool reversed): Device(port, DeviceType::rotation) {
Rotation::Rotation(const std::int8_t port, const bool reversed): Device(abs(port), DeviceType::rotation) {

in the case the user provides a negative number and specifies the reverse flag, the reverse flag should be used.

* }
* \endcode
*/
Rotation(const std::uint8_t port, const bool reversed);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Rotation(const std::uint8_t port, const bool reversed);
Rotation(const std::int8_t port, const bool reversed);

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.

2 participants