MCPcopy Create free account
hub / github.com/ChunelFeng/CGraph / MyWriteParamNode

Class MyWriteParamNode

python/tutorial/MyGNode/MyWriteParamNode.py:13–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11from MyParams.MyParam import MyParam
12
13class MyWriteParamNode(GNode):
14 def init(self):
15 return self.createGParam(MyParam(), "param1")
16
17 def run(self):
18 param: MyParam = self.getGParam("param1")
19 with param:
20 # user `with param` to enter thread safe area for param's info change
21 # as same as param.lock() and param.unlock()
22 param.count += 1
23 param.value += 1
24 print('[{0}] value is {1}, count is {2}'.format(self.getName(), param.value, param.count))
25 return CStatus()

Callers 7

tutorial_paramFunction · 0.90
tutorial_mutableFunction · 0.90
tutorial_conditionFunction · 0.90
tutorial_eventFunction · 0.90
tutorial_functionFunction · 0.90
tutorial_daemonFunction · 0.90
tutorial_multi_conditionFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected