Merge branch 'master' of ssh://plrg.eecs.uci.edu/home/git/smartthings-infrastructure
authoramiraj <amiraj.95@uci.edu>
Mon, 29 Jul 2019 21:11:59 +0000 (14:11 -0700)
committeramiraj <amiraj.95@uci.edu>
Mon, 29 Jul 2019 21:11:59 +0000 (14:11 -0700)
27 files changed:
1  2 
Battery/Batteries.groovy
CarbonMonoxideDetector/CarbonMonoxideDetectors.groovy
ColorControl/ColorControls.groovy
DoorControl/DoorControls.groovy
EnergyMeter/EnergyMeters.groovy
Extractor/Extractor.groovy
Extractor/ExtractorScript.py
GlobalVariables/GlobalVariablesBothApps.groovy
Methods/eventHandler.groovy
ModelCheck.py
MusicPlayer/MusicPlayers.groovy
Runner.py
Switch/Switches.groovy
Thermostat/Thermostats.groovy
eventSimulator/accelerationActiveEvent.groovy
eventSimulator/accelerationInactiveEvent.groovy
eventSimulator/beaconLeftEvent.groovy
eventSimulator/beaconPresentEvent.groovy
eventSimulator/carbonMonoxideClearEvent.groovy
eventSimulator/carbonMonoxideDetectedEvent.groovy
eventSimulator/carbonMonoxideTestedEvent.groovy
eventSimulator/colorChangedEvent.groovy
eventSimulator/hueChangedEvent.groovy
eventSimulator/saturationChangedEvent.groovy
eventSimulator/smokeCarbonMonoxideClearEvent.groovy
eventSimulator/smokeCarbonMonoxideDetectedEvent.groovy
eventSimulator/smokeCarbonMonoxideTestedEvent.groovy

@@@ -22,10 -22,10 +22,13 @@@ public class Batteries 
                this.sendEvent = sendEvent              
                this.deviceNumbers = deviceNumbers
                this.batteries = []
+               
+               def init = Verify.getIntFromList(30, 50, 70)
+               this.battery = init
  
 +              def init = Verify.getIntFromList(30, 50, 70)
 +              this.battery = init
 +
                batteries.add(new Battery(id, label, displayName, this.battery))
        }
  
@@@ -35,7 -35,7 +35,11 @@@ public class CarbonMonoxideDetectors 
                        this.carbonMonoxide = "tested"
                        this.carbonMonoxideLatestValue = "tested"               
                }
++<<<<<<< HEAD
 +              carbonMonoxideDetectors.add(new CarbonMonoxideDetector(id, label, displayName, this.currentCarbonMonoxideValue, this.carbonMonoxideLatestValue))
++=======
+               carbonMonoxideDetectors.add(new CarbonMonoxideDetector(id, label, displayName, this.carbonMonoxide, this.carbonMonoxideLatestValue))
++>>>>>>> e378d6a65b25030f8914dc97f04b81ddff351d9c
        }
  
        //By Model Checker
@@@ -23,20 -23,20 +23,33 @@@ public class ColorControls 
                this.sendEvent = sendEvent
                this.deviceNumbers = deviceNumbers
                this.colorControls = []
+               
+               def initHue = Verify.getIntFromList(30, 50, 70)
+               this.hue = initHue
+               def initSat = Verify.getIntFromList(40, 50, 60)
+               this.saturation = initSat
+               def init = Verify.getInt(0,2)
+               if (init == 0) {
+                       this.color = "red"
+               } else if (init == 1) {
+                       this.color = "green"
+               } else {
+                       this.color = "blue"
+               }
  
 +              def initHue = Verify.getIntFromList(30, 50, 70)
 +              this.hue = initHue
 +              def initSat = Verify.getIntFromList(40, 50, 60)
 +              this.saturation = initSat
 +              def init = Verify.getInt(0,2)
 +              if (init == 0) {
 +                      this.color = "red"
 +              } else if (init == 1) {
 +                      this.color = "green"
 +              } else {
 +                      this.color = "blue"
 +              }
 +
                colorControls.add(new ColorControl(id, label, displayName, this.color, this.hue, this.saturation))
        }
  
@@@ -23,7 -23,7 +23,11 @@@ public class DoorControls 
                this.timers = new SimulatedTimer()
                this.deviceNumbers = deviceNumbers
                this.doorControls = []
++<<<<<<< HEAD
 +              
