package ColorControl
import Timer.SimulatedTimer
-//JPF's Verify API
-import gov.nasa.jpf.vm.Verify
-
public class ColorControls {
private int deviceNumbers
private List colorControls
private int colorTemperature = 15000
- ColorControls(Closure sendEvent, int deviceNumbers) {
+ ColorControls(Closure sendEvent, int deviceNumbers, boolean init) {
this.sendEvent = sendEvent
this.deviceNumbers = deviceNumbers
this.colorControls = []
- /*def initHue = Verify.getIntFromList(30, 50)
- this.hue = initHue
- def initSat = Verify.getIntFromList(40, 50)
- this.saturation = initSat
- def initColor = Verify.getBoolean()
- if (initColor) {
- this.color = "red"
- } else {
- this.color = "blue"
- }
- def init = Verify.getBoolean()
if (init) {
+ this.hue = 30
+ this.saturation = 40
+ this.color = "red"
this.currentSwitch = "off"
} else {
+ this.hue = 50
+ this.saturation = 50
+ this.color = "blue"
this.currentSwitch = "on"
- }*/
+ }
colorControls.add(new ColorControl(sendEvent, id, label, displayName, this.color, this.hue, this.saturation, this.level, this.currentSwitch, this.colorTemperature))
}
}
}
- def on(String currentSwitch) {
- if (currentSwitch != this.currentSwitch) {
- this.currentSwitch = currentSwitch
- colorControls[0].on(currentSwitch)
+ def on() {
+ if (this.currentSwitch != "on") {
+ this.currentSwitch = "on"
+ colorControls[0].on()
}
}
- def off(String currentSwitch) {
- if (currentSwitch != this.currentSwitch) {
- this.currentSwitch = currentSwitch
- colorControls[0].off(currentSwitch)
+ def off() {
+ if (this.currentSwitch != "off") {
+ this.currentSwitch = "off"
+ colorControls[0].off()
}
}