please consider the following example:
Code: Select all
class BaseClass
{
public BaseClass()
{
//default constructor
}
public void init()
{
setupConnect();
}
protected void setupConnect()
{
dpConnect(this, cbTestMethod, true, "Pump1.State"); //works
dpConnect(this, "cbTestMethod", true, "Pump1.State"); //does not work
}
};
class ExtendedClass : BaseClass
{
public ExtendedClass()
{
//Default constructor
}
public void cbTestMethod(string s, anytype a)
{
DebugTN("callback triggered");
}
};
public void main()
{
ExtendedClass logic;
logic.init();
dpConnect("cbTest", false, "Pump1.State"); //just to prevent the ctrl manager from exiting
}
public void cbTest(string dp, string state)
{
}
Background info:
The connect(s) are intended to be setup in the base class from a string configuration with callback function names (all callback functions follow the same name pattern).
Thanks in advance for your help!