on the fly
This commit is contained in:
@@ -1,17 +1,19 @@
|
||||
import serial
|
||||
import time
|
||||
import traceback
|
||||
|
||||
from frappy.core import Readable, Parameter, FloatRange, HasIO, StringIO, Property, IntRange, IDLE, BUSY, WARN, ERROR, Drivable, BoolType, Attached
|
||||
|
||||
class TSSOP16_IO(StringIO):
|
||||
end_of_line = '\r'
|
||||
wait_before = 3.0
|
||||
wait_before = 0.0 #3.0
|
||||
identification = [ ('*IDN?', r'0x48,ACM1219,.*') ]
|
||||
|
||||
class TSSOP16(HasIO, Readable):
|
||||
'''only configured for channel 1'''
|
||||
|
||||
ioClass = TSSOP16_IO
|
||||
value = Parameter('capacitance', FloatRange(unit='pF'), readonly=True)
|
||||
value = Parameter('value', FloatRange(unit='pF'), readonly=True)
|
||||
pollinterval = Parameter(default=0.1)
|
||||
|
||||
def read_value(self):
|
||||
@@ -19,8 +21,10 @@ class TSSOP16(HasIO, Readable):
|
||||
l = self.communicate('readCVT')
|
||||
vals = l.split(',')
|
||||
vals = [ float(v) for v in vals ]
|
||||
#print(vals)
|
||||
return vals[0]
|
||||
except:
|
||||
traceback.print_exc()
|
||||
self.io.closeConnection()
|
||||
self.io.connectStart()
|
||||
time.sleep(3.0)
|
||||
|
||||
Reference in New Issue
Block a user