Fix smokedetect file
authorbdemsky <bdemsky@uci.edu>
Thu, 1 Aug 2019 19:10:28 +0000 (12:10 -0700)
committerbdemsky <bdemsky@uci.edu>
Thu, 1 Aug 2019 19:10:28 +0000 (12:10 -0700)
SmokeDetector/SmokeDetectors.groovy
eventSimulator/eventSimulator.groovy

index e7aec2f7aa5279456a837eb2af5f219026802670..188bb98a7acb596fdd7005660d971b12a1e29016 100644 (file)
@@ -21,6 +21,7 @@ public class SmokeDetectors {
        private String currentCarbonMonoxideValue = "clear"
        private String carbonMonoxideLatestValue = "clear"
        private int battery = 50
+        private int batteryValue = 50
        private int batteryLatestValue = 50
 
                
@@ -53,7 +54,7 @@ public class SmokeDetectors {
                        this.carbonMonoxideLatestValue = "tested"               
                }
                }*/
-               smokeDetectors.add(new SmokeDetector(id, label, displayName, this.currentSmokeValue, this.smokeLatestValue))
+               smokeDetectors.add(new SmokeDetector(id, label, displayName, this.currentSmokeValue, this.smokeLatestValue, this.carbonMonoideValue, this.batteryValue))
        }
 
        //By Model Checker
index 393f9bd1fbbbc769d776ad69c819b1b2aff36409..b0f57f5e81d828d3982062fdeaf8eb3b781215e7 100644 (file)
@@ -1,40 +1,13 @@
 while(true) {
-       def eventNumber = Verify.getInt(0,5)
+       def eventNumber = Verify.getInt(0,1)
        switch(eventNumber) {
                case 0:
-                       def event = Verify.getInt(0,1)
-                       if (event == 0) {
-<<<<<<< HEAD
-                                       switchObject.setValue([name: "switch", value: "on", deviceId: "switchID0", descriptionText: "",
-                                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
-                       } else {
-                                       switchObject.setValue([name: "switch", value: "off", deviceId: "switchID0", descriptionText: "",
-=======
-                                       lockObject.setValue([name: "lock", value: "locked", deviceId: "lockID0", descriptionText: "",
-                                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])                       } else {
-                                       lockObject.setValue([name: "lock", value: "unlocked", deviceId: "lockID0", descriptionText: "",
->>>>>>> a02c9807815a35c0f57241ee6510a3d312499049
-                                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
-                       }
-                       break
-               case 1:
-                       break
-               case 2:
-                       colorControlObject.setValue([name: "hue", value: "50", deviceId: "colorControlID0", descriptionText: "",
+                       touchSensorObject.setValue([name: "nfcTouch", value: "touched", deviceId: "nfcSensorID0", descriptionText: "",
                                        displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
                        break
-               case 3:
-                       colorControlObject.setValue([name: "saturation", value: "50", deviceId: "colorControlID0", descriptionText: "",
-                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
-                       break
-               case 4:
-<<<<<<< HEAD
-                       break
-               case 5:
-=======
+               case 1:
                        appObject.setValue([name: "Touched", value: "touched", deviceId: "touchedSensorID0", descriptionText: "",
                                        displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
->>>>>>> a02c9807815a35c0f57241ee6510a3d312499049
                        break
        }
 }