mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-01-22 04:27:40 +01:00
added python examples in source
This commit is contained in:
21
python/examples/non-blocking-acquire-process.py
Normal file
21
python/examples/non-blocking-acquire-process.py
Normal file
@@ -0,0 +1,21 @@
|
||||
import time
|
||||
from multiprocessing import Process
|
||||
from slsdet import Detector, runStatus
|
||||
|
||||
|
||||
d = Detector()
|
||||
|
||||
#Create a separate process to run acquire in
|
||||
p = Process(target=d.acquire)
|
||||
|
||||
#Start the thread and short sleep to allow the acq to start
|
||||
p.start()
|
||||
time.sleep(0.01)
|
||||
|
||||
#Do some other work
|
||||
while d.status != runStatus.IDLE:
|
||||
print("Working")
|
||||
time.sleep(0.1)
|
||||
|
||||
#Join the process
|
||||
p.join()
|
||||
Reference in New Issue
Block a user