This commit is contained in:
2018-11-23 08:42:01 +01:00
parent c6cd6123b0
commit bf5d1b8d7c
32 changed files with 1961 additions and 20 deletions

27
script/AreaDetectorROI.py Normal file
View File

@@ -0,0 +1,27 @@
device = det
det.imageCounter.polling = 500
class AreaDetectorROI(ReadonlyRegisterBase, ReadonlyRegisterMatrix):
def __init__(self, name, detector, x, y, w, h):
ReadonlyRegisterBase.__init__(self, name)
self.detector = detector
self.x, self.y, self.w, self.h = x, y, w, h
def doRead(self):
data = self.detector.dataMatrix.take()
ret = Convert.matrixRoi(data, self.x, self.y, self.w, self.h)
return ret
def getWidth(self):
return self.w
def getHeight(self):
return self.h
add_device(AreaDetectorROI("roi1", device, 10,10,10,5), True)
add_device(AreaDetectorROI("roi2", device,100,30,7,3), True)
#tscan((roi1, roi2), 10, 0.1)
mscan(device.imageCounter, (roi1, roi2), 10, async=False)