001package com.ctre.phoenix.motorcontrol;
002
003import edu.wpi.first.wpilibj.motorcontrol.MotorController;
004import edu.wpi.first.wpilibj.MotorSafety;
005
006/**
007 * implem of MotorSafety interface in WPI. This also allows late/lazy
008 * construction of WPI's motor safety object (which mitigates late-released bugs from WPI).
009 */
010public class WPI_MotorSafetyImplem extends MotorSafety {
011
012        private MotorController _speedController = null;
013        private String _description = null;
014
015        /**
016         * Constructor for WPI_MotorSafetyImplem
017         * @param speedController Speed Controller to implement motor safety on
018         * @param description Description of speed controller
019         */
020        public WPI_MotorSafetyImplem(MotorController speedController, String description) {
021                _speedController = speedController;
022                _description = description;
023        }
024
025        /**
026         * Stop the controller
027         */
028        public void stopMotor() { _speedController.stopMotor(); }
029
030        /**
031         * @return Description of speed controller
032         */
033        public String getDescription() { return _description; }
034}