++=======
++>>>>>>> e378d6a65b25030f8914dc97f04b81ddff351d9c
                def init = Verify.getBoolean()
                if (init) {
                        this.doorState = "closed"
@@@ -22,10 -18,10 +22,17 @@@ public class EnergyMeters 
                this.sendEvent = sendEvent              
                this.deviceNumbers = deviceNumbers
                this.energyMeters = []
++<<<<<<< HEAD
 +
 +              def init = Verify.getIntFromList(30, 50, 70)
 +              this.energy = init
 +
++=======
+               
+               def init = Verify.getIntFromList(30, 50, 70)
+               this.energy = init
+               
++>>>>>>> e378d6a65b25030f8914dc97f04b81ddff351d9c
                energyMeters.add(new EnergyMeter(id, label, displayName, this.energy))
        }
  
@@@ -1365,6 -1013,10 +1365,13 @@@ def input(LinkedHashMap metaData) 
                        }
                        break
                case "enum":
++<<<<<<< HEAD
++=======
+                       def randomVariable = Math.abs(new Random().nextInt() % 2)
+                       def modes = ["Yes", "No"]
+                       //def userInput = modes[randomVariable]
+                       //def modes = metaData['options']
++>>>>>>> e378d6a65b25030f8914dc97f04b81ddff351d9c
                        if (metaData['options'] != null)
                                modes = metaData['options']
                        else // If it is not named 'options' then it is captured as 'metadata'
@@@ -419,8 -418,7 +419,12 @@@ def CheckIfOnlyTouchEvents()
                        onlyTouchEvents = False
        if onlyTouchEvents is True and app1Subscribe is True and app2Subscribe is True:
                raise Exception("\n\nDirect-Direct Interaction detected: we are skipping this pair...\n\n")
++<<<<<<< HEAD
 +
 +
++=======
+               
++>>>>>>> e378d6a65b25030f8914dc97f04b81ddff351d9c
  #Extract objects to call functions from App1
  F1 = open("Extractor/App1/App1.groovy", "r")
  extractedFunctionsApp1 = open("Extractor/App1/extractedFunctionsApp1.groovy", "w+")
