<commit_before>package org.frc4931.zach.diagnosticrobot.drive;
import edu.wpi.first.wpilibj.Jaguar;
import edu.wpi.first.wpilibj.Sendable;
import edu.wpi.first.wpilibj.SpeedController;
import edu.wpi.first.wpilibj.Talon;
import edu.wpi.first.wpilibj.Victor;
import edu.wpi.first.wpilibj.tables.ITable;

public class Motor implements Sendable{
	public SpeedController controller;
	private int channel;
	public Motor(int channel, String type){
		this.type = type;
		this.channel = channel;
		if(type.toLowerCase().indexOf("talon")!=-1){
			System.out.println("Created Talon on channel "+channel);
			controller = new Talon(channel);
		}else if(type.toLowerCase().indexOf("jaguar")!=-1){
			System.out.println("Created Jaguar on channel "+channel);
			controller = new Jaguar(channel);
		}else if(type.toLowerCase().indexOf("victor")!=-1){
			System.out.println("Created Victor on channel "+channel);
			controller = new Victor(channel);
		}
	}
	public void setSpeed(double speed){
		controller.set(speed);
	}
	public double getSpeed(){
		return controller.get();
	}
	
	/*SmartDashboard Information*/
	private String type;
	private ITable table;
	//@Override
	public String getSmartDashboardType() {
		return type;
	}
	//@Override
	public ITable getTable() {
		return table;
	}<commit_msg>Tweaked and made several documentation improvments to Motor<commit_after>package org.frc4931.zach.diagnosticrobot.drive;
import edu.wpi.first.wpilibj.Jaguar;
import edu.wpi.first.wpilibj.Sendable;
import edu.wpi.first.wpilibj.SpeedController;
import edu.wpi.first.wpilibj.Talon;
import edu.wpi.first.wpilibj.Victor;
import edu.wpi.first.wpilibj.tables.ITable;
/**
 * A class that represents a physical motor and its associated speed controller
 * @author zach
 *
 */
public class Motor implements Sendable{
	private final SpeedController controller;
	private final int channel;
	
	private final String type;
	private ITable table;
	
	/**
	 * Creates a motor class of the specified type on the given channel.
	 * @param channel the PWM output that the motor controller is connected to.
	 * @param type the name displayed in the SmartDashboard.  
	 * It must contain the case insensitive string "talon", "jaguar", 
	 * or "victor" depending on the type of the motor controller.
	 */
	public Motor(int channel, String type){
		this.type = type;
		this.channel = channel;
		if(type.toLowerCase().indexOf("talon")!=-1){
			System.out.println("Created Talon on channel "+channel);
			controller = new Talon(channel);
		}else if(type.toLowerCase().indexOf("jaguar")!=-1){
			System.out.println("Created Jaguar on channel "+channel);
			controller = new Jaguar(channel);
		}else if(type.toLowerCase().indexOf("victor")!=-1){
			System.out.println("Created Victor on channel "+channel);
			controller = new Victor(channel);
		}else{
			controller = null;
		}
	}
	
	/**Set the speed of the motor as a double between -1.0 and 1.0.
	 * 
	 * @param speed the speed to set the motor to, between -1.0 and 1.0.
	 */
	public void setSpeed(double speed){
		controller.set(speed);
	}
	
	/**
	 * Returns the current speed of the motor as a double from -1.0 to 1.0.
	 * @return the speed of the motor from -1.0 to 1.0.
	 */
	public double getSpeed(){
		return controller.get();
	}
	
	/**
	 * Returns the class that represents the physical motor controller.
	 * @return the SpeedController that is attached to the motor.
	 */
	public SpeedController getController(){
		return controller;
	}
	
	/*SmartDashboard Information*/
	//@Override
	public String getSmartDashboardType() {
		return type;
	}
	//@Override
	public ITable getTable() {
		return table;
	}
{'fraction_non_alphanumeric': 0.11850828729281768, 'fraction_numerical': 0.008287292817679558, 'mean_word_length': 4.150782361308677, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6648291', 'n_tokens_mistral': 1224, 'n_tokens_neox': 1138, 'n_words': 337}