Script execution
This commit is contained in:
+13
-3
@@ -24,7 +24,6 @@ class CamToolImage(ReadableMatrix):
|
||||
return self._height
|
||||
|
||||
|
||||
|
||||
class CamTool(DeviceBase):
|
||||
def __init__(self, name, prefix = "cam:", latch = False):
|
||||
DeviceBase.__init__(self, name)
|
||||
@@ -47,10 +46,17 @@ class CamTool(DeviceBase):
|
||||
self.bg_en = Channel(self.prefix + "bg.enabled", type = 'l', alias = name + " bg en")
|
||||
self.bg_capture = Channel(self.prefix + "bg.capture", type = 'l', alias = name + " bg capture")
|
||||
self.bg_capture_remain = Channel(self.prefix + "bg.capture_remain", alias = name + " capture remain")
|
||||
|
||||
self.num_images = 1
|
||||
self.image = CamToolImage(self)
|
||||
set_device_alias(self.image, name + " image")
|
||||
|
||||
self.com_x = [1.0,2.0, 3.0]
|
||||
class CamToolComX(Readable):
|
||||
def read(self):
|
||||
return mean(self.com_x)
|
||||
self.com_x_mean = CamToolComX()
|
||||
set_device_alias(self.com_x_mean, name + " com x mean")
|
||||
|
||||
def doInitialize(self):
|
||||
if self.latch:
|
||||
self.start()
|
||||
@@ -77,7 +83,11 @@ class CamTool(DeviceBase):
|
||||
time.sleep(0.001)
|
||||
|
||||
def doUpdate(self):
|
||||
self.capture()
|
||||
for i in range(self.num_images):
|
||||
self.capture()
|
||||
|
||||
def setNumberOfImages(self, value):
|
||||
self.num_images = value
|
||||
|
||||
def enableBackground(self, value):
|
||||
self.bg_en.write(1 if value else 0)
|
||||
|
||||
Reference in New Issue
Block a user