Script execution
This commit is contained in:
@@ -3,7 +3,7 @@ Arguments:
|
||||
|
||||
"""
|
||||
|
||||
MOTORS = [Eph]
|
||||
MOTORS = [dummy]
|
||||
VECTOR = [295.0, 296.0]
|
||||
LATENCY = 0.0
|
||||
|
||||
@@ -11,37 +11,29 @@ REGION1 = {'elo': 240.0, 'ehi': 242.0, 'estep': 0.1, 'epass': 100, 'tstep': 0.1,
|
||||
REGION2 = {'elo': 241.0, 'ehi': 243.0, 'estep': 0.2, 'epass': 100, 'tstep': 0.1, 'iter': 1}
|
||||
REGIONS = [REGION1, REGION2]
|
||||
|
||||
#Scienta.lowEnergy.write(REGION1['elo'])
|
||||
#Scienta.highEnergy.write(REGION1['ehi'])
|
||||
#Scienta.stepSize.write(REGION1['estep'])
|
||||
#Scienta.setPassEnergy(REGION1['epass'])
|
||||
#Scienta.stepTime.write(REGION1['tstep'])
|
||||
#Scienta.setIterations(REGION1['iter'])
|
||||
|
||||
class SpectrumReader(ReadonlyRegisterBase, ReadonlyRegisterArray):
|
||||
def setup(self):
|
||||
print "enter SpectrumReader.setup"
|
||||
Scienta.lowEnergy.write(self.region['elo'])
|
||||
Scienta.highEnergy.write(self.region['ehi'])
|
||||
Scienta.stepSize.write(self.region['estep'])
|
||||
Scienta.setPassEnergy(self.region['epass'])
|
||||
Scienta.stepTime.write(self.region['tstep'])
|
||||
Scienta.setIterations(self.region['iter'])
|
||||
print "exit SpectrumReader.setup"
|
||||
|
||||
def read(self):
|
||||
print "enter SpectrumReader.read"
|
||||
print str(self.region)
|
||||
self.setup()
|
||||
print "trig_scienta"
|
||||
trig_scienta()
|
||||
time.sleep(0.5)
|
||||
print "getSpectrum"
|
||||
return Scienta.getSpectrum().read()
|
||||
|
||||
def getSize(self):
|
||||
print "getSize"
|
||||
return len(Scienta.getSpectrumX())
|
||||
print "SpectrumReader.getSize"
|
||||
n1 = Scienta.numChannels.read()
|
||||
n2 = len(Scienta.getSpectrumX())
|
||||
print n1, n2
|
||||
return n1
|
||||
|
||||
|
||||
class ImageReader(ReadonlyRegisterBase, ReadonlyRegisterMatrix):
|
||||
@@ -52,11 +44,15 @@ class ImageReader(ReadonlyRegisterBase, ReadonlyRegisterMatrix):
|
||||
|
||||
def getWidth(self):
|
||||
print "ImageReader.getWidth"
|
||||
return Scienta.getDataMatrix().getWidth()
|
||||
n2 = Scienta.getDataMatrix().getWidth()
|
||||
print n2
|
||||
return n2
|
||||
|
||||
def getHeight(self):
|
||||
print "ImageReader.getHeight"
|
||||
return Scienta.getDataMatrix().getHeight()
|
||||
n2 = Scienta.getDataMatrix().getHeight()
|
||||
print n2
|
||||
return n2
|
||||
|
||||
|
||||
index = 0
|
||||
@@ -64,6 +60,7 @@ reader1 = SpectrumReader()
|
||||
reader1.initialize()
|
||||
reader1.index = index
|
||||
reader1.region = REGIONS[index]
|
||||
set_device_alias(reader1, "ScientaSpectrum1")
|
||||
|
||||
image1 = ImageReader()
|
||||
image1.initialize()
|
||||
@@ -76,6 +73,7 @@ reader2 = SpectrumReader()
|
||||
reader2.initialize()
|
||||
reader2.index = index
|
||||
reader2.region = REGIONS[index]
|
||||
set_device_alias(reader2, "ScientaSpectrum2")
|
||||
|
||||
image2 = ImageReader()
|
||||
image2.initialize()
|
||||
|
||||
Reference in New Issue
Block a user