From 7638f542e1317fc20c57cc76f3196bfe3411d68b Mon Sep 17 00:00:00 2001 From: Rayan Hirech Date: Mon, 6 Feb 2017 20:50:06 -0800 Subject: [PATCH] Fix small bug in toggle. --- .../frc/team3501/robot/CameraFeeds.java | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/org/usfirst/frc/team3501/robot/CameraFeeds.java b/src/org/usfirst/frc/team3501/robot/CameraFeeds.java index e59b8ec..15ea369 100755 --- a/src/org/usfirst/frc/team3501/robot/CameraFeeds.java +++ b/src/org/usfirst/frc/team3501/robot/CameraFeeds.java @@ -15,11 +15,11 @@ public class CameraFeeds { private static String usbCamName; private static String axisCamName; private static CameraFeeds cameraFeeds = null; - @SuppressWarnings("deprecation") public CameraFeeds(/* Joystick Button */) { - // Get camera id by supplying camera name example 'cam0', found on roborio web + // Get camera id by supplying camera name example 'cam0', found on roborio + // web // interface /* * intakeCam = @@ -44,29 +44,32 @@ public class CameraFeeds { // axisCamera = cameraServer2.addAxisCamera("axisCamera", "10.35.1.11"); // cameraFeeds = new CameraFeeds(); } - + public static CameraFeeds getCameraFeeds() { - if (cameraFeeds == null) { - cameraFeeds = new CameraFeeds(); - } - return cameraFeeds; - - + if (cameraFeeds == null) { + cameraFeeds = new CameraFeeds(); + } + return cameraFeeds; + } public void init() { - changeCam(intakeCam); + changeCam(climberCam); } public void toggleCamera() { if (curCam.equals(intakeCam)) { changeCam(climberCam); curCam = climberCam; + System.out.println("Switching to climber camera."); + return; } if (curCam.equals(climberCam)) { changeCam(intakeCam); curCam = intakeCam; + System.out.println("Switching to intake camera."); + return; } } @@ -74,8 +77,7 @@ public class CameraFeeds { * * Change the camera to get image from to a different one * - * newId - * for camera + * newId for camera */ public void changeCam(VideoSource cam) { server.removeCamera(axisCamName); -- 2.30.2