Closedown
This commit is contained in:
@@ -26,8 +26,25 @@ class CamToolImage(ReadableMatrix):
|
||||
|
||||
|
||||
class CamTool(DeviceBase):
|
||||
def __init__(self, name, prefix = "cam:", latch = False):
|
||||
def __init__(self, name, prefix = "cam:", latch = False, camera = "~/Simulation.json"):
|
||||
DeviceBase.__init__(self, name)
|
||||
run_channel = prefix + "camera.run"
|
||||
try:
|
||||
caget(run_channel)
|
||||
except:
|
||||
cmd = "camtool --casprefix " + prefix + " " + camera #--nogui --run -1
|
||||
fork( (exec_cmd,(cmd,)),)
|
||||
start = time.time()
|
||||
while(True):
|
||||
try:
|
||||
caget(run_channel)
|
||||
time.sleep(5.0)
|
||||
break
|
||||
except:
|
||||
if time.time() - start > 20.0:
|
||||
raise Exception("Camtool application not started")
|
||||
time.sleep(0.5)
|
||||
|
||||
self.prefix = prefix
|
||||
self.latch = latch
|
||||
self.mode = "latch" if latch else "pipeline"
|
||||
@@ -152,9 +169,9 @@ class CamTool(DeviceBase):
|
||||
|
||||
if __name__ == "__builtin__":
|
||||
camera_tool = CamTool("camtool")
|
||||
print camera_tool.com_x_mean.read()
|
||||
#print camera_tool.com_x_mean.read()
|
||||
camera_tool.enableBackground(False)
|
||||
camera_tool.enableBackground(False)
|
||||
camera_tool.enableBackground(True)
|
||||
camera_tool.captureBackground(5)
|
||||
for i in range (100):
|
||||
camera_tool.capture()
|
||||
|
||||
Reference in New Issue
Block a user