Script execution
This commit is contained in:
@@ -5,7 +5,6 @@ import ch.psi.utils.Convert.toBidimensional as mono_to_bidi
|
||||
import ch.psi.utils.Convert.toDouble as toDouble
|
||||
import org.apache.commons.math3.linear.Array2DRowRealMatrix as Matrix
|
||||
|
||||
|
||||
class CamToolImage(ReadableMatrix):
|
||||
def __init__(self, camtool):
|
||||
self.camtool = camtool
|
||||
@@ -26,7 +25,7 @@ class CamToolImage(ReadableMatrix):
|
||||
|
||||
|
||||
class CamTool(DeviceBase):
|
||||
def __init__(self, name, prefix = "cam:", latch = False, camera = "SINEG01-DSCR190"):
|
||||
def __init__(self, name, prefix = "cam:", latch = False, camera = "SINEG01-DSCR190", egu = True):
|
||||
DeviceBase.__init__(self, name)
|
||||
run_channel = prefix + "camera.run"
|
||||
|
||||
@@ -41,6 +40,7 @@ class CamTool(DeviceBase):
|
||||
# time.sleep(5.0)
|
||||
self.prefix = prefix
|
||||
self.latch = latch
|
||||
self.egu = egu
|
||||
self.mode = "latch" if latch else "pipeline"
|
||||
self.data_prefix = prefix + self.mode + "."
|
||||
self.cam_run = Channel(prefix + "camera.run", alias = name + " run")
|
||||
@@ -58,8 +58,12 @@ class CamTool(DeviceBase):
|
||||
self.stop()
|
||||
self.timestamp = Channel(self.data_prefix + "timestamp",type = 'd', alias = name + " timestamp") #[D1, D2, ...]
|
||||
#self.timestamp.set_monitored(True)
|
||||
self.com_x = Channel(self.data_prefix + "x_stats.com", alias = name + " com x")
|
||||
self.com_y = Channel(self.data_prefix + "y_stats.com", alias = name + " com y")
|
||||
if egu:
|
||||
self.com_x = Channel(self.data_prefix + "x_stats.com_egu", alias = name + " com_egu x")
|
||||
self.com_y = Channel(self.data_prefix + "y_stats.com_egu", alias = name + " com_egu y")
|
||||
else:
|
||||
self.com_x = Channel(self.data_prefix + "x_stats.com", alias = name + " com x")
|
||||
self.com_y = Channel(self.data_prefix + "y_stats.com", alias = name + " com y")
|
||||
self.profile_x = Channel(self.data_prefix + "profile.x", alias = name + " profile x")
|
||||
self.profile_y = Channel(self.data_prefix + "profile.y", alias = name + " profile y")
|
||||
self.data = Channel(self.data_prefix + "image", alias = name + " data")
|
||||
@@ -194,7 +198,7 @@ class CamTool(DeviceBase):
|
||||
self.bg_capture_remain.close()
|
||||
#self.image.close()
|
||||
|
||||
"""
|
||||
|
||||
if __name__ == "__builtin__":
|
||||
camera_tool = CamTool("camtool", prefix = "SINEG01-DSCR190:", latch = True, camera = "SINEG01-DSCR190")
|
||||
add_device(camera_tool, True)
|
||||
@@ -210,4 +214,3 @@ if __name__ == "__builtin__":
|
||||
#camera_tool.enableBackground(True)
|
||||
#camera_tool.capture()
|
||||
#print camera_tool.take(), camera_tool.com_x.read(), camera_tool.com_y.read()
|
||||
"""
|
||||
Reference in New Issue
Block a user