diff python/events.py @ 321:a5e40bd04cf4

rearranged LCSS indicator functions
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Tue, 07 May 2013 02:02:55 +0200
parents 419f30491a4b
children 6c9c7c956926
line wrap: on
line diff
--- a/python/events.py	Mon May 06 17:20:07 2013 +0200
+++ b/python/events.py	Tue May 07 02:02:55 2013 +0200
@@ -42,10 +42,11 @@
         self.indicators = {}
 
     def getIndicator(self, indicatorName):
-        return self.indicators[indicatorName]
+        return self.indicators.get(indicatorName, None)
 
     def addIndicator(self, indicator):
-        self.indicators[indicator.name] = indicator
+        if indicator:
+            self.indicators[indicator.name] = indicator
 
     def computeIndicators(self):
         '''Computes the collision course cosine only if the cosine is positive'''