From c7c7b55ac220758a47dd5cb104961429bda2c460 Mon Sep 17 00:00:00 2001 From: rtrimana Date: Wed, 31 Jul 2019 14:27:32 -0700 Subject: [PATCH] Fixing a bug in locks: latestValue should have similar value with currentValue. --- Lock/Lock.groovy | 12 ++++++++---- Lock/Locks.groovy | 12 ++++++++---- ModelCheck.py | 1 - 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/Lock/Lock.groovy b/Lock/Lock.groovy index 76482b4..285fe53 100644 --- a/Lock/Lock.groovy +++ b/Lock/Lock.groovy @@ -28,7 +28,8 @@ public class Lock { def lock() { if (lockState != "locked") { println("the door with id:$id is locked!") - this.lockLatestValue = this.lockState + //this.lockLatestValue = this.lockState + this.lockLatestValue = "locked" this.lockState = "locked" this.currentLock = "locked" sendEvent([name: "lock", value: "locked", deviceId: this.id, descriptionText: "", @@ -40,7 +41,8 @@ public class Lock { if (lockState != "locked") { def task = timers.runAfter(metaData["delay"]) { println("the door with id:$id is locked!") - this.lockLatestValue = this.lockState + //this.lockLatestValue = this.lockState + this.lockLatestValue = "locked" this.lockState = "locked" this.currentLock = "locked" sendEvent([name: "lock", value: "locked", deviceId: this.id, descriptionText: "", @@ -52,7 +54,8 @@ public class Lock { def unlock() { if (lockState != "unlocked") { println("the door with id:$id is unlocked!") - this.lockLatestValue = this.lockState + //this.lockLatestValue = this.lockState + this.lockLatestValue = "unlocked" this.lockState = "unlocked" this.currentLock = "unlocked" sendEvent([name: "unlock", value: "unlocked", deviceId: this.id, descriptionText: "", @@ -64,7 +67,8 @@ public class Lock { if (lockState != "unlocked") { def task = timers.runAfter(metaData["delay"]) { println("the door with id:$id is locked!") - this.lockLatestValue = this.lockState + //this.lockLatestValue = this.lockState + this.lockLatestValue = "locked" this.lockState = "locked" this.currentLock = "locked" sendEvent([name: "unlock", value: "unlocked", deviceId: this.id, descriptionText: "", diff --git a/Lock/Locks.groovy b/Lock/Locks.groovy index 951020f..63d93b4 100644 --- a/Lock/Locks.groovy +++ b/Lock/Locks.groovy @@ -39,7 +39,8 @@ public class Locks{ //By Apps def lock() { if (lockState != "locked") { - lockLatestValue = lockState + //lockLatestValue = lockState + lockLatestValue = "locked" lockState = "locked" currentLock = "locked" locks[0].lock() @@ -49,7 +50,8 @@ public class Locks{ def lock(LinkedHashMap metaData) { if (lockState != "locked") { def task = timers.runAfter(metaData["delay"]) { - lockLatestValue = lockState + //lockLatestValue = lockState + lockLatestValue = "locked" lockState = "locked" currentLock = "locked" locks[0].lock() @@ -59,7 +61,8 @@ public class Locks{ def unlock() { if (lockState != "unlocked") { - lockLatestValue = lockState + //lockLatestValue = lockState + lockLatestValue = "unlocked" lockState = "unlocked" currentLock = "unlocked" locks[0].unlock() @@ -70,7 +73,8 @@ public class Locks{ def unlock(LinkedHashMap metaData) { if (lockState != "unlocked") { def task = timers.runAfter(metaData["delay"]) { - lockLatestValue = lockState + //lockLatestValue = lockState + lockLatestValue = "unlocked" lockState = "unlocked" currentLock = "unlocked" locks[0].unlock() diff --git a/ModelCheck.py b/ModelCheck.py index 8ff62ff..1a0c940 100644 --- a/ModelCheck.py +++ b/ModelCheck.py @@ -58,7 +58,6 @@ firstList = sys.argv[4] # PART 1: Generate the permutations of app pairs print "PHASE 1: Extracting the app pairs from the app lists ...\n" -print "Got here!" appList1 = [] appList2 = [] # Extract the first list -- 2.34.1