aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--funcGenerator.py13
1 files changed, 4 insertions, 9 deletions
diff --git a/funcGenerator.py b/funcGenerator.py
index e82f227..1d782a3 100644
--- a/funcGenerator.py
+++ b/funcGenerator.py
@@ -37,14 +37,14 @@ class RampGen:
span = self.stop - self.start;
self.setCenterAndSpan(center, span)
- def getCenter(self, center):
- retrun (self.stop + self.start)/2
+ def getCenter(self):
+ return (self.stop + self.start)/2
def setSpan(self, span):
center = (self.stop + self.start)/2
self.setCenterAndSpan(center, span)
- def getSpan(self, span):
+ def getSpan(self):
return self.stop - self.start;
def getValue(self, sweeper=None):
@@ -55,13 +55,8 @@ class RampGen:
sweeper = self.sweeper
return self.start + sweeper.getRelPos()*(self.stop - self.start)
-class TriangleGen:
+class TriangleGen(RampGen):
# monotonically goes from start to stop, once reaches stop goes back to start
- def __init__(self, start=0, stop=0, sweeper=None):
- self.start = start
- self.stop = stop
- self.sweeper = sweeper
-
def getValue(self, sweeper=None):
if sweeper is None and self.sweeper is None:
print("Error: generator needs sweeper")