I would like for the scriptThread.globalUnsignedChangedSignal.connect(functionName) signal to be called only when a specific global variable is changed in the global variable space rather than when any unsigned global variable is changed. Is this possible?
Example below of what I'm attempting. Both functions are called in this case when value1 or value2 is changed.
function value1Changed()
{
print('value 1 changed');
}
function value2Changed()
{
print('value 2 changed');
}
no this is not possible (ScriptCommunicator use the standard QT signal/slot mechanism). But you can check for the name of the variable in your slot function:
I would like for the scriptThread.globalUnsignedChangedSignal.connect(functionName) signal to be called only when a specific global variable is changed in the global variable space rather than when any unsigned global variable is changed. Is this possible?
Example below of what I'm attempting. Both functions are called in this case when value1 or value2 is changed.
function value1Changed()
{
print('value 1 changed');
}
function value2Changed()
{
print('value 2 changed');
}
scriptThread.globalUnsignedChangedSignal.connect(value1Changed);
scriptThread.globalUnsignedChangedSignal.connect(value2Changed);
scriptThread.setGlobalUnsignedNumber("value1", 1);
scriptThread.setGlobalUnsignedNumber("value2", 1);
Hi,
no this is not possible (ScriptCommunicator use the standard QT signal/slot mechanism). But you can check for the name of the variable in your slot function:
Last edit: Stefan Zieker 2019-06-06