Cleaning up Extractor.groovy.
authorrtrimana <rtrimana@uci.edu>
Fri, 2 Aug 2019 22:08:48 +0000 (15:08 -0700)
committerrtrimana <rtrimana@uci.edu>
Fri, 2 Aug 2019 22:08:48 +0000 (15:08 -0700)
Extractor/Extractor.groovy

index d2ef5c0..75341c0 100644 (file)
@@ -384,14 +384,6 @@ def input(LinkedHashMap metaData) {
                println "Options: "+metaData['options']
        }
        def contains = 0
-       // Return if this capability has been instantiated
-       //if (metaData['type'].startsWith("device") || metaData['type'].startsWith("capability")) {
-       //      if (capabilitySet.contains(metaData['type'])) {
-       //              return
-       //      } else {
-       //              capabilitySet.add(metaData['type'])
-       //      }
-       //}
        switch(metaData['type']) {
                case "capability.lock":
                        globalObjects.eachLine { line ->
@@ -400,7 +392,7 @@ def input(LinkedHashMap metaData) {
                            }
                        }
 
-                       if (contains == 0) 
+                       if (contains == 0)
                                globalObjects.append("@Field def lockObject = new Locks(sendEvent, 1)\n")
 
                        if (lockObjects == 0) {
@@ -1374,7 +1366,7 @@ def input(LinkedHashMap metaData) {
                        }
                        break
                case "capability.imageCapture":
-                       contains = globalObjects.eachLine { line ->
+                       globalObjects.eachLine { line ->
                                if(line.contains("imageCaptureObject")){
                                        contains = 1
                                }
@@ -1409,7 +1401,7 @@ def input(LinkedHashMap metaData) {
                        }
                        break
                case "device.mobilePresence":
-                       contains = globalObjects.eachLine { line ->
+                       globalObjects.eachLine { line ->
                                if(line.contains("mobilePresenceObject")){
                                        contains = 1
                                }
@@ -1444,12 +1436,11 @@ def input(LinkedHashMap metaData) {
                        }
                        break
                case "device.aeonKeyFob":
-                       contains = globalObjects.eachLine { line ->
+                       globalObjects.eachLine { line ->
                                if(line.contains("aeonKeyFobObject")){
                                        contains = 1
                                }
                        }
-
                        if (contains == 0)
                                globalObjects.append("@Field def aeonKeyFobObject = new AeonKeyFobs(sendEvent, 1)\n")