From: Rayan Hirech Date: Tue, 7 Feb 2017 04:50:06 +0000 (-0800) Subject: Fix small bug in toggle. X-Git-Url: http://challenge-bot.com/repos/?p=3501%2F2017steamworks;a=commitdiff_plain;h=7638f542e1317fc20c57cc76f3196bfe3411d68b Fix small bug in toggle. --- 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);