OnlyWhenFocused

This is a member function of the HMIPanel class.

This function sets up the ARDI API so that it disconnects when you change tabs or the active tab otherwise loses focus.

This can prevent performance issues that can occur if you leave a page using the Javascript AI in the background for a long time.