package org.usfirst.frc.team2503.r2016;

import org.usfirst.frc.team2503.lib.util.WarriorMath;

import org.jruby.embed.ScriptingContainer;

/**
 * You can use this class for testing non-WPIlib code on your machine.
 */
public class Main {
	
	public static void main(String[] args) {
		for(double d = -90.0; d <= 90.0; d += 1.0) {	
			double degrees = WarriorMath.map(-90.0, 90.0, d, 0.0, 1.0);
			System.out.println(degrees);
		}
		
		System.out.println("[jruby] Booting...");
		
		ScriptingContainer container = new ScriptingContainer();
		container.runScriptlet("puts 'hello world'");
		container.runScriptlet("require 'java'; p org.usfirst.frc.team2503.lib.util.WarriorMath.map(-90.0, 90.0, 45.0, 0.0, 1.0)");
		
		System.out.println("[jruby] Shutting down...");
	}
	
}

@@ -87,16 +87,261 @@
 iorMath;
+%0Aimport org.usfirst.frc.team2503.r2016.debug.CSVDataLogger;%0Aimport org.usfirst.frc.team2503.r2016.debug.CSVDataLogger.Entry;%0A%0Aimport java.io.File;%0Aimport java.io.FileNotFoundException;%0Aimport java.io.FileOutputStream;%0Aimport java.io.PrintWriter;
 %0A%0Aimport
@@ -518,16 +518,67 @@
 %5B%5D args)
+ throws InterruptedException, FileNotFoundException
  %7B%0A%09%09for
@@ -1001,24 +1001,24 @@
  1.0)%22);%0A%09%09%0A
-
 %09%09System.out
@@ -1055,15 +1055,382 @@
 n...%22);%0A
+%09%09%0A%09%09FileOutputStream outputStream = new FileOutputStream(Constants.USB_BASE_DIRECTORY_FILENAME + %22dank.csv%22, true);%0A%09%09PrintWriter writer = new PrintWriter(outputStream);%0A%09%09CSVDataLogger logger = new CSVDataLogger(writer);%0A%09%09%0A%09%09int i = 0;%0A%09%09while(i %3C 1000) %7B%0A%09%09%09Entry entry = new Entry(Math.random(), Math.random());%0A%09%09%09logger.log(entry);%0A%09%09%09Thread.sleep(1L);%0A%09%09%7D%0A%09%09%0A
 %09%7D%0A%09%0A%7D%0A

Test the CSVDataLogger