Update
This commit is contained in:
@@ -21,7 +21,10 @@ class ZVLNode(fc.Readable):
|
||||
analyser_ip: the IP address of the network analyser. Best to set in the config!
|
||||
"""
|
||||
|
||||
value = fc.Parameter('value', fc.ArrayOf(fc.FloatRange(unit='dB'), minlen=1000, maxlen=1000), readonly=True)
|
||||
value = fc.Parameter('value',
|
||||
fc.StructOf(magnitudes=fc.ArrayOf(fc.FloatRange(unit='dB'), minlen=1000, maxlen=1000),
|
||||
frequencies=fc.ArrayOf(fc.FloatRange(unit='Hz'), minlen=1000, maxlen=1000)),
|
||||
readonly=True)
|
||||
status = fc.Parameter(datatype=frappy.datatypes.StatusType(fc.Readable, "DISABLED", 'PREPARED', 'BUSY'), default=('IDLE', 'idle'))
|
||||
pollinterval = fc.Parameter(default=1)
|
||||
central_freq = fc.Parameter('central_freq', fc.FloatRange(min=9_000, max=13_600_000_000, unit='Hz'), default=10_000_000, readonly=False)
|
||||
@@ -41,16 +44,25 @@ class ZVLNode(fc.Readable):
|
||||
@fc.Command(description="Update data")
|
||||
def acq(self):
|
||||
self.status = ('BUSY', 'acquiring')
|
||||
#print('acq')
|
||||
self.NA.set_freq_span(self.central_freq, self.freq_span)
|
||||
freq, vals = self.NA.get_data()
|
||||
self.value = { 'frequencies': freq, 'magnitudes': vals }
|
||||
self.status = ('IDLE', 'idle')
|
||||
|
||||
def write_calibration(self, f):
|
||||
self.calibration = f
|
||||
self.NA.load_calibration(self.calibration)
|
||||
return self.read_calibration()
|
||||
#@fc.Command(description='Save current calibration')
|
||||
#def write_calibration(self, f):
|
||||
# self.calibration = f
|
||||
# self.NA.load_calibration(self.calibration)
|
||||
# return self.read_calibration()
|
||||
|
||||
@fc.Command(description='Reload last used calibration')
|
||||
def reload_calibration(self):
|
||||
self.NA.reload_calibration()
|
||||
freq_start, freq_stop = self.NA.get_freq_range()
|
||||
self.freq_span = freq_stop - freq_start
|
||||
self.central_freq = freq_start + self.freq_span/2.0
|
||||
|
||||
def write_central_freq(self, f):
|
||||
self.central_freq = (f)
|
||||
self.acq()
|
||||
|
||||
Reference in New Issue
Block a user