Hello,
I try to use the “classical” scheme of the subsrciption using, which works with any other type of subscriptions e.g. subscription on the signal, rapiddata, programPointer or any controller state changing. But it doesn’t work with executionStatus. Please take a look at the following code:
public void SubscribeOnExecute()
{
getRapid().ExecutionStatusChanged += executionStatusChanged;
}
private void executionStatusChanged(object sender, ExecutionStatusChangedEventArgs e)
{
GTPUMessageBox.Show(this, null, “Status=” + e.NewStatus);
executionStatusChangeUI(e.NewStatus.Equals(ExecutionState.Started));
}
private void executionStatusChangeUI(bool isRunning)
{
// InvokeRequired required compares the thread ID of the
// calling thread to the thread ID of the creating thread.
// If these threads are different, it returns true.
if (this.InvokeRequired)
{
var rc = new executionStatusChangedCallback(executionStatusChangeUI);
this.Invoke(rc, new object { isRunning });
}else
{
if (isRunning)
{
disableUI();
}
else
{
enableUI();
}
}
}
…
getRapid() returns m_Controller.Rapid.
Unfortunetally it doesn’t work. Is someone has the succesfull experience with the executionStatusChanged subscription ?
Thank you,
Anton