forked from ChunelFeng/CGraph
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathT05-Param.py
More file actions
37 lines (27 loc) · 1022 Bytes
/
T05-Param.py
File metadata and controls
37 lines (27 loc) · 1022 Bytes
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
"""
@Author: Chunel
@Contact: chunel@foxmail.com
@File: T05-Param
@Time: 2025/2/27 23:41
@Desc:
"""
from PyCGraph import GNode, GPipeline
from MyGNode.MyWriteParamNode import MyWriteParamNode
from MyGNode.MyReadParamNode import MyReadParamNode
def tutorial_param():
pipeline = GPipeline()
a, b, e = MyReadParamNode(), MyReadParamNode(), MyReadParamNode()
c, d, f = MyWriteParamNode(), MyWriteParamNode(), MyWriteParamNode()
pipeline.registerGElement(a, set(), "readNodeA")
pipeline.registerGElement(b, {a}, "readNodeB")
pipeline.registerGElement(c, {a}, "writeNodeC")
pipeline.registerGElement(d, {a}, "writeNodeD", 2)
pipeline.registerGElement(e, {a}, "readNodeE")
pipeline.registerGElement(f, {b, c, d, e}, "writeNodeF")
pipeline.init()
for i in range(0, 3):
status = pipeline.run()
print('---- tutorial_param, loop : {0}, and run status = {1}'.format(i + 1, status.getCode()))
pipeline.destroy()
if __name__ == '__main__':
tutorial_param()