@@@ -479,5 -477,7 +483,10 @@@ extractorFile.close(
  Extractor.close()
  F2.close()
  os.system("groovy -classpath lib/jpf.jar Extractor/extractorFile.groovy")
++<<<<<<< HEAD
++=======
++>>>>>>> e378d6a65b25030f8914dc97f04b81ddff351d9c
  
  
@@@ -8,8 -8,6 +8,11 @@@
  @Field def appObject = new Touched(sendEvent, 0)
  //Create a global list for events
  //@Field def evt = []
++<<<<<<< HEAD
 +//Global Object for class AtomicState!
 +@Field def atomicState = new AtomicState()
++=======
++>>>>>>> e378d6a65b25030f8914dc97f04b81ddff351d9c
  //Global Object for class Touch Sensor!
  @Field def touchSensorObject = new NfcTouch(sendEvent, 1)
  //Global Object for class switch!
@@@ -13,6 -13,7 +13,10 @@@ def eventHandler(LinkedHashMap eventDat
        for (int i = 0;i < app2.eventList.size();i++) {
                if (app2.eventList[i] == name) {
                        def event = new Event(value, name, deviceId, descriptionText, displayed, linkText, linkText, isStateChange, unit, data)
++<<<<<<< HEAD
++=======
+                       //evt.add(event)
++>>>>>>> e378d6a65b25030f8914dc97f04b81ddff351d9c
                        app2.functionList[i](event)
                }
        }
        for (int i = 0;i < app1.eventList.size();i++) {
                if (app1.eventList[i] == name) {
                        def event = new Event(value, name, deviceId, descriptionText, displayed, linkText, linkText, isStateChange, unit, data)
++<<<<<<< HEAD
++=======
+                       //evt.add(event)
++>>>>>>> e378d6a65b25030f8914dc97f04b81ddff351d9c
                        app1.functionList[i](event)
                }
        }
diff --cc ModelCheck.py
@@@ -117,3 -117,8 +117,11 @@@ writeLogList.close(
  
  
  
++<<<<<<< HEAD
++=======
++>>>>>>> e378d6a65b25030f8914dc97f04b81ddff351d9c
@@@ -27,22 -27,36 +27,51 @@@ public class MusicPlayers 
                this.sendEvent = sendEvent
                this.deviceNumbers = deviceNumbers
                this.musicPlayers = []
+               
+               def initLevel = Verify.getIntFromList(10, 20, 30)
+               this.level = initLevel
+               def initTrack = Verify.getIntFromList(1, 2, 3)
+               this.trackNumber = initTrack
+               def initMute = Verify.getBoolean()
+               if (initMute) {
+                       this.mute = "unmuted"
+               } else {
+                       this.mute = "mute"
+               }
+               def initStatus = Verify.getBoolean()
+               if (initStatus) {
+                       this.status = "pause"
+               } else {
+                       this.status = "play"
+               }
+               def initTrackData = Verify.getBoolean()
+               if (initTrackData) {
+                       this.trackData = "someTrack"
+               } else {
+                       this.trackData = "someOtherTrack"
+               }
+               def initTrackDesc = Verify.getBoolean()
+               if (initTrackDesc) {
+                       this.trackDescription = "someDescriptions"
+               } else {
+                       this.trackDescription = "someOtherDescriptions"
+               }
  
 +              def initLevel = Verify.getIntFromList(10, 20, 30)
 +              this.level = initLevel
 +              def initMute = Verify.getBoolean()
 +              if (initMute) {
 +                      this.mute = "unmuted"
 +              } else {
 +                      this.mute = "mute"
 +              }
 +              def initStatus = Verify.getBoolean()
 +              if (initStatus) {
 +                      this.status = "paused"
 +              } else {
 +                      this.status = "playing"
 +              }
 +
                musicPlayers.add(new MusicPlayer(id, label, displayName, this.level, this.mute, this.status, this.trackNumber, this.trackData, this.trackDescription))
        }
  
diff --cc Runner.py
+++ b/Runner.py
@@@ -303,8 -244,8 +303,13 @@@ Out.write("if (installOrder) {\n"
  Out.write("\tapp1.installed()\n")
  Out.write("\tapp2.installed()\n")
  Out.write("} else {\n")
++<<<<<<< HEAD
 +Out.write("\tapp2.installed()\n")
 +Out.write("\tapp1.installed()\n")
++=======
+ Out.write("\tapp1.installed()\n")
+ Out.write("\tapp2.installed()\n")
++>>>>>>> e378d6a65b25030f8914dc97f04b81ddff351d9c
  Out.write("}\n\n")
  for line in eventSimulator:
        Out.write(line)
@@@ -25,20 -25,20 +25,33 @@@ public class Switches 
                this.timers = new SimulatedTimer()
                this.deviceNumbers = deviceNumbers
                this.switches = []
+               
+               def initLevel = Verify.getIntFromList(30, 50, 70)
+               this.currentLevel = initLevel
+               def init = Verify.getBoolean()
+               if (init) {
+                       this.switchState = "off"
+                       this.currentSwitch = "off"
+                       this.switchLatestValue = "off"
+               } else {
+                       this.switchState = "on"
+                       this.currentSwitch = "on"
+                       this.switchLatestValue = "on"
+               }
  
 +              def initLevel = Verify.getIntFromList(30, 50, 70)
 +              this.currentLevel = initLevel
 +              def init = Verify.getBoolean()
 +              if (init) {
 +                      this.switchState = "off"
 +                      this.currentSwitch = "off"
 +                      this.switchLatestValue = "off"
 +              } else {
 +                      this.switchState = "on"
 +                      this.currentSwitch = "on"
 +                      this.switchLatestValue = "on"
 +              }
 +
                switches.add(new Switch(sendEvent, id, label, displayName, this.switchState, this.currentSwitch, this.currentLevel, this.switchLatestValue))
        }
  
@@@ -50,7 -50,7 +50,11 @@@ public class Thermostats
                this.heatingSetpoint = initHeatingSetpoint
                
                def initThermostatSetpoint = Verify.getIntFromList(50, 60, 70)
++<<<<<<< HEAD
 +              this.thermostatSetpoint = initThermostatSetpoint
++=======
+               this.currentHeatingSetpoint = initThermostatSetpoint
++>>>>>>> e378d6a65b25030f8914dc97f04b81ddff351d9c
                
                def initFanMode = Verify.getInt(0,4)
                if (initFanMode == 0) {
@@@ -1,2 -1,2 +1,6 @@@
                        accelerationSensorObject.setValue([name: "acceleration", value: "active", deviceId: "accelerationSensorID0", descriptionText: "",
++<<<<<<< HEAD
 +                                      displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
++=======
+                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
++>>>>>>> e378d6a65b25030f8914dc97f04b81ddff351d9c
@@@ -1,2 -1,2 +1,6 @@@
                        accelerationSensorObject.setValue([name: "acceleration", value: "inactive", deviceId: "accelerationSensorID0", descriptionText: "",
++<<<<<<< HEAD
 +                                      displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
++=======
+                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
++>>>>>>> e378d6a65b25030f8914dc97f04b81ddff351d9c
@@@ -1,2 -1,2 +1,7 @@@
++<<<<<<< HEAD
 +                      beaconSensorObject.setValue([name: "presence", value: "not present", deviceId: "beaconSensorID0", descriptionText: "",
 +                                      displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"presence":"0","dni":"mobile0"}'])
++=======
+                       beaconSensorObject.setValue([name: "beacon", value: "not present", deviceId: "beaconSensorID0", descriptionText: "",
+                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
++>>>>>>> e378d6a65b25030f8914dc97f04b81ddff351d9c
@@@ -1,2 -1,2 +1,7 @@@
++<<<<<<< HEAD
 +                      beaconSensorObject.setValue([name: "presence", value: "present", deviceId: "beaconeSensorID0", descriptionText: "",
 +                                      displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"presence":"1","dni":"mobile0"}'])
++=======
+                       beaconSensorObject.setValue([name: "beacon", value: "present", deviceId: "beaconeSensorID0", descriptionText: "",
+                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
++>>>>>>> e378d6a65b25030f8914dc97f04b81ddff351d9c
@@@ -1,2 -1,2 +1,6 @@@
                        carbonMonoxideDetectorObject.setValue([name: "carbonMonoxide", value: "clear", deviceId: "carbonMonoxideDetectorID0", descriptionText: "",
++<<<<<<< HEAD
 +                                      displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
++=======
+                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
++>>>>>>> e378d6a65b25030f8914dc97f04b81ddff351d9c
@@@ -1,2 -1,2 +1,6 @@@
                        carbonMonoxideDetectorObject.setValue([name: "carbonMonoxide", value: "tested", deviceId: "carbonMonoxideDetectorID0", descriptionText: "",
++<<<<<<< HEAD
 +                                      displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
++=======
+                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
++>>>>>>> e378d6a65b25030f8914dc97f04b81ddff351d9c
@@@ -1,2 -1,2 +1,6 @@@
                        carbonMonoxideDetectorObject.setValue([name: "carbonMonoxide", value: "tested", deviceId: "carbonMonoxideDetectorID0", descriptionText: "",
++<<<<<<< HEAD
 +                                      displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
++=======
+                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
++>>>>>>> e378d6a65b25030f8914dc97f04b81ddff351d9c
@@@ -1,2 -1,2 +1,6 @@@
                        colorControlObject.setValue([name: "color", value: "red", deviceId: "colorControlID0", descriptionText: "",
++<<<<<<< HEAD
 +                                      displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
++=======
+                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
++>>>>>>> e378d6a65b25030f8914dc97f04b81ddff351d9c
@@@ -1,2 -1,2 +1,6 @@@
                        colorControlObject.setValue([name: "hue", value: "50", deviceId: "colorControlID0", descriptionText: "",
++<<<<<<< HEAD
 +                                      displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
++=======
+                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
++>>>>>>> e378d6a65b25030f8914dc97f04b81ddff351d9c
@@@ -1,2 -1,2 +1,6 @@@
                        colorControlObject.setValue([name: "saturation", value: "50", deviceId: "colorControlID0", descriptionText: "",
++<<<<<<< HEAD
 +                                      displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
++=======
+                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
++>>>>>>> e378d6a65b25030f8914dc97f04b81ddff351d9c
@@@ -1,2 -1,2 +1,6 @@@
                        smokeDetectorObject.setValue([name: "carbonMonoxide", value: "clear", deviceId: "smokeDetectorID0", descriptionText: "",
++<<<<<<< HEAD
 +                                      displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
++=======
+                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
++>>>>>>> e378d6a65b25030f8914dc97f04b81ddff351d9c
@@@ -1,2 -1,2 +1,6 @@@
                        smokeDetectorObject.setValue([name: "carbonMonoxide", value: "detected", deviceId: "smokeDetectorID0", descriptionText: "",
++<<<<<<< HEAD
 +                                      displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
++=======
+                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
++>>>>>>> e378d6a65b25030f8914dc97f04b81ddff351d9c
@@@ -1,2 -1,2 +1,6 @@@
                        smokeDetectorObject.setValue([name: "carbonMonoxide", value: "tested", deviceId: "smokeDetectorID0", descriptionText: "",
++<<<<<<< HEAD
 +                                      displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
++=======
+                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
++>>>>>>> e378d6a65b25030f8914dc97f04b81ddff351d9c