From 6596c7f81f823c2f9f5f280b70154b9f02daa05b Mon Sep 17 00:00:00 2001 From: "Keenan D. Buckley" Date: Tue, 11 Feb 2020 00:45:50 -0700 Subject: [PATCH] Finished Mystery Selector - For debugging, make sure that getDeployDirectory() points to \deploy\ --- src/main/java/frc4388/robot/subsystems/Drive.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main/java/frc4388/robot/subsystems/Drive.java b/src/main/java/frc4388/robot/subsystems/Drive.java index c65c069..7e23293 100644 --- a/src/main/java/frc4388/robot/subsystems/Drive.java +++ b/src/main/java/frc4388/robot/subsystems/Drive.java @@ -9,6 +9,14 @@ package frc4388.robot.subsystems; import java.io.File; import java.io.FilenameFilter; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; import com.ctre.phoenix.motorcontrol.DemandType; import com.ctre.phoenix.motorcontrol.FeedbackDevice; @@ -236,10 +244,10 @@ public class Drive extends SubsystemBase { m_orchestra.addInstrument(m_rightBackMotor); m_orchestra.addInstrument(m_rightFrontMotor); - File songsDir = new File(Filesystem.getDeployDirectory().getAbsolutePath() + "/songs"); + File songsDir = new File(Filesystem.getDeployDirectory().getAbsolutePath() + "\\songs"); String[] songsStrings = songsDir.list(); for (String songString : songsStrings){ - m_songChooser.addOption(songString, songsDir.getAbsolutePath() + songString); + m_songChooser.addOption(songString, songsDir.getAbsolutePath() + "\\" + songString); } Shuffleboard.getTab("Songs").add(m_songChooser); } @@ -449,7 +457,7 @@ public class Drive extends SubsystemBase { * @param song The name of the song to be played */ public void selectSong(String song) { - //String toPlay = song + ".chrp"; + SmartDashboard.putString("Selected Song", song); m_orchestra.loadMusic(song); } }