}
//By Model Checker
- def setValue(String value) {
- println("the switch with id:$id is setted to level $value!")
- this.level = value.toInteger()
- this.rate = value.toInteger()
+ def setValue(String value, String name) {
+ if (name == "switch") {
+ println("the switch with id:$id is $value!")
+ this.switchLatestValue = value
+ this.switchState = value
+ this.currentSwitch = value
+ } else if (name == "level") {
+ println("the switch with id:$id is setted to level $value!")
+ this.level = value.toInteger()
+ this.rate = value.toInteger()
+ }
}
}