summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-03-09 15:23:52 -0500
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-03-09 15:23:52 -0500
commitfbf6bc127c8a941e1cc746c8a5efd473936b9f7a (patch)
treeffd7a73c4ae7a52f2d52b360049e4ed3ad91e056
parent51eefb8b38bd5aa13f7940368317c481dfe7dde4 (diff)
Rename the built-in video widgets to have names that make sense. Also docs.
-rw-r--r--smartdashboard/src/edu/wpi/first/smartdashboard/gui/elements/AxisCameraViewer.java (renamed from smartdashboard/src/edu/wpi/first/smartdashboard/gui/elements/VideoStreamViewerExtension.java)11
-rw-r--r--smartdashboard/src/edu/wpi/first/smartdashboard/gui/elements/DefaultDisplayElementRegistrar.java4
-rw-r--r--smartdashboard/src/edu/wpi/first/smartdashboard/gui/elements/RobotCameraViewer.java (renamed from smartdashboard/src/edu/wpi/first/smartdashboard/gui/elements/WebcamViewerExtension.java)19
3 files changed, 22 insertions, 12 deletions
diff --git a/smartdashboard/src/edu/wpi/first/smartdashboard/gui/elements/VideoStreamViewerExtension.java b/smartdashboard/src/edu/wpi/first/smartdashboard/gui/elements/AxisCameraViewer.java
index 2e9a65e..37a708d 100644
--- a/smartdashboard/src/edu/wpi/first/smartdashboard/gui/elements/VideoStreamViewerExtension.java
+++ b/smartdashboard/src/edu/wpi/first/smartdashboard/gui/elements/AxisCameraViewer.java
@@ -21,12 +21,17 @@ import java.net.URLConnection;
import javax.imageio.ImageIO;
/**
+ * SmartDashboard widget for vieweing an MJPEG stream from an Axis
+ * webcam.
+ *
+ * It streams http://HOSTNAME/mjpg/video.mjpg for a configured camera
+ * host.
*
* @author Greg Granito
*/
-public class VideoStreamViewerExtension extends StaticWidget {
+public class AxisCameraViewer extends StaticWidget {
- public static final String NAME = "Simple Camera Viewer";
+ public static final String NAME = "Axis Camera Viewer";
private static final int[] START_BYTES = new int[]{0xFF, 0xD8};
@@ -43,7 +48,7 @@ public class VideoStreamViewerExtension extends StaticWidget {
boolean destroyed = false;
public BGThread() {
- super("Camera Viewer Background");
+ super(NAME+" Background");
}
long lastRepaint = 0;
diff --git a/smartdashboard/src/edu/wpi/first/smartdashboard/gui/elements/DefaultDisplayElementRegistrar.java b/smartdashboard/src/edu/wpi/first/smartdashboard/gui/elements/DefaultDisplayElementRegistrar.java
index ce680a6..e5854d5 100644
--- a/smartdashboard/src/edu/wpi/first/smartdashboard/gui/elements/DefaultDisplayElementRegistrar.java
+++ b/smartdashboard/src/edu/wpi/first/smartdashboard/gui/elements/DefaultDisplayElementRegistrar.java
@@ -29,8 +29,8 @@ public class DefaultDisplayElementRegistrar {
DisplayElementRegistry.registerStaticWidget(ConnectionIndicator.class);
DisplayElementRegistry.registerStaticWidget(Label.class);
DisplayElementRegistry.registerStaticWidget(RobotPreferences.class);
- DisplayElementRegistry.registerStaticWidget(VideoStreamViewerExtension.class);
- DisplayElementRegistry.registerStaticWidget(WebcamViewerExtension.class);
+ DisplayElementRegistry.registerStaticWidget(RobotCameraViewer.class);
+ DisplayElementRegistry.registerStaticWidget(AxisCameraViewer.class);
}
}
diff --git a/smartdashboard/src/edu/wpi/first/smartdashboard/gui/elements/WebcamViewerExtension.java b/smartdashboard/src/edu/wpi/first/smartdashboard/gui/elements/RobotCameraViewer.java
index f9ba47d..5227b0e 100644
--- a/smartdashboard/src/edu/wpi/first/smartdashboard/gui/elements/WebcamViewerExtension.java
+++ b/smartdashboard/src/edu/wpi/first/smartdashboard/gui/elements/RobotCameraViewer.java
@@ -17,17 +17,22 @@ import java.net.ConnectException;
import java.util.Arrays;
/**
- * SmartDashboard extension for viewing a MJPEG stream from the robot,
- * typically forwarded from a USB webcam, or images processed by a user
- * program. This is mostly compatible with the LabVIEW dashboard in
- * "HW Compression" mode.
+ * SmartDashboard widget for viewing a MJPEG stream from the robot,
+ * typically forwarded from a USB webcam, or images processed by a
+ * user program. This is mostly compatible with the LabVIEW dashboard
+ * in "HW Compression" mode.
+ *
+ * It opens TCP port 1180 on the robot and directly reads an MJPEG
+ * from it. For some reason it does its own MJPEG decoding.
+ *
+ * @see edu.wpi.first.wpilibj.CameraServer
*
* @author Tom Clark
* @author Ryan Cahoon
*/
-public class WebcamViewerExtension extends StaticWidget implements Runnable {
+public class RobotCameraViewer extends StaticWidget implements Runnable {
- public static final String NAME = "USB Webcam Viewer";
+ public static final String NAME = "Robot Camera Viewer";
public final IntegerProperty fpsProperty = new IntegerProperty(this, "FPS", 30);
public final MultiProperty sizeProperty;
@@ -46,7 +51,7 @@ public class WebcamViewerExtension extends StaticWidget implements Runnable {
private Socket socket;
private Thread thread;
- public WebcamViewerExtension() {
+ public RobotCameraViewer() {
super();
sizeProperty = new MultiProperty(this, "Size");
sizeProperty.add("640x480", SIZE_640x480);