Exchanging cameras between benchmarks; updating database
authorrtrimana <rtrimana@uci.edu>
Tue, 16 Jan 2018 00:27:28 +0000 (16:27 -0800)
committerrtrimana <rtrimana@uci.edu>
Tue, 16 Jan 2018 00:27:28 +0000 (16:27 -0800)
benchmarks/Java/HomeSecurityController/HomeSecurityController.java
benchmarks/Java/HomeSecurityController/Makefile
benchmarks/Java/IrrigationController/IrrigationController.java
benchmarks/Java/SmartLightsController/SmartLightsController.java
localconfig/mysql/camSet.config
localconfig/mysql/cameraSet.config
localconfig/mysql/cameras.config
others/Mysql/IoTMain.gz

index b6a398a9b5e494f3852c78df84344bb7ba8c34f4..2ef8dc5543c1841a9baf9e15538f6d4817f811de 100644 (file)
@@ -624,11 +624,11 @@ public class HomeSecurityController implements SmartthingsSensorCallback, Smartt
         */
        public void init() {
 
-        System.out.println("DEBUG: Stopping here for debug purposes!");
-        while(true) { }
+        //System.out.println("DEBUG: Stopping here for debug purposes!");
+        //while(true) { }
 
                // Initialize IoTCloud server
-               /*initIoTCloudServer();
+               initIoTCloudServer();
 
                // Iterate over the set of rooms
                for (RoomSmart rm : roomSet.values()) {
@@ -673,7 +673,7 @@ public class HomeSecurityController implements SmartthingsSensorCallback, Smartt
                                }
                        }
 
-               }*/
+               }
        }
 }
 
index 9d3aee2864ceeb57f67b273bdef4174e91f5b8ac..ca4234cc0dba3415c832f87b4f57e0a97b1f7130 100644 (file)
@@ -22,14 +22,14 @@ PHONY += homesecurity
 homesecurity:
        $(JAVAC) $(JFLAGS) *.java
        cp HomeSecurityController.config $(BIN_DIR)/HomeSecurityController
-       cp HomeSecurityController.tomoyo $(BIN_DIR)/HomeSecurityController
+       #cp HomeSecurityController.tomoyo $(BIN_DIR)/HomeSecurityController
        cd $(BIN_DIR)/HomeSecurityController; $(JAR) $(JARFLAGS) HomeSecurityController.jar ../HomeSecurityController/HomeSecurityController*.class ../HomeSecurityController/*.class ../iotcode/interfaces/SmartthingsSensor*.class ../iotcode/interfaces/SmartthingsActuator*.class ../iotcode/interfaces/Camera*.class ../iotcode/interfaces/Alarm*.class ../iotcode/interfaces/Room*.class  ../iotcode/interfaces/ZoneState*.class ../iotcode/interfaces/Resolution*.class
 
 PHONY += check-homesecurity
 check-homesecurity:
        $(JAVAC) $(JFLAGS) $(CHECKER_OPT) $(ASTUBS) *.java
        cp HomeSecurityController.config $(BIN_DIR)/HomeSecurityController
-       cp HomeSecurityController.tomoyo $(BIN_DIR)/HomeSecurityController
+       #cp HomeSecurityController.tomoyo $(BIN_DIR)/HomeSecurityController
        cd $(BIN_DIR)/HomeSecurityController; $(JAR) $(JARFLAGS) HomeSecurityController.jar ../HomeSecurityController/HomeSecurityController*.class ../HomeSecurityController/*.class ../iotcode/interfaces/SmartthingsSensor*.class ../iotcode/interfaces/SmartthingsActuator*.class ../iotcode/interfaces/Camera*.class ../iotcode/interfaces/Alarm*.class ../iotcode/interfaces/Room*.class  ../iotcode/interfaces/ZoneState*.class ../iotcode/interfaces/Resolution*.class
 
 .PHONY: $(PHONY)
index c06646ff0f87a9b608fcb8b894ab4da10f0786c9..4bcec6248df9c38bfd1364bf8534a5b6976ba414 100644 (file)
@@ -257,18 +257,18 @@ public class IrrigationController extends UnicastRemoteObject implements Weather
                }
 
                System.out.println("DEBUG: Waiting for phone to send weather information");
-               while (waitingForInterface.get()) {
-                       try {
-                               Thread.sleep(1000);
-                       } catch (Exception e) {
-                               e.printStackTrace();
-                       }
-               }
+               //while (waitingForInterface.get()) {
+               //      try {
+               //              Thread.sleep(1000);
+               //      } catch (Exception e) {
+               //              e.printStackTrace();
+               //      }
+               //}
                // TODO: Use a phone input interface later
-               //inchesPerWeek = 20.00;
-               //weatherZipCode = 92612;
-               //daysToWaterOn = 255;
-               //inchesPerMinute.add(1.50);
+               inchesPerWeek = 20.00;
+               weatherZipCode = 92612;
+               daysToWaterOn = 255;
+               inchesPerMinute.add(1.50);
 
                System.out.println("DEBUG: inchesPerWeek: " + inchesPerWeek);
                System.out.println("DEBUG: weatherZipCode: " + weatherZipCode);
@@ -330,6 +330,8 @@ public class IrrigationController extends UnicastRemoteObject implements Weather
                        // init the sprinkler controller, do it here since it only needs to be done once per controller
                        try {
                                spr.init();
+                               // Wait until sprinkler is active
+                               Thread.sleep(30000);
                        } catch (Exception e) {
                                e.printStackTrace();
                        }
index 9f3ad93dd23864cbafb3752e2da2794a063633b8..4f1c915e9b50de1ca76713c2004fada6b05cf3af 100644 (file)
@@ -340,7 +340,7 @@ 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);
@@ -362,6 +362,8 @@ public class SmartLightsController {
                        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()) {
@@ -371,9 +373,12 @@ 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 <specified time>
                        long currentTimeSeconds = (new Date()).getTime() / 1000;
@@ -410,7 +415,7 @@ public class SmartLightsController {
                                }
                        }
 
-               }
+               }*/
        }
 }
 
index 9b21ecdb943177138ef51f6b181bed0b204c6009..b6c0316a56697ea168903985ecb574a5d557dd5a 100644 (file)
@@ -1,5 +1,5 @@
 SELECT * FROM
 CameraSmart
 WHERE
-ID='CM4'
+ID='CM2'
 ;
index 4233b236d43a3150edded771570980a70787f964..5798c171313152480bc35c4628c6ee76e3206fbd 100644 (file)
@@ -1,5 +1,5 @@
-SELECT * FROM\r
-CameraSmart\r
-WHERE\r
-ID='CM3'\r
-;\r
+SELECT * FROM
+CameraSmart
+WHERE
+ID='CM1'
+;
index e84b46408d40ffee2c9cb1d18bd1ca7d3fdab6ee..d4f64bd80f6406283c03431e9a5e186ac2c1b600 100644 (file)
@@ -1,5 +1,5 @@
 SELECT * FROM
 CameraSmart
 WHERE
-ID='CM1' or ID='CM2'
+ID='CM3' or ID='CM4'
 ;
index 123e17bec1456172b01cfc21ba41ca320fca69ae..5604d94dc3d2f192d392eae8fb95c599a2792660 100644 (file)
Binary files a/others/Mysql/IoTMain.gz and b/others/Mysql/IoTMain.gz differ