//By Model Checker
def setValue(LinkedHashMap eventDataMap) {
if (eventDataMap["value"] != alarms[0].alarm) {
+ this.alarmLatestValue = eventDataMap["value"]
+ this.alarm = eventDataMap["value"]
+ this.currentAlarm = eventDataMap["value"]
alarms[0].setValue(eventDataMap["value"])
- this.alarmLatestValue = alarms[0].alarmLatestValue
- this.alarm = alarms[0].alarm
- this.currentAlarm = alarms[0].alarm
sendEvent(eventDataMap)
}
}
def find(Closure Input) {
alarms.find(Input)
}
+ def sort(Closure Input) {
+ alarms.sort(Input)
+ }
def collect(Closure Input) {
alarms.collect(Input)
}
//By Apps
def both() {
if (alarm != "both") {
- alarms[0].both()
- alarmLatestValue = alarm
+ alarmLatestValue = "both"
alarm = "both"
currentAlarm = "both"
+ alarms[0].both()
}
}
def off() {
if (alarm != "off") {
- alarms[0].off()
- alarmLatestValue = alarm
+ alarmLatestValue = "off"
alarm = "off"
currentAlarm = "off"
+ alarms[0].off()
}
}
def siren() {
if (alarm != "siren") {
- alarms[0].siren()
- alarmLatestValue = alarm
+ alarmLatestValue = "siren"
alarm = "siren"
currentAlarm = "siren"
+ alarms[0].siren()
}
}
def strobe() {
if (alarm != "strobe") {
- alarms[0].strobe()
- alarmLatestValue = alarm
+ alarmLatestValue = "strobe"
alarm = "strobe"
currentAlarm = "strobe"
+ alarms[0].strobe()
}
}