Looking to do a screen refresh every 10 minutes on a vision screen. Any suggestions on how to accomplish this via script?
Refresh what exactly? Component properties bound to tags should update on their own. Component properties set to SQL bindings/Named Queries can be set to polling or manually refreshed with a
system.db.refresh. What is not refreshing on your window currently?
I just want the entire vision screen to refresh. I have a couple cameras that will time out and if I refresh, they come back.
Ah ok. I don't know much about the video component. When you refresh you mean you exit the window and come back or do you just move the mouse?
I think you can leverage system.util.getInactivitySeconds inside a client timer script that runs once a minute, and if inactivity is greater than 10 minutes, either programmatically move a mouse or close and re-open the window
There are probably better ways to refresh that component directly someone else where probably knows.
Correct, exit the screen. So really just looking how to make a script to close screen and reopen every 10-15 minutes actually.
You probably want to reload the IP Camera Viewer URL when the stream stops. I show a hacky method to do this in my Image Streamer module's documentation.
Cool. I am using VLC to convert, and it works great just looking to refresh every so often.
I took a look at your documentation. Where is that at? On the screen now I show SocketException: ConnectionReset. I did try to refresh the cameras and that did not make them show up on the screen. I physically had to close the window and reopen. So really looking to run a script that just does either a window refresh or close and reopen every so often.
At the bottom of the linked documentation, in the usage notes, there is a link to my
ipcamera.py script that, with help from my Simulation Aids module, can restart the IP Camera Viewer component.
That script has comments describing how to use it. If you don't want to use Simulation Aids, the techniques shown in that script could be reworked into a timer component or a regularly-occurring property change event.
Cool. Thanks for the information. I just refreshed the url and it didn't work but closing the screen and opening back up did so I think I will have to figure out a script to just do a window refresh.
Not necessary if you use the script function with
objectScript() as shown in its comments.
Thanks but just a little lost on where to do this.
The script has:
# Use as a binding expression (on a boolean property) in the IP Camera Viewer like so: # objectScript("shared.ipcamera.stateCheck(binding.target)", now(1000))
Paste the whole script into a project library script module. I recommend calling it
ipcamera, but that's up to you.
Attach an expression binding to one of the boolean config properties of the IP Camera Viewer component. (Pick one that you want to be turned on as a side effect.) Paste that
objectScript(...) expression into that binding. Adjust
shared.ipcamera to the actual library script name you used.
Thanks, will try that. Still feel lost on what and where to do but appreciate all of your help.
Tried and it still comes up SocketException. Any other ideas/suggestions?
Use my module instead of VLC, perhaps. Maybe add various delays into the restart logic.