Added siggen data to measurement metadata + fixed sweeps
This commit is contained in:
parent
bfb23ad698
commit
6cdc182b57
@ -184,7 +184,7 @@ void Sweep::resetImpl()
|
||||
/* dVARTRACE(15, eps); */
|
||||
d phase = 0;
|
||||
|
||||
for (us n = 0; n <= Ns; n++)
|
||||
for (us n = 0; n < Ns; n++)
|
||||
{
|
||||
/* iVARTRACE(17, n); */
|
||||
if (n < N)
|
||||
@ -285,7 +285,7 @@ void Sweep::resetImpl()
|
||||
DEBUGTRACE_PRINT(k);
|
||||
DEBUGTRACE_PRINT(E);
|
||||
|
||||
for (us n = 0; n <= Ns; n++)
|
||||
for (us n = 0; n < Ns; n++)
|
||||
{
|
||||
/* iVARTRACE(17, n); */
|
||||
if (n < Ns)
|
||||
|
@ -306,6 +306,16 @@ class Measurement:
|
||||
except KeyError:
|
||||
self._type_int = 0
|
||||
|
||||
try:
|
||||
dat = {}
|
||||
|
||||
for key in f['siggen']['Data'].attrs:
|
||||
dat[key] = f['siggen']['Data'].attrs[key]
|
||||
|
||||
self._siggen = {'Type': f['siggen'].attrs["Type"], 'Data': dat}
|
||||
except KeyError:
|
||||
self._siggen = {'Type': 'Muted', 'Data': {}}
|
||||
|
||||
# Due to a previous bug, the channel names were not stored
|
||||
# consistently, i.e. as 'channel_names' and later camelcase.
|
||||
try:
|
||||
@ -571,11 +581,28 @@ class Measurement:
|
||||
"""
|
||||
self.setAttribute("type_int", type_.value)
|
||||
|
||||
def setSiggen(self, siggen_: dict):
|
||||
"""
|
||||
Set the signal generator data
|
||||
"""
|
||||
with self.file("r+") as f:
|
||||
siggen_group = f.create_group("siggen", track_order=True)
|
||||
siggen_group.attrs['Type'] = siggen_['Type']
|
||||
data_group = siggen_group.create_group("Data", track_order=True)
|
||||
for key in siggen_['Data'].keys():
|
||||
data_group.attrs[key] = siggen_['Data'][key]
|
||||
|
||||
def measurementType(self):
|
||||
"""
|
||||
Returns type of measurement
|
||||
"""
|
||||
return MeasurementType(self._type_int)
|
||||
|
||||
def signalGenerator(self):
|
||||
"""
|
||||
Returns signal generator data
|
||||
"""
|
||||
return self._siggen
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
|
Loading…
Reference in New Issue
Block a user