Skip to content

Commit

Permalink
Merge pull request #73 from auscompgeek/move-talon-enums
Browse files Browse the repository at this point in the history
Move TalonSRX-specific enums from base to TalonSRX
  • Loading branch information
virtuald committed Dec 4, 2018
2 parents acb40bd + 3b44792 commit 9d79ad5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
6 changes: 0 additions & 6 deletions ctre/basemotorcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,8 @@
DemandType,
ErrorCode,
Faults,
FeedbackDevice,
FollowerType,
LimitSwitchNormal,
LimitSwitchSource,
MotController,
MotionProfileStatus,
NeutralMode,
Expand All @@ -41,7 +39,6 @@
RemoteLimitSwitchSource,
RemoteSensorSource,
StatusFrame,
StatusFrameEnhanced,
StickyFaults,
VelocityMeasPeriod,
)
Expand All @@ -55,16 +52,13 @@ class BaseMotorController(MotController):

ControlMode = ControlMode
DemandType = DemandType
FeedbackDevice = FeedbackDevice
LimitSwitchNormal = LimitSwitchNormal
LimitSwitchSource = LimitSwitchSource
NeutralMode = NeutralMode
ParamEnum = ParamEnum
RemoteFeedbackDevice = RemoteFeedbackDevice
RemoteLimitSwitchSource = RemoteLimitSwitchSource
RemoteSensorSource = RemoteSensorSource
StatusFrame = StatusFrame
StatusFrameEnhanced = StatusFrameEnhanced
VelocityMeasPeriod = VelocityMeasPeriod

def __init__(self, arbId: int) -> None:
Expand Down
9 changes: 9 additions & 0 deletions ctre/talonsrx.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
import hal

from .basemotorcontroller import BaseMotorController
from ._impl import (
FeedbackDevice,
LimitSwitchSource,
StatusFrameEnhanced,
)


__all__ = ['TalonSRX']
Expand All @@ -35,6 +40,10 @@ class TalonSRX(BaseMotorController):
We don't recommend using this directly. Use :class:`.WPI_TalonSRX` instead.
"""

FeedbackDevice = FeedbackDevice
LimitSwitchSource = LimitSwitchSource
StatusFrameEnhanced = StatusFrameEnhanced

def __init__(self, deviceNumber: int) -> None:
super().__init__(deviceNumber | 0x02040000)
hal.report(hal.UsageReporting.kResourceType_CANTalonSRX, deviceNumber + 1)
1 change: 1 addition & 0 deletions docs/api_mot.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ TalonSRX

.. automodule:: ctre.talonsrx
:members:
:undoc-members:
:show-inheritance:

VictorSPX
Expand Down

0 comments on commit 9d79ad5

Please sign in to comment.