Script execution
This commit is contained in:
@@ -4,15 +4,16 @@ Arguments:
|
||||
"""
|
||||
|
||||
MOTORS = [dummy]
|
||||
VECTOR = [450.0, 451.0]
|
||||
VECTOR = [295.0, 296.0]
|
||||
LATENCY = 0.0
|
||||
|
||||
REGION1 = {'elo': 440.0, 'ehi': 442.0, 'estep': 0.1, 'epass': 100, 'tstep': 0.1, 'iter': 1}
|
||||
REGION2 = {'elo': 441.0, 'ehi': 443.0, 'estep': 0.2, 'epass': 100, 'tstep': 0.1, 'iter': 1}
|
||||
REGION1 = {'elo': 240.0, 'ehi': 242.0, 'estep': 0.1, 'epass': 100, 'tstep': 0.1, 'iter': 1}
|
||||
REGION2 = {'elo': 241.0, 'ehi': 243.0, 'estep': 0.2, 'epass': 100, 'tstep': 0.1, 'iter': 1}
|
||||
REGIONS = [REGION1, REGION2]
|
||||
|
||||
class SpectrumReader(ReadonlyRegisterBase, ReadonlyRegisterArray):
|
||||
def setup(self):
|
||||
print "setup"
|
||||
Scienta.lowEnergy.write(region['elo'])
|
||||
Scienta.highEnergy.write(region['ehi'])
|
||||
Scienta.stepSize.write(region['estep'])
|
||||
@@ -21,23 +22,30 @@ class SpectrumReader(ReadonlyRegisterBase, ReadonlyRegisterArray):
|
||||
Scienta.setIterations(region['iter'])
|
||||
|
||||
def doRead(self):
|
||||
print "doRead " + 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())
|
||||
|
||||
|
||||
class ImageReader(ReadonlyRegisterBase, ReadonlyRegisterMatrix):
|
||||
def doRead(self):
|
||||
print "ImageReader.doRead"
|
||||
return Scienta.getDataMatrix().read()
|
||||
|
||||
def getWidth(self):
|
||||
print "ImageReader.getWidth"
|
||||
return Scienta.getDataMatrix().getWidth()
|
||||
|
||||
def getHeight(self):
|
||||
print "ImageReader.getHeight"
|
||||
return Scienta.getDataMatrix().getHeight()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user