aboutsummaryrefslogtreecommitdiff
path: root/qolab/hardware/scope
diff options
context:
space:
mode:
authorEugeniy E. Mikhailov <evgmik@gmail.com>2021-12-09 15:15:56 -0500
committerEugeniy E. Mikhailov <evgmik@gmail.com>2021-12-09 15:15:56 -0500
commitf2d02880a3c0c8b4f7a0959d4e8e1e6eccc52518 (patch)
tree8890f371ad5a2cc31df7a031f93b2c6c145ecd58 /qolab/hardware/scope
parent4e4bff72bef3f67cb39f8bc6e066fd2c31edd1f5 (diff)
downloadqolab-f2d02880a3c0c8b4f7a0959d4e8e1e6eccc52518.tar.gz
qolab-f2d02880a3c0c8b4f7a0959d4e8e1e6eccc52518.zip
redone configuration creation for a scope
Diffstat (limited to 'qolab/hardware/scope')
-rw-r--r--qolab/hardware/scope/__init__.py10
-rw-r--r--qolab/hardware/scope/sds1104x.py17
2 files changed, 16 insertions, 11 deletions
diff --git a/qolab/hardware/scope/__init__.py b/qolab/hardware/scope/__init__.py
index 3ab2a2e..f5e7ba2 100644
--- a/qolab/hardware/scope/__init__.py
+++ b/qolab/hardware/scope/__init__.py
@@ -11,6 +11,9 @@ class Scope:
# Minimal set of methods to be implemented by a scope.
def __init__(self):
+ self.config={}
+ self.config['Device type'] = 'Scope'
+ self.config['Device model'] = 'Generic Scope Without Hardware interface'
self.numberOfChannels = 0
self.fname_prefix = 'scope'
self.savepath = './scope'
@@ -29,12 +32,13 @@ class Scope:
def getAllTraces(self, availableNpnts=None, maxRequiredPoints=None):
allTraces=TraceSetSameX('scope traces')
+ allTraces.config['tags']['DAQ']=self.getConfig()
for chNum in range(1, self.numberOfChannels+1):
allTraces.addTrace( self.getTrace(chNum, availableNpnts, maxRequiredPoints) )
return( allTraces )
def getConfig(self):
- config = {}
+ config = self.config.copy()
dconfig = {}
dconfig['id'] = self.idn
for p in self.deviceProperties:
@@ -44,7 +48,7 @@ class Scope:
continue
res = getattr(self, getter)()
dconfig[p] = res
- config['Device'] = dconfig
+ config['DeviceConfig'] = dconfig
chconfig = {}
for chNum in range(1, self.numberOfChannels+1):
chNconfig = {}
@@ -56,7 +60,7 @@ class Scope:
res = getattr(self, getter)(chNum)
chNconfig[p] = res
chconfig[chNum] = chNconfig
- config['Channels']=chconfig
+ config['ChannelsConfig']=chconfig
return config
def getHeader(self):
diff --git a/qolab/hardware/scope/sds1104x.py b/qolab/hardware/scope/sds1104x.py
index 6c7116c..afc68bb 100644
--- a/qolab/hardware/scope/sds1104x.py
+++ b/qolab/hardware/scope/sds1104x.py
@@ -13,6 +13,7 @@ class SDS1104X(ScopeSCPI):
horizDivOnScreen = 14
def __init__(self, resource):
super().__init__(resource)
+ self.config['Device model'] = 'SDS1104X'
self.resource.read_termination='\n'
self.numberOfChannels = 4
self.maxRequiredPoints = 1000; # desired number of points per channel, can return twice more
@@ -138,9 +139,9 @@ class SDS1104X(ScopeSCPI):
VoltsPerDiv = self.getChanVoltsPerDiv(chNum)
tr = trRaw
tr.values = trRaw.values * VoltsPerDiv * self.vertDivOnScreen/250 -VoltageOffset
- tr.unit = 'Volt'
- tr.tags['VoltageOffset'] = VoltageOffset
- tr.tags['VoltsPerDiv'] = VoltsPerDiv
+ tr.config['unit'] = 'Volt'
+ tr.config['tags']['VoltageOffset'] = VoltageOffset
+ tr.config['tags']['VoltsPerDiv'] = VoltsPerDiv
return(tr, availableNpnts)
def getTimeTrace(self, availableNpnts=None, maxRequiredPoints=None):
@@ -155,11 +156,11 @@ class SDS1104X(ScopeSCPI):
tval = tval - timePerDiv * self.horizDivOnScreen/2 - trigDelay
t = Trace('time')
t.values = tval.reshape(tval.size,1)
- t.unit = 'S'
- t.tags['timePerDiv'] = timePerDiv
- t.tags['trigDelay'] = trigDelay
- t.tags['SampleRate'] = sampleRate
- t.tags['sparsing'] = sparsing
+ t.config['unit'] = 'S'
+ t.config['tags']['timePerDiv'] = timePerDiv
+ t.config['tags']['trigDelay'] = trigDelay
+ t.config['tags']['SampleRate'] = sampleRate
+ t.config['tags']['sparsing'] = sparsing
return(t)
def getTrace(self, chNum, availableNpnts=None, maxRequiredPoints=None):