aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugeniy E. Mikhailov <evgmik@gmail.com>2021-06-12 17:51:40 -0400
committerEugeniy E. Mikhailov <evgmik@gmail.com>2021-06-12 17:51:40 -0400
commit084a2e98cc81a151cc57eff1a138eecaa1e69f51 (patch)
tree3b726c4ff6152d1c45e2af4ca5e230c06a54c6a7
parente6ef3ba45d318cb6df6b46202068fdbe0a043e87 (diff)
downloadpyExpControl-084a2e98cc81a151cc57eff1a138eecaa1e69f51.tar.gz
pyExpControl-084a2e98cc81a151cc57eff1a138eecaa1e69f51.zip
UE9qolDummy generates some shapes depending on channel
-rw-r--r--ue9qol.py19
1 files changed, 17 insertions, 2 deletions
diff --git a/ue9qol.py b/ue9qol.py
index f25a8ca..6436552 100644
--- a/ue9qol.py
+++ b/ue9qol.py
@@ -37,13 +37,28 @@ class UE9qol:
self.daq.close()
class UE9qolDummy:
+ from funcGenerator import Sweeper, SinGen, TriangleGen, RampGen, PulseGen
# to be used for graphics debugging
- def __init__(self, debug = False, autoOpen = True, **kargs):
+ def __init__(self, debug = False, autoOpen = True, sweeper=None, **kargs):
+ self.sweeper = sweeper
# do nothing
return
def getInputCh(self, chNum):
- return random.normalvariate(chNum, 0.1)
+ a =.3
+ if chNum == 0:
+ val = self.SinGen(ampl=a, offset=chNum, sweeper=self.sweeper).getValue()
+ elif chNum == 1:
+ val = self.PulseGen(ampl=a, sweeper=self.sweeper).getValue()
+ val += chNum
+ elif chNum == 2:
+ val = self.TriangleGen(start=chNum-a/2, stop=chNum+a/2, sweeper=self.sweeper).getValue()
+ elif chNum == 3:
+ val = self.RampGen(start=chNum-a/2, stop=chNum+a/2, sweeper=self.sweeper).getValue()
+ else:
+ val = self.SinGen(ampl=.2, offset=chNum, sweeper=self.sweeper).getValue()
+ val += random.normalvariate(0, 0.01)
+ return val
def setOutputCh(self, chNum=None, volts=None):
# do nothing