I have a need for a demo screen mounted on a wall that needs to show a slide show of random or predesigned selections of a projects windows. What is the best way to accomplish this. Also a non logged in viewer may need to be able to use the screens.
Darrel,
There are a couple was to do this, but it sounds like your best bet is to have a link somewhere in your project to close all windows and open one small window with a timer and start/stop buttons. Set the buttons to toggle the “running” property on the timer. Then set the timer maximum to the number of windows you will be cycling through, and the delay to however long you want to pause at each screen. In the timer event configuration under propertyChange, put the following:
[code]#list of windows to cycle through
windows = [“Window 1”, “Window 2”, “Window 3”]
if event.propertyName == “value”:
i = event.source.value
#close the previous window
if event.source.value == 0:
fpmi.gui.closeWindow(windows[len(windows)-1])
else:
fpmi.gui.closeWindow(windows[i-1])
#open the next window
fpmi.gui.openWindow(windows[i])[/code]
You can also add items to the runtime menu to start and stop it for you. Something like
#open the window if it isnt open
fpmi.gui.openWindow("SlideShowControl")
#reset the value so you start at window1
fpmi.gui.getWindow("SlideShowControl").getRootContainer().getComponent('Timer').value=0
#start it running
fpmi.gui.getWindow("SlideShowControl").getRootContainer().getComponent('Timer').running=1
Hope that helps!
Darrel, here is another way of doing it with a global timer script. In this way, it is totally automatic - the timer script senses if a user is active using the fpmi.system.getInactivitySeconds() function. Just put the list of window names you want to swap between in the windows variable. (Note - you need FactoryPMI 3.0 to use this script because of the use of the fpmi.nav module)
Put this script in a global timer script that runs every 15,000 milliseconds. It won’t run the slideshow if the user has been active in the last 10 seconds. You can play with the timing to get the effect you want.
[code]windows = [‘Window 10’, ‘Window 11’, ‘Window 12’, ‘Window 13’]
seconds = fpmi.system.getInactivitySeconds()
if seconds > 10:
global position
try:
position = (position + 1) % len(windows)
except NameError:
# This will initialize it the first time
position=1
fpmi.nav.swapTo(windows[position])[/code]
I used the example shown above to change display. However, the swapwindow() method did not work. It did not clear the old windows from the display. The new windows showed up to the right of old window. I had three windows in my project. After two timer intervals, all three windows were showing on the screen. So, I ended up using the function calls closewindow/openwindow. Is there any window property that needs to be set to make the swapwindow() method work.
Look at the help file for the swapTo method.