-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
36 lines (22 loc) · 830 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# import json
import bluesky.plan_stubs as bps
import bluesky.plans as bp
from bluesky import RunEngine
from ConsumeDocuments import ConsumeDocuments
from LaptopCamera import LaptopCamera
lpc = LaptopCamera(name="lpc")
RE = RunEngine()
def take_pictures():
yield from bps.abs_set(lpc.directory, "/home/rose/Documents/projects/camera/webcam")
yield from bps.abs_set(lpc.filename, "test")
yield from bp.count([lpc], num=10, delay=0.1)
# cache = []
# def save_json(name, doc):
# # for each document, saves them to some json
# cache.append({"name": name, "doc": doc})
# if name == "stop":
# with open("output.json", "w") as file:
# json.dump(cache, file, indent=4)
# RE(take_pictures(), save_json)
picture_interface = ConsumeDocuments()
RE(take_pictures(), picture_interface)