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))
}
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
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))
}
this.timers = new SimulatedTimer()
this.deviceNumbers = deviceNumbers
this.doorControls = []
++<<<<<<< HEAD
+
++=======
+
++>>>>>>> e378d6a65b25030f8914dc97f04b81ddff351d9c
def init = Verify.getBoolean()
if (init) {
this.doorState = "closed"
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))
}
}
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'
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+")
Extractor.close()
F2.close()
os.system("groovy -classpath lib/jpf.jar Extractor/extractorFile.groovy")
++<<<<<<< HEAD
++=======
+
+
++>>>>>>> e378d6a65b25030f8914dc97f04b81ddff351d9c
@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!
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)
}
}
++<<<<<<< HEAD
++=======
+
+
+
+
+
++>>>>>>> e378d6a65b25030f8914dc97f04b81ddff351d9c
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))
}
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)
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))
}
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) {
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
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
++<<<<<<< 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
++<<<<<<< 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
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
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
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
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
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
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
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
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
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