Sean Meighan

Welcome => Do You Need Help? Post it here => Topic started by: gerry on August 12, 2015, 03:37:40 AM

Title: Text effect - Count Down formats
Post by: gerry on August 12, 2015, 03:37:40 AM
Hello,

I am trying to add a text effect with the Count Down attribute set to one of the following options below.

How exactly do I specify the text string ?

I am aware that this will count down from the date/time that the sequence was created (not when the seq runs) ; notwithstanding  I have been unable to enter a valid format in the text field - the text displays 'invalid date'

to date ‘d h m s’
to date ‘h:m:s’
to date ‘m’ or ‘s’
to date  ‘s’
!to date !%tofmt
 
Title: Re: Text effect - Count Down formats
Post by: RGBNoob on August 12, 2015, 09:52:33 AM
I've been wondering about this as well.  If I could add another question, is there a way to have it just count down to a specific time of the day without regards to the date (or just x minutes)?  I was thinking of putting a countdown on my megatree an hour before the show starts which will count down from 60 mins to 0 and then start the show.  It looks like this is not possible as there is no reference to a specific (e.g. 7pm) or a countdown value in minutes and seconds instead of just seconds.
Title: Re: Text effect - Count Down formats
Post by: Phrog30 on August 12, 2015, 10:01:26 AM
Couldn't you create a sequence that counted down, then play only this sequence one hour before the actual show?
Title: Re: Text effect - Count Down formats
Post by: Gilrock on August 12, 2015, 10:11:39 AM
This is uncharted territory for me since I've never seen that option.  But I'm pretty sure the FPP has some nice overlay options that do countdowns and since it actually knows what time it is that would be the best option.
Title: Re: Text effect - Count Down formats
Post by: RGBNoob on August 12, 2015, 11:19:49 AM
Couldn't you create a sequence that counted down, then play only this sequence one hour before the actual show?

That's what I want to do but I want it to show how many minutes to the show, not how many seconds (i.e. 3600 seconds instead of 60 minutes).
Title: Re: Text effect - Count Down formats
Post by: RGBNoob on August 12, 2015, 11:20:30 AM
This is uncharted territory for me since I've never seen that option.  But I'm pretty sure the FPP has some nice overlay options that do countdowns and since it actually knows what time it is that would be the best option.

Thanks Gil I'll look into that.
Title: Re: Text effect - Count Down formats
Post by: flyinverted on August 12, 2015, 11:57:25 AM
From the 3.0.24 release notes and video by Sean, the countdown on text option was created by Matt Brown.
Matt now works for LOR as a developer.  He is a cool guy and may reveal the syntax needed to document these options.

I'll keep testing and see what I can discover.

-Steve
Title: Re: Text effect - Count Down formats
Post by: dkulp on August 12, 2015, 01:05:25 PM
There's some comments in the code that might help:

https://github.com/smeighan/xLights/blob/v4/xLights/RenderText.cpp#L500


Title: Re: Text effect - Count Down formats
Post by: gerry on August 12, 2015, 05:20:15 PM
This is uncharted territory for me since I've never seen that option.  But I'm pretty sure the FPP has some nice overlay options that do countdowns and since it actually knows what time it is that would be the best option.

I have tried out the FP overlays and they are quite nice - there are code samples that you can just change and upload and also there is the advantage that it will calculate and count down from the day of execution

My questions on this post was for the xLights manual documentation.



Title: Re: Text effect - Count Down formats
Post by: gerry on August 12, 2015, 05:54:18 PM
There's some comments in the code that might help:

https://github.com/smeighan/xLights/blob/v4/xLights/RenderText.cpp#L500

thanks Dan,

I will have a look .
Title: Re: Text effect - Count Down formats
Post by: flyinverted on August 12, 2015, 06:28:04 PM
Gerry

That link also has reference to http://www.cplusplus.com/reference/ctime/strftime (http://www.cplusplus.com/reference/ctime/strftime)

and

http://docs.wxwidgets.org/trunk/classwx_time_span.html (http://docs.wxwidgets.org/trunk/classwx_time_span.html)  and references RFC822.

I tried many combinations today without success.
I haven't given up yet.  Good luck!
Steve
Title: Re: Text effect - Count Down formats
Post by: gerry on August 13, 2015, 03:57:25 AM
I tried many combinations today without success.
I haven't given up yet.  Good luck!
Steve

Got it !!

All documented  :)  :)

The last one was a bitch ! You need to get it just right !
Title: Re: Text effect - Count Down formats
Post by: Gilrock on August 13, 2015, 08:05:50 AM
Now you know even the developers don't know everything that's in the code. :)
Title: Re: Text effect - Count Down formats
Post by: flyinverted on August 13, 2015, 12:08:19 PM
Great work Gerry!!
Title: Re: Text effect - Count Down formats
Post by: sean on August 13, 2015, 01:57:44 PM
gerry can you post here a date that works for the countdown?

