Only open one popup with same parameter

I am using a popup that shares across a variety number of pumps, so I created a multiple instances of popup.

However, I want to avoid a single pump to popup multiple popups, which means I only want one popup for each pump. Is it possible to do this?

You can achieve that with scripting.

Below is the code we use for motor popups (found somewhere on the forums, I don’t remember who to credit for it), it gets all open popups, and checks if it’s for the same motor.

faceplate = 'path/to/popup'

windows = system.gui.getOpenedWindows()
param = self.parent.ST_Motor
found = 0

for win in windows:
	if ((win.path == faceplate ) and (win.rootContainer.ST_Motor.Internal.Info == param.Internal.Info)):
		found = 1
		win.setSelected(1)
		break
	
if not found:
	newPopup = system.nav.openWindowInstance(faceplate , {'ST_Motor' : param})
	system.nav.centerWindow(newPopup)
2 Likes