19 lines
861 B
Python
19 lines
861 B
Python
def save_camera(name, shared = True, images = 1, interval = -1, roi=None, snapshot = False):
|
|
import requests
|
|
import urllib
|
|
roi = "" if roi == None else urllib.quote_plus(str(roi).replace(" ", ""))
|
|
base = "http://sf-daq-mgmt:8090/"
|
|
url = base + "run/Tools/save_camera_data(%s,%s,%s,%s,'%s',%s)&" % (name, str(shared), str(images), str(interval), roi, str(snapshot))
|
|
r = requests.get(url)
|
|
if r.status_code != 200:
|
|
raise Exception(r.text)
|
|
return r.text
|
|
|
|
#start = time.time()
|
|
#print save_camera("SARBD02-DSCR050")
|
|
#print save_camera("SARBD02-DSCR050", False)
|
|
#print save_camera("SARBD02-DSCR050", True)
|
|
#print save_camera("simulation_sp", False, 10, roi=[500, 300, 400, 150], snapshot = True)
|
|
#print save_camera("simulation_sp", False, 10, roi=[300, 200])
|
|
|
|
#print time.time()-start |