PDA

View Full Version : Photo Screen Saver


Darren
27 Sep 05, 04:15 PM
This post describes how to implement a "screen saver" in the Colour C-Touch to display a series of photos when the unit hasn't been used for a while.

The steps are :
1. Create a series of "photo pages", each with a photo placed on it with a link back to the time-out page. Ideally the photos should be 640 x 480.
2. Add the following logic code
3. Update the logic to :
- use different timer numbers if needed
- change the time-out periods if desired
- add or remove pages as required
- change the name of the "Main Page" if needed


{ constants section }

{ These are the two timers used by the Screen Saver }
ssTimeOutTimer = 1;
ssPageTimer = 2;

{ module }

{ This module implements a "Screen Saver".
A timer is started when the page changes to the main page.
When the timer gets to 1 minute, the "photo" pages
are displayed in sequence. }

{ Main page has been selected.
Start timer. }
once ShowingPage("Main Page") then
begin
TimerStart(ssTimeOutTimer);
TimerStop(ssPageTimer);
end;

{ Main page has been de-selected.
Stop timer. }
once not ShowingPage("Main Page") then
TimerStop(ssTimeOutTimer);

{ Main page timer has expired.
Show first photo page. }
if TimerTime(ssTimeOutTimer) = "00:01:00" then
begin
ShowPage("Photo Page 1");
TimerStart(ssPageTimer);
end;

{ Photo page timer has expired.
Show next photo page. }
if TimerTime(ssPageTimer) = "00:00:10" then
begin
TimerStart(ssPageTimer);
if ShowingPage("Photo Page 1") then
ShowPage("Photo Page 2")
else if ShowingPage("Photo Page 2") then
ShowPage("Photo Page 3")
else if ShowingPage("Photo Page 3") then
ShowPage("Photo Page 4")
else if ShowingPage("Photo Page 4") then
ShowPage("Photo Page 5")
else if ShowingPage("Photo Page 5") then
ShowPage("Photo Page 6")
else if ShowingPage("Photo Page 6") then
ShowPage("Photo Page 1");
end;

mikegriff
28 Sep 05, 05:28 AM
Thanks for this Darren

Works a treat

For info first time you run this you need to switch away from the main page and back again then it fires up Not an issue for normal use but it saves waiting and wondering why it isnt working the first time you load it :)

Mike

jay
07 Oct 05, 01:28 PM
Why don't we just use the normal time out function of the CTC and run the slide show from there ie: Just replace references to the main page to a page called "Timeout" & set the CTC to show that page in "Project Details/Options/Timeout Details"
We then overcome the issue that mikegriff raises & only use one timer in the logic code.

Darren
07 Oct 05, 04:22 PM
Good idea.

muppets
11 Nov 07, 12:02 AM
using the code and further suggestions I have implemented the screen saver however the first screen that loads after an "outage" (simulated by either upload or unplugging) is the first photo page and the sequence doesn't roll on until cancelled by a press and reloading after timeout, my code is as follows:

{ constants section }

{ This is the timer used by the Screen Saver }
ssPageTimer = 2;


{ module }

{ This module implements a "Screen Saver".
A timer is started when the page changes to the timeout
page the "photo" pages are displayed in sequence. }

{ Timeout page has been selected.
Start timer. }
once ShowingPage("Page 20") then

begin
TimerStart(ssPageTimer);
end;

{ Photo page timer has expired.
Show next photo page. }
if TimerTime(ssPageTimer) = "00:00:10" then
begin
TimerStart(ssPageTimer);
if ShowingPage("Page 20") then
ShowPage("Page 21")
else if ShowingPage("Page 21") then
ShowPage("Page 22")
else if ShowingPage("Page 22") then
ShowPage("Page 23")
else if ShowingPage("Page 23") then
ShowPage("Page 24")
else if ShowingPage("Page 24") then
ShowPage("Page 25")
else if ShowingPage("Page 25") then
ShowPage("Page 26")
else if ShowingPage("Page 26") then
ShowPage("Page 20");
end;



Sorry I cant do the flashy scroll box as above, is there any code I can implement at startup to go to the main page? Or at least start the screen saver sequence?

muppets
11 Nov 07, 12:37 PM
Muppets I have an answer to your question lol :rolleyes: - seems everybody else is at the beach on this fine Sunday.

Ok the problem faced with the above code is the once command issued for timer starting - somehow appears to get missed on the bootup.

The fixed code :

{ constants section }

{ This is the timer used by the Screen Saver }
ssPageTimer = 1;


{ module }

{ This module implements a "Screen Saver".
A timer is started when the page changes to the timeout
page the "photo" pages are displayed in sequence. }

{ Timeout page has been selected.
Start timer. "with if instead of once" }
if ShowingPage("Page 20") then

begin
if TimerRunning(ssPageTimer) then

{ Use an empty if timerrunning to make sure the timer doesn't recycle every
scan }

else
TimerStart(ssPageTimer);
end;

{ Photo page timer has expired.
Show next photo page. }
if TimerTime(ssPageTimer) = "00:00:10" then
begin
TimerStart(ssPageTimer);
if ShowingPage("Page 20") then
ShowPage("Page 21")
else if ShowingPage("Page 21") then
ShowPage("Page 22")
else if ShowingPage("Page 22") then
ShowPage("Page 23")
else if ShowingPage("Page 23") then
ShowPage("Page 24")
else if ShowingPage("Page 24") then
ShowPage("Page 25")
else if ShowingPage("Page 25") then
ShowPage("Page 26")
else if ShowingPage("Page 26") then
ShowPage("Page 20");
end;

muppets
13 Nov 07, 10:27 AM
Does the timer need to be stopped if navigating away from the page loop? I haven't found the program not working yet however it seems logical to stop the timer if navigating away from the screen saver pages.

The timer should keep recycling even when not on this page as far as I can tell - is it bad practice to leave it doing this when not required?