i will also add it to the prompt in the effect.
we really should modiy the code so it recognizes many date time formats. i know when don julien wrote this code he wanted it to be able to use a formatted string.
Title: Re: Text effect - Count Down formats
Post by: flyinverted on August 13, 2015, 02:07:17 PM
From the manual on Page 88.
Title: Re: Text effect - Count Down formats
Post by: flyinverted on August 13, 2015, 02:16:49 PM
He's got a good point about the timers being from the render time and not the show time since no code is executed on the show time unless you're manually playing a sequene from the sequener window and have output to lights checked.  I have updated the document with a little more detail about that.
Title: Re: Text effect - Count Down formats
Post by: sean on August 13, 2015, 02:20:35 PM
Steve, the reason i ask is that is till get invalid date.

I am using "Fri, Dec 25 2015 00:00:00 +0100"

Title: Re: Text effect - Count Down formats
Post by: flyinverted on August 13, 2015, 02:46:30 PM
RTFM Read the Fine Manual.

Try this:  Fri, 25 Dec 2015 00:00:00 +0100

Title: Re: Text effect - Count Down formats
Post by: flyinverted on August 13, 2015, 02:53:31 PM
I will add that this conforms to RFC822 on dates/times.

https://validator.w3.org/feed/docs/error/InvalidRFC2822Date.html (https://validator.w3.org/feed/docs/error/InvalidRFC2822Date.html)

timezones EST, PST etc are valid as is GMT as well as the numeric offset (-0700)


Title: Re: Text effect - Count Down formats
Post by: sean on August 13, 2015, 02:59:19 PM
Thanks Steve, it is so easy to transpose one form.

So i did try all three of these and they work
"Wed, 02 Oct 2015 08:00:00 EST"
"Wed, 02 Oct 2015 13:00:00 GMT"
"Wed, 02 Oct 2015 15:00:00 +0200"

Note if the date you enter is in the past , like this

"Wed, 02 Oct 2002 15:00:00 +0200"

Then you get the not very helpful "Invalid Date" message.

Title: Re: Text effect - Count Down formats
Post by: gerry on August 13, 2015, 03:02:12 PM
gerry can you post here a date that works for the countdown?

i will also add it to the prompt in the effect.
we really should modiy the code so it recognizes many date time formats. i know when don julien wrote this code he wanted it to be able to use a formatted string.

Hello Sean,

He did provide for a formatted string (the last option) . It causes xL to crash unless u get it exactly right (as I think it does the parsing as you are keying in the value) - I will raise a github issue later today , describing how to get that exactly right and when the crashes occur  .  So after about 5-6 attempts and crashes I stopped trying to look at all the permutations (for the !fmt option) that were documented in the code. The one that is in the manual works. Enter (or copy) the text first and then change the selection to the !fmt value - not the other way round.


Title: Re: Text effect - Count Down formats
Post by: gerry on August 13, 2015, 03:09:42 PM

"Wed, 02 Oct 2002 15:00:00 +0200"

Then you get the not very helpful "Invalid Date" message.

Got that message for about the 100 other combinations that I tried with and without quotes and apostrophes   :)  , until I carefully looked at the code - thanks Dan. Even after it started displaying values I had to try  Mel time to determine what I was getting for each format as the format is the output format rather than the input format. The input is kind of fixed..which makes sense I suppose from a code perspective.   
Title: Re: Text effect - Count Down formats
Post by: flyinverted on August 13, 2015, 03:10:48 PM
Thanks Steve, it is so easy to transpose one form.

So i did try all three of these and they work
"Wed, 02 Oct 2015 08:00:00 EST"
"Wed, 02 Oct 2015 13:00:00 GMT"
"Wed, 02 Oct 2015 15:00:00 +0200"

Note if the date you enter is in the past , like this

"Wed, 02 Oct 2002 15:00:00 +0200"

Then you get the not very helpful "Invalid Date" message.

I too was getting the invalid message and I was stumped. That RFC does not like the American version of putting the day of the month in front.  Makes no sense on how America represents the units out of order for the date, but that's another topic of discussion. No wonder someone from Australia was able to figure it out!
Title: Re: Text effect - Count Down formats
Post by: gerry on August 13, 2015, 03:21:24 PM

No wonder someone from Australia was able to figure it out!

Nothing to do with being from Australia :) .  I did look at the specs that you linked to Steve, as was most annoyed at that message , but figured that the programmer would have checked that it was working , so I just had to find the correct format. 
It helped that in a previous life I used to code... and when Dan sent though the code, I should have looked at it more carefully in the first instance as it is actually quite well documented.