From: rtrimana Date: Tue, 16 Jan 2018 00:27:28 +0000 (-0800) Subject: Exchanging cameras between benchmarks; updating database X-Git-Url: http://plrg.eecs.uci.edu/git/?p=iot2.git;a=commitdiff_plain;h=591c0aff5bdd49df51c44160688af993615f6e3e Exchanging cameras between benchmarks; updating database --- diff --git a/benchmarks/Java/HomeSecurityController/HomeSecurityController.java b/benchmarks/Java/HomeSecurityController/HomeSecurityController.java index b6a398a..2ef8dc5 100644 --- a/benchmarks/Java/HomeSecurityController/HomeSecurityController.java +++ b/benchmarks/Java/HomeSecurityController/HomeSecurityController.java @@ -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 } } - }*/ + } } } diff --git a/benchmarks/Java/HomeSecurityController/Makefile b/benchmarks/Java/HomeSecurityController/Makefile index 9d3aee2..ca4234c 100644 --- a/benchmarks/Java/HomeSecurityController/Makefile +++ b/benchmarks/Java/HomeSecurityController/Makefile @@ -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) diff --git a/benchmarks/Java/IrrigationController/IrrigationController.java b/benchmarks/Java/IrrigationController/IrrigationController.java index c06646f..4bcec62 100644 --- a/benchmarks/Java/IrrigationController/IrrigationController.java +++ b/benchmarks/Java/IrrigationController/IrrigationController.java @@ -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(); } diff --git a/benchmarks/Java/SmartLightsController/SmartLightsController.java b/benchmarks/Java/SmartLightsController/SmartLightsController.java index 9f3ad93..4f1c915 100644 --- a/benchmarks/Java/SmartLightsController/SmartLightsController.java +++ b/benchmarks/Java/SmartLightsController/SmartLightsController.java @@ -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 long currentTimeSeconds = (new Date()).getTime() / 1000; @@ -410,7 +415,7 @@ public class SmartLightsController { } } - } + }*/ } } diff --git a/localconfig/mysql/camSet.config b/localconfig/mysql/camSet.config index 9b21ecd..b6c0316 100644 --- a/localconfig/mysql/camSet.config +++ b/localconfig/mysql/camSet.config @@ -1,5 +1,5 @@ SELECT * FROM CameraSmart WHERE -ID='CM4' +ID='CM2' ; diff --git a/localconfig/mysql/cameraSet.config b/localconfig/mysql/cameraSet.config index 4233b23..5798c17 100644 --- a/localconfig/mysql/cameraSet.config +++ b/localconfig/mysql/cameraSet.config @@ -1,5 +1,5 @@ -SELECT * FROM -CameraSmart -WHERE -ID='CM3' -; +SELECT * FROM +CameraSmart +WHERE +ID='CM1' +; diff --git a/localconfig/mysql/cameras.config b/localconfig/mysql/cameras.config index e84b464..d4f64bd 100644 --- a/localconfig/mysql/cameras.config +++ b/localconfig/mysql/cameras.config @@ -1,5 +1,5 @@ SELECT * FROM CameraSmart WHERE -ID='CM1' or ID='CM2' +ID='CM3' or ID='CM4' ; diff --git a/others/Mysql/IoTMain.gz b/others/Mysql/IoTMain.gz index 123e17b..5604d94 100644 Binary files a/others/Mysql/IoTMain.gz and b/others/Mysql/IoTMain.gz differ