Vision client timer script with parameters passing between windows

Hi all, first post, as I can't find exactly what I'm looking for in the forums. The goal here is wanting essentially a 'screen saver' window popup after about 3 minutes of inactivity on my HMI screens. These are industrial dryers, and it was requested that a screensaver popup with the dryer number and dryer fill percentage, until an operator touches the screen. These screens start up with options for 3 dryer numbers, indicating what dryer is being operated, then that is passed into the 'main' screen as a root container property.

The screensaver window itself was made as a 'main' screen, as that should automatically be full screen, and no borders, but if that is my problem, I can alter it.

I initially set up a client timer script, and tried to grab the property by calling on the getWindow, to then grab the component 'dryerno', which is an int, as a property of the 'main' screen.

window = system.gui.getWindow('Main')
dryernumber = window.getRootContainer().getComponent('dryerno')

if system.util.getInactivitySeconds()>180 and system.nav.getCurrentWindow()!='Screensaver':
	system.nav.swapTo('Screensaver', {'dryerno' : dryernumber})

Under the logs, it sees that "main" is not currently open when I push this into production, but I assume the reason for that is that it already sees inactivity has met or exceeded my 'if' statement, but this was a means to get the screen to popup, and I would just normally put a 'try' and 'catch' around my variables. The window does popup, but it will not pass the property value, and interacting with the screen does not close the window. I wasn't sure if the window would close on its own because the criteria of my 'if' statement will have not been met if there was activity, or if I needed another method by which to automatically close the window.

I have also tried adding a '.value' on the dryer number assignment, and it didn't work.

So main questions are:
Am I going about this the right way using a client timer script?
What is the best way to pass the dryer number property if this is the way?
Do I need to make another statement to close my 'screen saver' with activity?

When you swap windows, the prior window is closed as the new one is opened, so you are losing access to its contents. If you search for JFrame here, you should find some alternatives that will cover the screen without actually swapping.

I will search that up. Thank you very much!

It would probably be simpler to overlay the entire window with a container component. You could put the dryer number and anything else you need into the container, and control the container's visibility with a timer script or with a with a timer component placed somewhere in the window.

Similar vein, but in Vision I used to add a semi-transparent black rectangle at the highest z order which had a click action that did nothing in it. When I wanted a modal popup, I used a client tag as it's visibility. The click action would also turn the client tag off if background dismiss was needed. I would much prefer something like that over adding the same screensaver container to each page. But if you can do this through Java it would be even better, more complex though for the average Joe

Thanks for this reply, by the way. As I ended up using a container with a timer script for it, as it wasn't going to be using many resources to maintain, even in the background. So I ended up using this for now. Thanks!