Skip to content

Added property getter/setters for voltage and throttle. - #19

Merged
zachwaffle4 merged 4 commits into
NextFTC:developfrom
KavinSandking:develop
Jul 28, 2026
Merged

Added property getter/setters for voltage and throttle. #19
zachwaffle4 merged 4 commits into
NextFTC:developfrom
KavinSandking:develop

Conversation

@KavinSandking

Copy link
Copy Markdown

Added property getter/setters for voltage and throttle. Also replaced setVoltage() with setVoltageSetpoint()

* This is the simplest control mode: power is applied directly.
*/
var throttle: Double
get() = when (val mode = controlType) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I would simply have it return power.

fun setThrottle(throttle: Double) {
controlType = ControlType.Throttle(throttle)
}
val voltage: VoltageMeasure

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Make this a var and have the set function set controlType like what you did for throttle.

@KavinSandking

Copy link
Copy Markdown
Author

Do you want me update my fork and then do the things? I see that there is already a commit before mine, meaning that my fork is outdated.

@KavinSandking KavinSandking reopened this Jul 28, 2026
@zachwaffle4
zachwaffle4 merged commit 028360a into NextFTC:develop Jul 28, 2026
2 checks passed
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.

3 participants