Good morning, I hope everyone is well. I have a new question regarding pop ups and message handlers...I know I've asked more than a few recently haha. I've created a one line diagram for an electric distribution substation, and this one line has multiple relays on it. The relays all function similarly, and there are some controls aspects to the relays. The way it works is when the relay is clicked on a popup opens with live values and control points. When a state needs to be changed the operator clicks on the control point and a pop up opens and they have the option to toggle a boolean value, and this works well. The problem that I discovered is that if I have multiple relay popups open, the boolean state change propagates over every pop up that is open. So its obvious that I need to pass some sort of parameter that has the component name in it, and have it so that the message handler coming back from the popup is targeted to only that component. I'm just not sure how to do that. I've tried chat gpt and I can't seem to get it working just right.
Here is the script the component has for calling the popup:
def runAction(self, event):
path = "confirmpopup52A"
system.perspective.openPopup("confirmSelected", path,)
Here is the message handler on the component:
def onMessageReceived(self, payload):
if payload['confirm']:
self.custom.confirmedSelected = True
else:
self.custom.confirmedSelected = False
And here is the script on the pushbutton inside the popup:
messageType = 'toggleManual52A'
system.perspective.sendMessage(messageType,{'confirm': True}, scope = 'page')
I appreciate everyone's help and time with walking me through this.