remove stupid file thing. will replace with smartdashboard probably
authorLogan Howard <logan@oflogan.com>
Sat, 18 Apr 2015 05:16:53 +0000 (22:16 -0700)
committerLogan Howard <logan@oflogan.com>
Sat, 18 Apr 2015 05:16:53 +0000 (22:16 -0700)
auton_times_and_speeds.conf [deleted file]
src/org/usfirst/frc/team3501/util/AutonData.java

diff --git a/auton_times_and_speeds.conf b/auton_times_and_speeds.conf
deleted file mode 100644 (file)
index f429f3f..0000000
+++ /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
index df9164536d559f84f84f29f5e86515a656ce20c1..df216b6b32f0be08f5938067cd3b5589fb84516e 100644 (file)
@@ -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;
-    }
 }