upgrade upltrasound to newer version of frappy

This commit is contained in:
Ultrasound PC
2022-05-23 15:25:41 -04:00
parent 7fc030191d
commit 319f3b4649
2 changed files with 41 additions and 32 deletions

View File

@ -20,43 +20,43 @@
# *****************************************************************************
"""Delay generator stanford 645"""
from secop.core import FloatRange, HasIodev, Module, Parameter, StringIO
from secop.core import FloatRange, HasIO, Module, Parameter, StringIO
class DG645(StringIO):
end_of_line = '\n'
class Delay(HasIodev, Module):
class Delay(HasIO, Module):
on1 = Parameter('on delay 1', FloatRange(unit='sec'), readonly=False, default=0)
off1 = Parameter('off delay 1', FloatRange(unit='sec'), readonly=False, default=60e-9)
on2 = Parameter('on delay 2', FloatRange(unit='sec'), readonly=False, default=0)
off2 = Parameter('off delay 2', FloatRange(unit='sec'), readonly=False, default=150e-9)
iodevClass = DG645
ioClass = DG645
def read_on1(self):
return self.sendRecv('DLAY?2').split(',')[1]
return float(self.communicate('DLAY?2').split(',')[1])
def read_off1(self):
return self.sendRecv('DLAY?3').split(',')[1]
return float(self.communicate('DLAY?3').split(',')[1])
def read_on2(self):
return self.sendRecv('DLAY?4').split(',')[1]
return float(self.communicate('DLAY?4').split(',')[1])
def read_off2(self):
return self.sendRecv('DLAY?5').split(',')[1]
return float(self.communicate('DLAY?5').split(',')[1])
def write_on1(self, value):
return self.sendRecv('DLAY 2,0,%g;DLAY?2' % value).split(',')[1]
return float(self.communicate('DLAY 2,0,%g;DLAY?2' % value).split(',')[1])
def write_off1(self, value):
result = self.sendRecv('DLAY 3,0,%g;DLAY?3' % value)
return result.split(',')[1]
result = self.communicate('DLAY 3,0,%g;DLAY?3' % value)
return float(result.split(',')[1])
def write_on2(self, value):
return self.sendRecv('DLAY 4,0,%g;DLAY?4' % value).split(',')[1]
return float(self.communicate('DLAY 4,0,%g;DLAY?4' % value).split(',')[1])
def write_off2(self, value):
return self.sendRecv('DLAY 5,0,%g;DLAY?5' % value).split(',')[1]
return float(self.communicate('DLAY 5,0,%g;DLAY?5' % value).split(',')[1])