<commit_before>package org.usfirst.frc.team1760.robot.operations;

import org.usfirst.frc.team1760.robot.TitanRobot;
import org.usfirst.frc.team1760.robot.components.JoystickButton;
import org.usfirst.frc.team1760.robot.components.Switch;

import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.SpeedController;

public class ElevatorOperator {
	public static final double AUTO_UP_SPEED = 0.75;
	public static final double PARKING_SPEED = -0.25;

	private TitanRobot robot;
	private SpeedController elevatorMotor;
	private Joystick operatorJoystick;
	private JoystickButton holdElevatorHighButton;
	private JoystickButton parkElevatorButton;
	private JoystickButton cancelElevatorHoldButton;
	private Switch elevatorUpperLimitSwitch;
	private Switch elevatorLowerLimitSwitch;

	private boolean holdHigh;
	private boolean parking;

	public ElevatorOperator(TitanRobot pRobot) {
		robot = pRobot;
		elevatorMotor = robot.getMotorStore().getElevatorMotor();
		operatorJoystick = robot.getJoystickStore().getOperatorJoystick();
		holdElevatorHighButton = robot.getJoystickStore().getHoldElevatorHighButton();
		parkElevatorButton = robot.getJoystickStore().getParkElevatorButton();
		cancelElevatorHoldButton = robot.getJoystickStore().getCancelElevatorHoldButton();
		elevatorUpperLimitSwitch = robot.getSwitchStore().getElevatorUpperLimitSwitch();
		elevatorLowerLimitSwitch = robot.getSwitchStore().getElevatorLowerLimitSwitch();
		holdHigh = false;
		parking = false;
	}

	public void periodic() {
        if (holdElevatorHighButton.isSwitchOn()) {
        	holdHigh = true;
        	parking = false;
        }
        else if (parkElevatorButton.isSwitchOn()) {
        	parking = true;
        	holdHigh = false;
        }
        else if (cancelElevatorHoldButton.isSwitchOn()) {
        	parking = false;
        	holdHigh = false;
        }

        double speed = 0.0;

        if (parking) {
            if (elevatorLowerLimitSwitch.isSwitchOn()) {
            	parking = false;
            }
            else {
            	speed = PARKING_SPEED;
            }
        }

        if (holdHigh) {
        	speed = AUTO_UP_SPEED;
        }
        else {
            double y = operatorJoystick.getY();
            speed = y * y;
        }

        if ((speed > 0.0) && elevatorUpperLimitSwitch.isSwitchOn()) {
        	speed = 0.0;
        }
        else if ((speed < 0.0) && elevatorLowerLimitSwitch.isSwitchOn()) {
        	speed = 0.0;
        }

        elevatorMotor.set(speed);
	}
}<commit_msg>Remove parking and holding logic<commit_after>package org.usfirst.frc.team1760.robot.operations;

import org.usfirst.frc.team1760.robot.TitanRobot;
import org.usfirst.frc.team1760.robot.components.JoystickButton;
import org.usfirst.frc.team1760.robot.components.Switch;

import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.SpeedController;

public class ElevatorOperator {
	private TitanRobot robot;
	private SpeedController elevatorMotor;
	private Joystick operatorJoystick;
	private Switch elevatorUpperLimitSwitch;
	private Switch elevatorLowerLimitSwitch;

	public ElevatorOperator(TitanRobot pRobot) {
		robot = pRobot;
		elevatorMotor = robot.getMotorStore().getElevatorMotor();
		operatorJoystick = robot.getJoystickStore().getOperatorJoystick();
		elevatorUpperLimitSwitch = robot.getSwitchStore().getElevatorUpperLimitSwitch();
		elevatorLowerLimitSwitch = robot.getSwitchStore().getElevatorLowerLimitSwitch();
	}

	public void periodic() {
        double speed = 0.0;
    double y = operatorJoystick.getY();
    speed = y * y;
    if ((speed >= -0.05) && (speed <= 0.05)) {
    	elevatorMotor.set(0.0);
    	// Apply Brake
    }
    else {
    	//release brake
        if ((speed > 0.0) && elevatorUpperLimitSwitch.isSwitchOn()) {
            	elevatorMotor.set(0.0);
        }
        else if ((speed < 0.0) && elevatorLowerLimitSwitch.isSwitchOn()) {
            	elevatorMotor.set(0.0);
        }
        else {
	        elevatorMotor.set(speed);
        }
        }
	}
	// Solenoid off? (need to keep brake state?)
}
{'fraction_non_alphanumeric': 0.10034431874077718, 'fraction_numerical': 0.016232169208066895, 'mean_word_length': 3.1927835051546394, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '1224303', 'n_tokens_mistral': 1392, 'n_tokens_neox': 1291, 'n_words': 230}