X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;ds=sidebyside;f=benchmarks%2FJava%2FSmartLightsController%2FSmartLightsController.java;h=9a9f805543bca0cfb5a4ed9da90eae83ec6bfa64;hb=258a0230ed01ad0927ed54d37aafa3dd37da5af0;hp=4f1c915e9b50de1ca76713c2004fada6b05cf3af;hpb=3e3e0d0e468e7f791963c1c14e06966563d3f65c;p=iot2.git diff --git a/benchmarks/Java/SmartLightsController/SmartLightsController.java b/benchmarks/Java/SmartLightsController/SmartLightsController.java index 4f1c915..9a9f805 100644 --- a/benchmarks/Java/SmartLightsController/SmartLightsController.java +++ b/benchmarks/Java/SmartLightsController/SmartLightsController.java @@ -340,30 +340,34 @@ public class SmartLightsController { System.out.println("Initialized rooms!"); // Setup the cameras, start them all and assign each one a motion detector -/* for (CameraSmart cam : cameras.values()) { + for (CameraSmart cam : cameras.values()) { // Each camera will have a motion detector unique to it since the motion detection has state MotionDetection mo = new MotionDetection(12, 0.5f, 10, 10); + System.out.println("Motion detection initialized!"); // initialize the camera, might need to setup some stuff internally cam.init(); + System.out.println("Initialized cam!"); // set the camera parameters. cam.setFPS(CAMERA_FPS); + System.out.println("Set FPS!"); cam.setResolution(Resolution.RES_VGA); + System.out.println("Set RES_VGA!"); // camera will call the motion detector directly with data not this controller cam.registerCallback(mo); + System.out.println("Register callback!"); // Start the camera (example is start the HTTP stream if it is a network camera) cam.start(); + System.out.println("Cam start!"); // Remember which motion detector is for what camera camMotionDetect.put(cam, mo); } System.out.println("Initialized cameras!"); -*/ - System.out.println("Skipped cameras!"); //Initialize the light-bulbs, will turn off the bulb for (LightBulbSmart bulb : mainRoomLightBulbs.values()) { @@ -373,12 +377,9 @@ public class SmartLightsController { Thread.sleep(1000); } System.out.println("Initialized bulbs!"); - - System.out.println("STOP here until we have 2 more working cameras!"); - while (true) { } // Run the main loop that will keep check the bulbs and rooms periodically -/* while (true) { + while (true) { // Run this code every long currentTimeSeconds = (new Date()).getTime() / 1000; @@ -414,8 +415,7 @@ public class SmartLightsController { } } - - }*/ + } } }