diff options
Diffstat (limited to 'pixelevents')
-rw-r--r-- | pixelevents/DecayEvent.py | 4 | ||||
-rw-r--r-- | pixelevents/SingleFrameEvent.py | 3 | ||||
-rw-r--r-- | pixelevents/SynchTestEvent.py | 15 |
3 files changed, 22 insertions, 0 deletions
diff --git a/pixelevents/DecayEvent.py b/pixelevents/DecayEvent.py index f8d5ef0..8ff423c 100644 --- a/pixelevents/DecayEvent.py +++ b/pixelevents/DecayEvent.py @@ -3,6 +3,10 @@ import math from util.ColorOps import * import util.Geo as Geo class DecayEvent(PixelEvent): + """DecayEvent is a pixel event that can decay either Exponentially or Proportionally. Specify: + <DecayType> -- Exponential or Proportional + <Coefficient> -- Controls the speed of decay.""" + def initEvent(self): self.coefficient = float(abs(self.Coefficient)) if self.DecayType == 'Exponential': diff --git a/pixelevents/SingleFrameEvent.py b/pixelevents/SingleFrameEvent.py index 767f403..252e31b 100644 --- a/pixelevents/SingleFrameEvent.py +++ b/pixelevents/SingleFrameEvent.py @@ -1,5 +1,8 @@ from operationscore.PixelEvent import * class SingleFrameEvent(PixelEvent): + """SingleFrameEvent is a PixelEvent that will only render for the first frame on which it is + queried""" + def initEvent(self): self.timeState = -1 def state(self, timeDelay): diff --git a/pixelevents/SynchTestEvent.py b/pixelevents/SynchTestEvent.py new file mode 100644 index 0000000..3e7ed0c --- /dev/null +++ b/pixelevents/SynchTestEvent.py @@ -0,0 +1,15 @@ +from operationscore.PixelEvent import * +class SynchTestEvent(PixelEvent): + """SynchTestEvent is an event to test the synchronization of the power supplies""" + def initEvent(self): + self.eventstate = 0 + self.cachedDelay = 0 + def state(self, timeDelay): + if timeDelay != self.cachedDelay: + self.eventstate += 1 + self.cachedDelay = timeDelay + color = [0]*3 + color[self.eventstate % 3] = 150 + if self.eventstate > 500: + self.eventstate = 0 + return color |