Call a parent object's functions from a child?
photomankc
Posts: 943
I have not been able to find out how to do this, if you can. I have an object MainProg and spawns a child in a new cog named UserInterface. While UserInterface is running I need it to call a method from MainProg. I can't seem to find a way to do that.
if I add the declaration:
I get an error saying that I have an illegal circular reference. I can't find any other keyword that would seem to fit this and I'm stumped. If I missed it in the manual I'm sorry but I am not seeing it. Would seem kind of odd though if you can only communicate downstream.
Post Edited (photomankc) : 8/11/2009 5:37:37 AM GMT
if I add the declaration:
OBJ parent: "MainProg" . . . . PRI SomeFunc parent.GetValue(valueAdr)
I get an error saying that I have an illegal circular reference. I can't find any other keyword that would seem to fit this and I'm stumped. If I missed it in the manual I'm sorry but I am not seeing it. Would seem kind of odd though if you can only communicate downstream.
Post Edited (photomankc) : 8/11/2009 5:37:37 AM GMT
Comments
Have the user interface run first as your "main" program.
Have it start your worker object.
It can then call methods of the worker to get/set stuff as required by user input.
Basically the model used by most (all) drivers.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
I want to allow the user to switch to 'disposable' mode and set the cut-off voltage lower for the monitor loop but to do that it needs to communicate back and forth about what the current setting is and let it know to alter it with the new setting. The UI needs to know what the new setting is so it can display the proper notification to the user.
Post Edited (photomankc) : 8/11/2009 1:52:12 PM GMT