purduesigbots / pros

Source code for PROS kernel: open source C/C++ development for the VEX V5 microcontroller
https://pros.cs.purdue.edu
Other
259 stars 76 forks source link

PROS 4.0.1 Motors/Motor Group Design #525

Closed Richard-Stump closed 1 year ago

Richard-Stump commented 1 year ago

Background

The current design for Motors, Motor Groups, and their relation is not well liked and goes against C++ norms. We are reverting back to the original idea since the better maintainability does not out weigh the priority of a good API.

Proposal:

Motors and motor groups inherit from a class named AbstractMotor like originally planned. This class is not constructable (as it is abstract) and contains virtual methods for functions from motors and motor groups

We are also removing the OOP features from the motors/groups since they caused too many issues. The constant calls to send the parameters caused issues. We're moving the OOP reversed flag to the C api level.

Looking for any more thoughts and considerations on this.

djava commented 1 year ago

This sounds much nicer, I appreciate this decision 👍👍

Richard-Stump commented 1 year ago

Closed since #532 implements this.