-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
48 lines (33 loc) · 1.19 KB
/
Copy pathmain.py
File metadata and controls
48 lines (33 loc) · 1.19 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
import time
import multiprocessing
from peakCounterV1 import *
from comV1 import *
from flaskServerV1 import *
from rskfinal import *
# from test7 import *
if __name__ == "__main__":
##shared memory variable declarations
#create a int array of size 2
#for peakcount and weight of feed taken in
soundAnalysis = multiprocessing.Array('d', 2)
#create an int array of size 4
#for sending data to arduino
sendData = multiprocessing.Array('i', 5)
#create an int array of size 4
#for receving data from arduino
readData = multiprocessing.Array('i', 4)
#create an float array of size 2
#for receiving distribution index and mobility index
imageAnalysis = multiprocessing.Array('d', 2)
p1 = multiprocessing.Process(target=peakCounter, args=(soundAnalysis, ))
p2 = multiprocessing.Process(target=com, args=(sendData,readData,imageAnalysis, soundAnalysis,))
p3 = multiprocessing.Process(target=flaskServer, args=(soundAnalysis, sendData, readData, imageAnalysis, ))
p4 = multiprocessing.Process(target=rskIndex, args=(imageAnalysis,))
p1.start()
p2.start()
p3.start()
p4.start()
p1.join()
p2.join()
p3.join()
p4.join()