forked from ChunelFeng/CGraph
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathT18-Event.py
More file actions
32 lines (23 loc) · 768 Bytes
/
T18-Event.py
File metadata and controls
32 lines (23 loc) · 768 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
"""
@Author: Chunel
@Contact: chunel@foxmail.com
@File: T18-Event
@Time: 2025/3/22 00:21
@Desc:
"""
from PyCGraph import GPipeline
from MyGNode.MyNode1 import MyNode1
from MyGNode.MyEventNode import MyEventNode
from MyGNode.MyWriteParamNode import MyWriteParamNode
from MyGEvent.MyPrintEvent import MyPrintEvent
def tutorial_event():
pipeline = GPipeline()
a, b, c, d = MyWriteParamNode(), MyEventNode(), MyNode1(), MyEventNode()
pipeline.registerGElement(a, set(), "nodeA")
pipeline.registerGElement(b, {a}, "eventNodeB")
pipeline.registerGElement(c, {b}, "nodeC")
pipeline.registerGElement(d, {c}, "eventNodeD")
pipeline.addGEvent(MyPrintEvent(), "event1")
pipeline.process()
if __name__ == '__main__':
tutorial_event()