package frc.robot;

import edu.wpi.first.networktables.GenericEntry;
import edu.wpi.first.wpilibj.shuffleboard.BuiltInWidgets;
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab;

public class ShuffleboardDisplay {
    private final ShuffleboardTab ElevatorTab;
    private final GenericEntry IntakePosition;
    private final GenericEntry ElevatorPosition;
    private final GenericEntry ElevatorPosition2;
    private final GenericEntry ElevatorVelocity;
    private final GenericEntry ElevatorVelocity2;
    private final GenericEntry IntakeVelocity;
    private final ShuffleboardTab IntakeTab;
    private final ShuffleboardTab AlgaeTab;
    private final ShuffleboardTab AlgaeArmTab;
    private final GenericEntry AlgaePosition;
    private final GenericEntry AlgaeVelocity;
    private final GenericEntry AlgaeArmPosition;
    private final GenericEntry AlgaeArmVelocity;
    private final GenericEntry Measurement;
    private final GenericEntry ClimberPosition;
    private final GenericEntry ClimberVelocity;
    private final ShuffleboardTab ClimberTab;
    private static ShuffleboardDisplay instance = null;

    

    private ShuffleboardDisplay() {
        this.ElevatorTab = Shuffleboard.getTab("Elevator");
        this.ElevatorPosition = this.ElevatorTab.add("Elevator (Reveloutions)", 0.0)
            .withPosition(0, 2)
            .withSize(2,1)
            .withWidget(BuiltInWidgets.kTextView)
            .getEntry();
        this.ElevatorPosition2 = this.ElevatorTab.add("Elevator2 (Reveloutions)", 0.0)
            .withPosition(0, 2)
            .withSize(2,1)
            .withWidget(BuiltInWidgets.kTextView)
            .getEntry();
            this.ElevatorVelocity = this.ElevatorTab.add("ElevatorV (Reveloutions)", 0.0)
            .withPosition(0, 2)
            .withSize(2,1)
            .withWidget(BuiltInWidgets.kTextView)
            .getEntry();
            this.ElevatorVelocity2 = this.ElevatorTab.add("ElevatorV2 (Reveloutions)", 0.0)
            .withPosition(0, 2)
            .withSize(2,1)
            .withWidget(BuiltInWidgets.kTextView)
            .getEntry();
            this.IntakeTab = Shuffleboard.getTab("Intake");
        this.IntakePosition = this.IntakeTab.add("Intake (Reveloutions)", 0.0)
            .withPosition(0, 2)
            .withSize(2,1)
            .withWidget(BuiltInWidgets.kTextView)
            .getEntry();
            this.IntakeVelocity = this.IntakeTab.add("IntakeV (Reveloutions)", 0.0)
            .withPosition(0, 2)
            .withSize(2,1)
            .withWidget(BuiltInWidgets.kTextView)
            .getEntry();
            this.Measurement = this.IntakeTab.add("MM", 0.0)
            .withPosition(0,2)
            .withSize(2,1)
            .withWidget(BuiltInWidgets.kTextView)
            .getEntry();
            this.AlgaeTab = Shuffleboard.getTab("Algae");
        this.AlgaePosition = this.AlgaeTab.add("Algae (Reveloutions)", 0.0)
            .withPosition(0, 2)
            .withSize(2,1)
            .withWidget(BuiltInWidgets.kTextView)
            .getEntry();
            this.AlgaeVelocity = this.AlgaeTab.add("AlgaeV (Reveloutions)", 0.0)
            .withPosition(0, 2)
            .withSize(2,1)
            .withWidget(BuiltInWidgets.kTextView)
            .getEntry();
            this.AlgaeArmTab = Shuffleboard.getTab("AlgaeArm");
            this.AlgaeArmPosition = this.AlgaeArmTab.add("AlgaeArm (Reveloutions)", 0.0)
                .withPosition(0, 2)
                .withSize(2,1)
                .withWidget(BuiltInWidgets.kTextView)
                .getEntry();
                this.AlgaeArmVelocity = this.AlgaeArmTab.add("AlgaeArmV (Reveloutions)", 0.0)
                .withPosition(0, 2)
                .withSize(2,1)
                .withWidget(BuiltInWidgets.kTextView)
                .getEntry();
                this.ClimberTab = Shuffleboard.getTab("Climber");
                this.ClimberPosition = this.ClimberTab.add("Climber (Reveloutions)", 0.0)
                    .withPosition(0, 2)
                    .withSize(2,1)
                    .withWidget(BuiltInWidgets.kTextView)
                    .getEntry();
                    this.ClimberVelocity = this.ClimberTab.add("ClimberV (Reveloutions)", 0.0)
                    .withPosition(0, 2)
                    .withSize(2,1)
                    .withWidget(BuiltInWidgets.kTextView)
                    .getEntry();

    }
    public static ShuffleboardDisplay getInstance() {
        if (instance == null) {
            instance = new ShuffleboardDisplay();
        }
        return instance;
    }
    public GenericEntry getElevatorPosition() {
        return this.ElevatorPosition;
    }
    public GenericEntry getIntakePosition() {
        return this.IntakePosition;
    }
    public GenericEntry getElevatorVelocity() {
        return this.ElevatorVelocity;
    }
    public GenericEntry getElevatorVelocity2() {
        return this.ElevatorVelocity2;
    }
    public GenericEntry getIntakeVelocity() {
        return this.IntakeVelocity;
    }
    public GenericEntry getElevatorPosition2() {
        return this.ElevatorPosition2;
    }
    public GenericEntry getAlgaeVelocity() {
        return this.AlgaeVelocity;
    }
    public GenericEntry getAlgaePosition() {
        return this.AlgaePosition;
    }
    public GenericEntry getAlgaeArmVelocity() {
        return this.AlgaeArmVelocity;
    }
    public GenericEntry getAlgaeArmPosition() {
        return this.AlgaeArmPosition;
    }
    public GenericEntry getMeasurement(){
        return this.Measurement;
    }
    public GenericEntry getClimberPosition() {
        return this.ClimberPosition;
    }
    public GenericEntry getClimberVelocity() {
        return this.ClimberVelocity;
    }

} 