From 8a38c8ef21ba600e951c59f04fcd322d86046a20 Mon Sep 17 00:00:00 2001 From: Alexandre Gobbo Date: Wed, 20 May 2020 14:05:12 +0200 Subject: [PATCH] Script execution --- script/test/psss.py | 60 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 script/test/psss.py diff --git a/script/test/psss.py b/script/test/psss.py new file mode 100644 index 0000000..73ba5cb --- /dev/null +++ b/script/test/psss.py @@ -0,0 +1,60 @@ +class AnalogOutput(RegisterBase): + def __init__(self): + self.val = 0 + + def doRead(self): + return self.val + + def doWrite(self, val): + self.val = val + +class Waveform(RegisterBase, RegisterArray): + def __init__(self): + self.val = [0.0] + + def doRead(self): + return self.val + + def doWrite(self, val): + self.val = val + + def getSize(self): + return len(self.take(-1)) #only reads if cache is None + + +add_device(SinusoidSample("ai1"), True) +add_device(SinusoidWaveform("wf1"), True) + + + +camera = "SLG-LCAM-C102" + + +""" +import ch.psi.pshell.epics.CAS as CAS + +cas = [] + +#CAS.setServerPort(5062) + +CAS.setServerPort(12345) + + + +cas1 = CAS(camera + ":SPECTRUM_Y", ai1, 'double') +cas6 = CAS(camera + ":SPECTRUM_X", wf1, 'double') +cas2 = CAS( camera + ":SPECTRUM_CENTER", ai1, 'double') +cas3 = CAS(camera + ":SPECTRUM_FWHM", ao1, 'double') +cas4 = CAS(camera + ":SPC_ROI_YMIN", dp1, 'double') +cas5 = CAS(camera + ":SPC_ROI_YMAX", wf1, 'double') + + +print caget("TESTCAS:c1") +print caget("TESTCAS:c2") +print caget("TESTCAS:c3") +print caget("TESTCAS:c4") +print caget("TESTCAS:c5") +print caget("TESTCAS:c6").tolist() +print caget("TESTCAS:c7").tolist() +print caget("TESTCAS:c8","[s").tolist() +""" \ No newline at end of file