From: amiraj Date: Mon, 29 Jul 2019 21:11:59 +0000 (-0700) Subject: Merge branch 'master' of ssh://plrg.eecs.uci.edu/home/git/smartthings-infrastructure X-Git-Url: http://plrg.eecs.uci.edu/git/?p=smartthings-infrastructure.git;a=commitdiff_plain;h=d00fd74ad7e497d6849c284c6ba69db2d3ec8e65 Merge branch 'master' of ssh://plrg.eecs.uci.edu/home/git/smartthings-infrastructure --- d00fd74ad7e497d6849c284c6ba69db2d3ec8e65 diff --cc Battery/Batteries.groovy index 8aca5e2,6e40e12..4664fb9 --- a/Battery/Batteries.groovy +++ b/Battery/Batteries.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)) } diff --cc CarbonMonoxideDetector/CarbonMonoxideDetectors.groovy index 2eb9d74,511d031..d61bc59 --- a/CarbonMonoxideDetector/CarbonMonoxideDetectors.groovy +++ b/CarbonMonoxideDetector/CarbonMonoxideDetectors.groovy @@@ -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 diff --cc ColorControl/ColorControls.groovy index d96b978,6eb5ac6..3538447 --- a/ColorControl/ColorControls.groovy +++ b/ColorControl/ColorControls.groovy @@@ -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)) } diff --cc DoorControl/DoorControls.groovy index 2581800,444154d..e8e067a --- a/DoorControl/DoorControls.groovy +++ b/DoorControl/DoorControls.groovy @@@ -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" diff --cc EnergyMeter/EnergyMeters.groovy index a3f2b8d,5967084..8554495 --- a/EnergyMeter/EnergyMeters.groovy +++ b/EnergyMeter/EnergyMeters.groovy @@@ -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)) } diff --cc Extractor/Extractor.groovy index 309223d,00b993d..e8ccbda --- a/Extractor/Extractor.groovy +++ b/Extractor/Extractor.groovy @@@ -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' diff --cc Extractor/ExtractorScript.py index 5bd867a,97b6bff..27abbc1 --- a/Extractor/ExtractorScript.py +++ b/Extractor/ExtractorScript.py @@@ -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 diff --cc GlobalVariables/GlobalVariablesBothApps.groovy index 998778b,f3f944a..bb45ddf --- a/GlobalVariables/GlobalVariablesBothApps.groovy +++ b/GlobalVariables/GlobalVariablesBothApps.groovy @@@ -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! diff --cc Methods/eventHandler.groovy index b838418,4475bc2..1a3dd01 --- a/Methods/eventHandler.groovy +++ b/Methods/eventHandler.groovy @@@ -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) } } @@@ -20,6 -21,7 +24,10 @@@ 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 index d00c699,661018e..e3c6ff9 --- a/ModelCheck.py +++ b/ModelCheck.py @@@ -117,3 -117,8 +117,11 @@@ writeLogList.close( ++<<<<<<< HEAD ++======= + + + + + ++>>>>>>> e378d6a65b25030f8914dc97f04b81ddff351d9c diff --cc MusicPlayer/MusicPlayers.groovy index 63a213b,847dd1c..3e5f4f3 --- a/MusicPlayer/MusicPlayers.groovy +++ b/MusicPlayer/MusicPlayers.groovy @@@ -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 index d72844d,e82d1c2..5d3e101 --- a/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) diff --cc Switch/Switches.groovy index 5a4ef48,36ba2de..d396b90 --- a/Switch/Switches.groovy +++ b/Switch/Switches.groovy @@@ -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)) } diff --cc Thermostat/Thermostats.groovy index 19f5d6f,66957dd..d77af21 --- a/Thermostat/Thermostats.groovy +++ b/Thermostat/Thermostats.groovy @@@ -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) { diff --cc eventSimulator/accelerationActiveEvent.groovy index 6991b56,b7fa4d9..06ec00b --- a/eventSimulator/accelerationActiveEvent.groovy +++ b/eventSimulator/accelerationActiveEvent.groovy @@@ -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 diff --cc eventSimulator/accelerationInactiveEvent.groovy index eaa876f,60c9021..2e5b672 --- a/eventSimulator/accelerationInactiveEvent.groovy +++ b/eventSimulator/accelerationInactiveEvent.groovy @@@ -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 diff --cc eventSimulator/beaconLeftEvent.groovy index 445e51f,699c4e7..36f8bd8 --- a/eventSimulator/beaconLeftEvent.groovy +++ b/eventSimulator/beaconLeftEvent.groovy @@@ -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 diff --cc eventSimulator/beaconPresentEvent.groovy index 816a129,0c20e73..7ce002b --- a/eventSimulator/beaconPresentEvent.groovy +++ b/eventSimulator/beaconPresentEvent.groovy @@@ -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 diff --cc eventSimulator/carbonMonoxideClearEvent.groovy index fb3520d,eca4d6c..0101c3f --- a/eventSimulator/carbonMonoxideClearEvent.groovy +++ b/eventSimulator/carbonMonoxideClearEvent.groovy @@@ -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 diff --cc eventSimulator/carbonMonoxideDetectedEvent.groovy index 6686f91,98f57a6..5a3464c --- a/eventSimulator/carbonMonoxideDetectedEvent.groovy +++ b/eventSimulator/carbonMonoxideDetectedEvent.groovy @@@ -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 diff --cc eventSimulator/carbonMonoxideTestedEvent.groovy index 6686f91,98f57a6..5a3464c --- a/eventSimulator/carbonMonoxideTestedEvent.groovy +++ b/eventSimulator/carbonMonoxideTestedEvent.groovy @@@ -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 diff --cc eventSimulator/colorChangedEvent.groovy index 5ed3b4f,a90b2bc..598e011 --- a/eventSimulator/colorChangedEvent.groovy +++ b/eventSimulator/colorChangedEvent.groovy @@@ -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 diff --cc eventSimulator/hueChangedEvent.groovy index b5d20d2,1f9307b..de7e537 --- a/eventSimulator/hueChangedEvent.groovy +++ b/eventSimulator/hueChangedEvent.groovy @@@ -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 diff --cc eventSimulator/saturationChangedEvent.groovy index 5327de2,09d013b..842d28b --- a/eventSimulator/saturationChangedEvent.groovy +++ b/eventSimulator/saturationChangedEvent.groovy @@@ -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 diff --cc eventSimulator/smokeCarbonMonoxideClearEvent.groovy index 7c1df43,09db47c..06728c7 --- a/eventSimulator/smokeCarbonMonoxideClearEvent.groovy +++ b/eventSimulator/smokeCarbonMonoxideClearEvent.groovy @@@ -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 diff --cc eventSimulator/smokeCarbonMonoxideDetectedEvent.groovy index b889098,5aa27d1..2f2fa4e --- a/eventSimulator/smokeCarbonMonoxideDetectedEvent.groovy +++ b/eventSimulator/smokeCarbonMonoxideDetectedEvent.groovy @@@ -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 diff --cc eventSimulator/smokeCarbonMonoxideTestedEvent.groovy index 2ce58bc,0c6e18e..04b1805 --- a/eventSimulator/smokeCarbonMonoxideTestedEvent.groovy +++ b/eventSimulator/smokeCarbonMonoxideTestedEvent.groovy @@@ -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