extractedEvents.write(line)
event.close()
elif eventList[i] == "color":
- event = open("eventSimulator/colorChangedEvent.groovy", "r")
+ event = open("eventSimulator/colorChangeEvent.groovy", "r")
for line in event:
extractedEvents.write(line)
event.close()
elif eventList[i] == "hue":
- event = open("eventSimulator/hueChangedEvent.groovy", "r")
+ event = open("eventSimulator/hueChangeEvent.groovy", "r")
for line in event:
extractedEvents.write(line)
event.close()
elif eventList[i] == "saturation":
- event = open("eventSimulator/saturationChangedEvent.groovy", "r")
+ event = open("eventSimulator/saturationChangeEvent.groovy", "r")
for line in event:
extractedEvents.write(line)
event.close()
/////////////////////////////////////////////////////////////////////
////schedule(time, nameOfFunction as String)
def schedule(String time, String nameOfFunction) {
- def _inputTime = time.split(':')
- Date date = new Date()
- def _currentTime = date.format("HH:mm:ss").split(':')
+ //def _inputTime = time.split(':')
+ //Date date = new Date()
+ //def _currentTime = date.format("HH:mm:ss").split(':')
//Convert input time and current time to minutes
- def inputTime = Integer.parseInt(_inputTime[0])*3600+Integer.parseInt(_inputTime[1])*60
- def currentTime = Integer.parseInt(_currentTime[0])*3600+Integer.parseInt(_currentTime[1])*60+Integer.parseInt(_currentTime[2])
- def delay
+ //def inputTime = Integer.parseInt(_inputTime[0])*3600+Integer.parseInt(_inputTime[1])*60
+ //def currentTime = Integer.parseInt(_currentTime[0])*3600+Integer.parseInt(_currentTime[1])*60+Integer.parseInt(_currentTime[2])
+ //def delay
- if (inputTime < currentTime) {
- delay = 24*60*60-inputTime+currentTime
- } else {
- delay = inputTime-currentTime
- }
+ //if (inputTime < currentTime) {
+ // delay = 24*60*60-inputTime+currentTime
+ //} else {
+ // delay = inputTime-currentTime
+ //}
- timersFuncList.add(nameOfFunction)
- timersList.add(new SimulatedTimer())
- def task = timersList[timersFuncList.indexOf(nameOfFunction)].runAfter(delay*1000*0) {
+ //timersFuncList.add(nameOfFunction)
+ //timersList.add(new SimulatedTimer())
+ def task = timersList[timersFuncList.indexOf(nameOfFunction)].runAfter(/*delay*1000*0*/0) {
"$nameOfFunction"()
}
}
////schedule(time, nameOfFunction as Closure)
def schedule(String time, Closure nameOfFunction) {
- def _inputTime = time.split(':')
- Date date = new Date()
+ //def _inputTime = time.split(':')
+ //Date date = new Date()
def _currentTime = date.format("HH:mm:ss").split(':')
//Convert input time and current time to minutes
- def inputTime = Integer.parseInt(_inputTime[0])*3600+Integer.parseInt(_inputTime[1])*60
- def currentTime = Integer.parseInt(_currentTime[0])*3600+Integer.parseInt(_currentTime[1])*60+Integer.parseInt(_currentTime[2])
- def delay
+ //def inputTime = Integer.parseInt(_inputTime[0])*3600+Integer.parseInt(_inputTime[1])*60
+ //def currentTime = Integer.parseInt(_currentTime[0])*3600+Integer.parseInt(_currentTime[1])*60+Integer.parseInt(_currentTime[2])
+ //def delay
- if (inputTime < currentTime) {
- delay = 24*60*60-inputTime+currentTime
- } else {
- delay = inputTime-currentTime
- }
+ //if (inputTime < currentTime) {
+ // delay = 24*60*60-inputTime+currentTime
+ //} else {
+ // delay = inputTime-currentTime
+ //}
if (timersFuncList.contains(nameOfFunction)) {
timersList[timersFuncList.indexOf(nameOfFunction)].cancel()
- def task = timersList[timersFuncList.indexOf(nameOfFunction)].runAfter(delay*0, nameOfFunction)
+ def task = timersList[timersFuncList.indexOf(nameOfFunction)].runAfter(/*delay*0*/0, nameOfFunction0)
} else {
timersFuncList.add(nameOfFunction)
timersList.add(new SimulatedTimer())
- def task = timersList[timersFuncList.indexOf(nameOfFunction)].runAfter(delay*0, nameOfFunction)
+ def task = timersList[timersFuncList.indexOf(nameOfFunction)].runAfter(/*delay*0*/0, nameOfFunction)
}
}