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 b6a398a..2ef8dc5 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 9d3aee2..ca4234c 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 c06646f..4bcec62 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 9f3ad93..4f1c915 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 9b21ecd..b6c0316 100644 (file)
@@ -1,5 +1,5 @@
 SELECT * FROM
 CameraSmart
 WHERE
-ID='CM4'
+ID='CM2'
 ;
index 4233b23..5798c17 100644 (file)
@@ -1,5 +1,5 @@
-SELECT * FROM\r
-CameraSmart\r
-WHERE\r
-ID='CM3'\r
-;\r
+SELECT * FROM
+CameraSmart
+WHERE
+ID='CM1'
+;
index e84b464..d4f64bd 100644 (file)
@@ -1,5 +1,5 @@
 SELECT * FROM
 CameraSmart
 WHERE
-ID='CM1' or ID='CM2'
+ID='CM3' or ID='CM4'
 ;
index 123e17b..5604d94 100644 (file)
Binary files a/others/Mysql/IoTMain.gz and b/others/Mysql/IoTMain.gz differ