-Changed application to display image source at the top of the window.
-Removed the extra windows to show intermediate stages when not in debug mode.
Interestingly, this improved performance significantly.
-Modified slider listener so that it (hopefully) doesn't cause any more segfaults.
-Hid all the calibration controls away in a separate calibration window.
They are accessed by a button on the main display.
I also added labels to each of the sliders.
-Application now takes the IP address of the atom as a command-line argument.
-Code now actually uses result sender, which I had forgot to do last time.
-I made a small modification to Brian's code which reduced the application's
average consumption of RAM from two gigabytes to eight hundred megabytes.
git-svn-id: https://robotics.mvla.net/svn/frc971/2013/trunk/src@4151 f308d9b7-e957-4cde-b6ac-9a88185e7312
diff --git a/971CV/src/org/frc971/DebugServerRun.java b/971CV/src/org/frc971/DebugServerRun.java
index 0f60665..cccf241 100644
--- a/971CV/src/org/frc971/DebugServerRun.java
+++ b/971CV/src/org/frc971/DebugServerRun.java
@@ -12,6 +12,7 @@
import java.nio.channels.ServerSocketChannel;
import java.nio.channels.SocketChannel;
+import java.util.Arrays;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -93,6 +94,7 @@
}
}
}
+
/** Constructor to start the server and bind it to a port. */
public DebugServerRun(final int port) throws IOException {
sock = ServerSocketChannel.open();
@@ -106,9 +108,20 @@
LOG.info("Writing headers...");
SocketCommon.sendAll(client, "donotcross\r\n");
}
+
/** Runs the server, and concurrently starts the vision processor with -vision flag. */
public static void main(final String args[]) throws IOException {
//main function for server
+
+ String atomIP = null;
+ try {
+ atomIP = args[0];
+ }
+ catch (ArrayIndexOutOfBoundsException e) {
+ System.out.println("Usage: VisionTuner [atom ip]");
+ System.exit(0);
+ }
+
//set logger to log everything
LOG.setLevel(Level.ALL);
try {
@@ -121,9 +134,9 @@
System.err.println("Warning: Logging initialization failed.");
}
- if (args[0].equals("-vision")) {
+ if (Arrays.asList(args).contains("-vision")) {
LOG.info("Starting vision processor.");
- new TestClient();
+ new TestClient(atomIP);
}
DebugServerRun server = new DebugServerRun(9714);