summaryrefslogtreecommitdiff
path: root/smartdashboard
diff options
context:
space:
mode:
authorJoe Ross <git@rossesmail.com>2015-03-20 22:35:02 -0700
committerJoe Ross <git@rossesmail.com>2015-03-20 22:35:02 -0700
commit8d6c55d9433dc7c4abd3e0f1a2a51da9c9897597 (patch)
tree1dc1767d7a73c1a7949318d7d232be5f0fcea7b2 /smartdashboard
parent80c228c543620fc4d1b376355a9b7bc19c9d0153 (diff)
Fix restoring of saved camera resolution.
The values were not available when the XML file was read, so the default was used. Added values in constructor. Change-Id: Id8d2ac9dfdccf316301ad190f01b0ec23e9516cc
Diffstat (limited to 'smartdashboard')
-rw-r--r--smartdashboard/src/edu/wpi/first/smartdashboard/gui/elements/WebcamViewerExtension.java17
1 files changed, 10 insertions, 7 deletions
diff --git a/smartdashboard/src/edu/wpi/first/smartdashboard/gui/elements/WebcamViewerExtension.java b/smartdashboard/src/edu/wpi/first/smartdashboard/gui/elements/WebcamViewerExtension.java
index a2258cf..f9ba47d 100644
--- a/smartdashboard/src/edu/wpi/first/smartdashboard/gui/elements/WebcamViewerExtension.java
+++ b/smartdashboard/src/edu/wpi/first/smartdashboard/gui/elements/WebcamViewerExtension.java
@@ -30,7 +30,7 @@ public class WebcamViewerExtension extends StaticWidget implements Runnable {
public static final String NAME = "USB Webcam Viewer";
public final IntegerProperty fpsProperty = new IntegerProperty(this, "FPS", 30);
- public final MultiProperty sizeProperty = new MultiProperty(this, "Size");
+ public final MultiProperty sizeProperty;
private final static int PORT = 1180;
private final static byte[] MAGIC_NUMBERS = { 0x01, 0x00, 0x00, 0x00 };
@@ -46,16 +46,19 @@ public class WebcamViewerExtension extends StaticWidget implements Runnable {
private Socket socket;
private Thread thread;
-
- /** {@inheritDoc} */
- @Override
- public void init() {
- setPreferredSize(new Dimension(320, 240));
-
+ public WebcamViewerExtension() {
+ super();
+ sizeProperty = new MultiProperty(this, "Size");
sizeProperty.add("640x480", SIZE_640x480);
sizeProperty.add("320x240", SIZE_320x240);
sizeProperty.add("160x120", SIZE_160x120);
sizeProperty.setDefault("640x480");
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void init() {
+ setPreferredSize(new Dimension(320, 240));
this.thread = new Thread(this);
this.thread.start();