Adding another value for illuminance measurement event.
authorrtrimana <rtrimana@uci.edu>
Sun, 11 Aug 2019 21:28:41 +0000 (14:28 -0700)
committerrtrimana <rtrimana@uci.edu>
Sun, 11 Aug 2019 21:28:41 +0000 (14:28 -0700)
Extractor/ExtractorScript.py
eventSimulator/illuminanceMeasurementEvent.groovy [deleted file]
eventSimulator/illuminanceMeasurementHighEvent.groovy [new file with mode: 0644]
eventSimulator/illuminanceMeasurementLowEvent.groovy [new file with mode: 0644]

index 1643c43..660295d 100644 (file)
@@ -47,7 +47,7 @@ eventTypeCounterMap =  {'lock': 2,
                                                'saturation' : 1,
                                                'energy' : 1,
                                                'power' : 2,
-                                               'illuminance' : 1,
+                                               'illuminance' : 2,
                                                'humidity' : 2,
                                                'alarm' : 4,
                                                'contact' : 2,
@@ -60,7 +60,7 @@ eventTypeCounterMap =  {'lock': 2,
                                                'heatingSetpoint' : 1,
                                                'coolingSetpoint' : 1,
                                                'thermostatSetpoint' : 1,
-                                                'threeAxis' : 1}
+                                               'threeAxis' : 1}
 
 # Mapping for specific event types
 eventTypesMap =           {'alarm.both': 'alarm',
@@ -824,7 +824,14 @@ def ExtractEvents(extractedEvents):
                                extractedEvents.write(line)
                        event.close()
                elif eventList[i] == "illuminance":
-                       event = open("eventSimulator/illuminanceMeasurementEvent.groovy", "r")
+                       event = open("eventSimulator/illuminanceMeasurementLowEvent.groovy", "r")
+                       for line in event:
+                               extractedEvents.write(line)
+                       event.close()
+                       extractedEvents.write("\n\t\t\tbreak\n")
+                       counter = counter + 1
+                       extractedEvents.write("\t\tcase %d:\n" % counter)
+                       event = open("eventSimulator/illuminanceMeasurementHighEvent.groovy", "r")
                        for line in event:
                                extractedEvents.write(line)
                        event.close()
diff --git a/eventSimulator/illuminanceMeasurementEvent.groovy b/eventSimulator/illuminanceMeasurementEvent.groovy
deleted file mode 100644 (file)
index de15937..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-                       illuminanceMeasurementObject.setValue([name: "illuminance", value: "70"/*A number between 0 to 100 as a charge*/, deviceId: "illuminanceMeasurementID0", descriptionText: "",
-                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
diff --git a/eventSimulator/illuminanceMeasurementHighEvent.groovy b/eventSimulator/illuminanceMeasurementHighEvent.groovy
new file mode 100644 (file)
index 0000000..c2c5029
--- /dev/null
@@ -0,0 +1,2 @@
+                       illuminanceMeasurementObject.setValue([name: "illuminance", value: "100"/*A number between 0 to 100 as a charge*/, deviceId: "illuminanceMeasurementID0", descriptionText: "",
+                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
diff --git a/eventSimulator/illuminanceMeasurementLowEvent.groovy b/eventSimulator/illuminanceMeasurementLowEvent.groovy
new file mode 100644 (file)
index 0000000..f515640
--- /dev/null
@@ -0,0 +1,2 @@
+                       illuminanceMeasurementObject.setValue([name: "illuminance", value: "0"/*A number between 0 to 100 as a charge*/, deviceId: "illuminanceMeasurementID0", descriptionText: "",
+                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])