From f86bcb4376227b9c86981b23b13d821d7be37531 Mon Sep 17 00:00:00 2001 From: Logan Howard Date: Fri, 17 Apr 2015 22:16:53 -0700 Subject: [PATCH] remove stupid file thing. will replace with smartdashboard probably --- auton_times_and_speeds.conf | 4 -- .../usfirst/frc/team3501/util/AutonData.java | 48 +------------------ 2 files changed, 1 insertion(+), 51 deletions(-) delete mode 100644 auton_times_and_speeds.conf diff --git a/auton_times_and_speeds.conf b/auton_times_and_speeds.conf deleted file mode 100644 index f429f3f..0000000 --- a/auton_times_and_speeds.conf +++ /dev/null @@ -1,4 +0,0 @@ -# format is: `speed time name`. speed can be negative for reverse motion. -0.7 1.2 drive_over_step -0.5 1.5 drive_past_step -0.5 1.4 pickup_container diff --git a/src/org/usfirst/frc/team3501/util/AutonData.java b/src/org/usfirst/frc/team3501/util/AutonData.java index df91645..df216b6 100644 --- a/src/org/usfirst/frc/team3501/util/AutonData.java +++ b/src/org/usfirst/frc/team3501/util/AutonData.java @@ -1,9 +1,5 @@ package org.usfirst.frc.team3501.util; -import java.io.BufferedReader; -import java.io.FileReader; -import java.io.IOException; -import java.util.Arrays; import java.util.HashMap; public class AutonData { @@ -38,31 +34,7 @@ public class AutonData { } private void populate() { - String file; - - try { - file = readConfigFile(); - } catch (IOException e) { - e.printStackTrace(); - populateDefaults(); - return; - } - - try { - Arrays.stream(file.split("\n")) - .map(line -> line.split(" ")) - .forEach((action) -> { - double speed = Double.parseDouble(action[0]); - double time = Double.parseDouble(action[1]); - String name = action[2]; - - speeds.put(name, speed); - times.put(name, time); - }); - } catch (Exception e) { - e.printStackTrace(); - populateDefaults(); - } + populateDefaults(); } private void populateDefaults() { @@ -77,22 +49,4 @@ public class AutonData { times.put("drive_past_step", 1.5); times.put("pickup_container", 1.4); } - - private String readConfigFile() throws IOException { - BufferedReader in = new BufferedReader(new FileReader( - "auton_times_and_speeds.conf")); - - StringBuilder sb = new StringBuilder(); - - in.readLine(); // get rid of first line - - String curLine; - while ((curLine = in.readLine()) != null) - sb.append(curLine + "\n"); - String finalString = sb.toString(); - - in.close(); - - return finalString; - } } -- 2.30.2