X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=SpeechSynthesis%2FSpeechSynthesises.groovy;h=876e48d5019f3f84958adbb4eb5664a8be02c671;hb=976904577a2a985ce360227ea29f1cd9e4868703;hp=df2528e0a5133cae58c773769ea3eb75596d04d3;hpb=d3802bd96ca8963ae52b9740443f9be6896f0e18;p=smartthings-infrastructure.git diff --git a/SpeechSynthesis/SpeechSynthesises.groovy b/SpeechSynthesis/SpeechSynthesises.groovy index df2528e..876e48d 100644 --- a/SpeechSynthesis/SpeechSynthesises.groovy +++ b/SpeechSynthesis/SpeechSynthesises.groovy @@ -2,9 +2,6 @@ package SpeechSynthesis import Timer.SimulatedTimer -//JPF's Verify API -import gov.nasa.jpf.vm.Verify - public class SpeechSynthesises { private int deviceNumbers private List speechSynthesises @@ -15,17 +12,22 @@ public class SpeechSynthesises { private String label = "speechSynthesis0" private String displayName = "speechSynthesis0" private int level = 50 + private boolean oneUser = true - SpeechSynthesises(Closure sendEvent, int deviceNumbers) { + SpeechSynthesises(Closure sendEvent, int deviceNumbers, boolean init) { this.sendEvent = sendEvent this.deviceNumbers = deviceNumbers this.speechSynthesises = [] - def init = Verify.getIntFromList(30, 50, 70) - this.level = init - - speechSynthesises.add(new SpeechSynthesis(id, label, displayName, this.level)) + if (init) { + this.level = 50 + this.oneUser = true + } else { + this.level = 60 + this.oneUser = false + } + speechSynthesises.add(new SpeechSynthesis(id, label, displayName, this.level, this.oneUser)) } //Methods for closures @@ -57,6 +59,12 @@ public class SpeechSynthesises { def speak(String message) { speechSynthesises[0].speak(message) + // As a conflict variable + if (oneUser) { + this.oneUser = false + } else { + this.oneUser = true + } } def getAt(int ix) {