Update
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -24,3 +24,7 @@ doc/_build
|
|||||||
|
|
||||||
# pyinstaller
|
# pyinstaller
|
||||||
dist/
|
dist/
|
||||||
|
|
||||||
|
*.cfg
|
||||||
|
*.bk.tnt
|
||||||
|
*.tps
|
||||||
@@ -25,7 +25,7 @@ if('Capacitance' in enabled_modules):
|
|||||||
Mod('io_capacitance',
|
Mod('io_capacitance',
|
||||||
'frappy_psi.capacitance_readings.TSSOP16.TSSOP16_IO',
|
'frappy_psi.capacitance_readings.TSSOP16.TSSOP16_IO',
|
||||||
'communication',
|
'communication',
|
||||||
uri='serial://COM4?baudrate=9600+bytesize=8+parity=none+stopbits=1')
|
uri='serial://COM5?baudrate=9600+bytesize=8+parity=none+stopbits=1')
|
||||||
|
|
||||||
Mod('TSSOP16', 'frappy_psi.capacitance_readings.TSSOP16.TSSOP16', 'Capacitance-reading Arduino (with TSSOP16)', io='io_capacitance')
|
Mod('TSSOP16', 'frappy_psi.capacitance_readings.TSSOP16.TSSOP16', 'Capacitance-reading Arduino (with TSSOP16)', io='io_capacitance')
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import traceback
|
|||||||
from frappy.core import Readable, Parameter, FloatRange, HasIO, StringIO, Property, IntRange, IDLE, BUSY, WARN, ERROR, Drivable, BoolType, Attached
|
from frappy.core import Readable, Parameter, FloatRange, HasIO, StringIO, Property, IntRange, IDLE, BUSY, WARN, ERROR, Drivable, BoolType, Attached
|
||||||
|
|
||||||
class TSSOP16_IO(StringIO):
|
class TSSOP16_IO(StringIO):
|
||||||
end_of_line = '\r\n'
|
end_of_line = '\r'
|
||||||
wait_before = 3.0
|
wait_before = 3.0
|
||||||
timeout=1
|
timeout=1
|
||||||
identification = [ ('*IDN?', r'0x48,ACM1219,.*') ]
|
identification = [ ('*IDN?', r'0x48,ACM1219,.*') ]
|
||||||
@@ -22,10 +22,9 @@ class TSSOP16(HasIO, Readable):
|
|||||||
l = self.communicate('readCVT')
|
l = self.communicate('readCVT')
|
||||||
vals = l.split(',')
|
vals = l.split(',')
|
||||||
vals = [ float(v) for v in vals ]
|
vals = [ float(v) for v in vals ]
|
||||||
print(vals)
|
|
||||||
return vals[0]
|
return vals[0]
|
||||||
except:
|
except:
|
||||||
return self.custom_read_off_cvt(recursive_layer=recursive_layer+1)
|
print('Retrying: ', recursive_layer+1)
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
self.io.closeConnection()
|
self.io.closeConnection()
|
||||||
self.io.connectStart()
|
self.io.connectStart()
|
||||||
|
|||||||
@@ -21,7 +21,10 @@ class ZVLNode(fc.Readable):
|
|||||||
analyser_ip: the IP address of the network analyser. Best to set in the config!
|
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'))
|
status = fc.Parameter(datatype=frappy.datatypes.StatusType(fc.Readable, "DISABLED", 'PREPARED', 'BUSY'), default=('IDLE', 'idle'))
|
||||||
pollinterval = fc.Parameter(default=1)
|
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)
|
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")
|
@fc.Command(description="Update data")
|
||||||
def acq(self):
|
def acq(self):
|
||||||
self.status = ('BUSY', 'acquiring')
|
self.status = ('BUSY', 'acquiring')
|
||||||
|
#print('acq')
|
||||||
self.NA.set_freq_span(self.central_freq, self.freq_span)
|
self.NA.set_freq_span(self.central_freq, self.freq_span)
|
||||||
freq, vals = self.NA.get_data()
|
freq, vals = self.NA.get_data()
|
||||||
self.value = { 'frequencies': freq, 'magnitudes': vals }
|
self.value = { 'frequencies': freq, 'magnitudes': vals }
|
||||||
self.status = ('IDLE', 'idle')
|
self.status = ('IDLE', 'idle')
|
||||||
|
|
||||||
def write_calibration(self, f):
|
#@fc.Command(description='Save current calibration')
|
||||||
self.calibration = f
|
#def write_calibration(self, f):
|
||||||
self.NA.load_calibration(self.calibration)
|
# self.calibration = f
|
||||||
return self.read_calibration()
|
# 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):
|
def write_central_freq(self, f):
|
||||||
self.central_freq = (f)
|
self.central_freq = (f)
|
||||||
self.acq()
|
self.acq()
|
||||||
|
|||||||
@@ -245,15 +245,15 @@ class ProgrammedSequence(fc.Drivable): # Drivable only for kill() funcitonality
|
|||||||
|
|
||||||
def read_value(self):
|
def read_value(self):
|
||||||
newvals = {}
|
newvals = {}
|
||||||
#try:
|
try:
|
||||||
d = self.tnmr().get_data()
|
d = self.tnmr().get_data()
|
||||||
newvals['reals'] = d[0]
|
newvals['reals'] = d[0]
|
||||||
newvals['imags'] = d[1]
|
newvals['imags'] = d[1]
|
||||||
newvals['t'] = [ self.compiled_parameters['acquisition_time'] * i/len(d[0]) for i in range(0, len(d[0])) ]
|
newvals['t'] = [ self.compiled_parameters['acquisition_time'] * i/len(d[0]) for i in range(0, len(d[0])) ]
|
||||||
#except:
|
except:
|
||||||
# newvals['reals'] = []
|
newvals['reals'] = []
|
||||||
# newvals['imags'] = []
|
newvals['imags'] = []
|
||||||
# newvals['t'] = []
|
newvals['t'] = []
|
||||||
return newvals
|
return newvals
|
||||||
|
|
||||||
def read_num_acqs_actual(self):
|
def read_num_acqs_actual(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user