aboutsummaryrefslogtreecommitdiff
path: root/operationscore
diff options
context:
space:
mode:
Diffstat (limited to 'operationscore')
-rw-r--r--operationscore/PixelAssembler.py3
-rw-r--r--operationscore/PixelEvent.py11
-rw-r--r--operationscore/SmootCoreObject.py3
3 files changed, 14 insertions, 3 deletions
diff --git a/operationscore/PixelAssembler.py b/operationscore/PixelAssembler.py
index b6e35ac..c8563fb 100644
--- a/operationscore/PixelAssembler.py
+++ b/operationscore/PixelAssembler.py
@@ -1,4 +1,5 @@
from operationscore.SmootCoreObject import *
+import util.Geo as Geo
import Util
import pdb
class PixelAssembler(SmootCoreObject):
@@ -17,7 +18,7 @@ class PixelAssembler(SmootCoreObject):
if newLocation == None:
raise Exception('Location cannot be null. layoutFunc not \
defined or improperly defined.')
- if Util.dist(newLocation, locations[-1]) > \
+ if Geo.dist(newLocation, locations[-1]) > \
self['pixelToPixelSpacing']:
raise Exception('Illegal pixel location. Distance \
between adjacent pixels must be less than \
diff --git a/operationscore/PixelEvent.py b/operationscore/PixelEvent.py
index 66b6fdf..e2b852a 100644
--- a/operationscore/PixelEvent.py
+++ b/operationscore/PixelEvent.py
@@ -2,6 +2,7 @@
#which should return a color, or None if the response is complete. Consider
#requiring a generate event.
from operationscore.SmootCoreObject import *
+import util.ColorOps as color
class PixelEvent(SmootCoreObject):
def init(self):
self.validateArgs('PixelEvent.params')
@@ -11,8 +12,16 @@ class PixelEvent(SmootCoreObject):
#Returns a new PixelEvent, but with a response scaled by c.
def scale(self,c):
newDict = dict(self.argDict)
- newDict['Color'] = Util.multiplyColor(newDict['Color'], c)
+ newDict['Color'] = color.multiplyColor(newDict['Color'], c)
return self.__class__(newDict)
def state(self,timeDelay):
pass
+ @staticmethod
+ def addPixelEventIfMissing(responseDict):
+ if not 'PixelEvent' in responseDict:
+ if 'Color' in responseDict:
+ color = responseDict['Color']
+ else:
+ raise Exception('Need Color. Probably')
+ responseDict['PixelEvent'] = StepEvent.generate(300, color)
diff --git a/operationscore/SmootCoreObject.py b/operationscore/SmootCoreObject.py
index 8514b3e..10df299 100644
--- a/operationscore/SmootCoreObject.py
+++ b/operationscore/SmootCoreObject.py
@@ -2,6 +2,7 @@ import Util
import pdb
import threading
import thread
+import util.Config as configGetter
class SmootCoreObject(threading.Thread):
def __init__(self, argDict, skipValidation = False):
self.argDict = argDict
@@ -29,7 +30,7 @@ class SmootCoreObject(threading.Thread):
def __getiter__(self):
return self.argDict.__getiter__()
def validateArgs(self, argFileName):
- self.validateArgDict(Util.loadParamRequirementDict(argFileName))#util
+ self.validateArgDict(configGetter.loadParamRequirementDict(argFileName))#util
#caches for us, woo!
def validateArgDict(self, validationDict):
for item in validationDict: