Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 22nd, 2024, 12:44 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Countdown question
PostPosted: November 28th, 2017, 8:15 pm 
Offline

Joined: May 16th, 2008, 4:50 pm
Posts: 368
Location: Berghem The Netherlands
Opus: Opus Pro 9.75
OS: Windows 10
System: `HP
I am working on a basketball scoreboard and therefor i need to use multiple countdowns
simultaneously. Now i use a ticker that counts down, but when i activate a second countdown ticker
they run always in sync. What i need is 2 tickers that count down separate.
Is my ticker action not the right way to do this?


Ad

_________________
Opus Pro v9.75
Windows 10 on HP EliteBook i7
http://www.csnmedia.nl


For this message Ad Mulders has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: Countdown question
PostPosted: November 29th, 2017, 9:55 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
No, one ticker should be fine.

You'll need two variables - one for each countdown and a control variable for each of those variables to handle stopping, starting, checking.

The ticker code looks something like this:

Code:
if (myControlVariableOne == true) {
   myCountdownVariableOne--;
   if (myCountdownVariableOne == 0){
      myControlVariableOne = false //stop countdown
      //do something here now that countdown one is zero.
      Debug.trace("hey CD1 you reached zero")
   }
}

if (myControlVariableTwo == true) {
   myCountdownVariableTwo--;
   if (myCountdownVariableTwo == 0){
      myControlVariableTwo = false //stop countdown
      //do something here now that countdown one is zero.
      Debug.trace("hey CD2 you reached zero")
   }
}


myControlVariable - One & Two will initially be set to false.

myCountDownVariable - One & Two will be set to the starting values for your countdown.

</mack>

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject: Re: Countdown question
PostPosted: November 29th, 2017, 11:03 pm 
Offline

Joined: May 16th, 2008, 4:50 pm
Posts: 368
Location: Berghem The Netherlands
Opus: Opus Pro 9.75
OS: Windows 10
System: `HP
Thanks Mac,
Can you tell how to get it work because i don;t know how to get it run.

Ad

_________________
Opus Pro v9.75
Windows 10 on HP EliteBook i7
http://www.csnmedia.nl


For this message Ad Mulders has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: Countdown question
PostPosted: December 1st, 2017, 6:00 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Here's an example:

download from: http://www.live.interaktiv.co.uk/?section=files
Use code: dual-countdown@digitalgrapevine.info

</mack>

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject: Re: Countdown question
PostPosted: December 1st, 2017, 9:26 pm 
Offline

Joined: May 16th, 2008, 4:50 pm
Posts: 368
Location: Berghem The Netherlands
Opus: Opus Pro 9.75
OS: Windows 10
System: `HP
Thanks Mack for the example.

Unfortunately the result is not yet what I need.
In my first test with 2 tickers they also ran synchronously and they have to countdown independently.

I have an example on youtube where you cn see the 2 counters do not synchronize the countdown because they are started independently of each other.
View the countdown clocks on the right side of the title bar at the bottom of the screen.
That was the reason that I used 2 tickers, but apparently they always want to run in sync. :-)

https://www.youtube.com/watch?v=GeGuKZt ... e&t=43m50s

_________________
Opus Pro v9.75
Windows 10 on HP EliteBook i7
http://www.csnmedia.nl


For this message Ad Mulders has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: Countdown question
PostPosted: December 1st, 2017, 10:44 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Try this:

Code:
if (myControlVariableOne == true) {
   myTickerFractionOne++
   if (myTickerFractionOne == 100) {
         myCountdownVariableOne--;
      myTickerFractionOne = 0;
   }
   if (myCountdownVariableOne == 0){
      myControlVariableOne = false //stop countdown
      //do something here now that countdown one is zero.
      Debug.trace("hey CD1 you reached zero")
   }
}


if (myControlVariableTwo == true) {
   myTickerFractionTwo++
   if (myTickerFractionTwo == 100) {
         myCountdownVariableTwo--;
      myTickerFractionTwo = 0;
   }
   if (myCountdownVariableTwo == 0){
      myControlVariableTwo = false //stop countdown
      //do something here now that countdown one is zero.
      Debug.trace("hey CD2 you reached zero")
   }
}


And add two publication variables myTickerFractionOne & myTickerFractionTwo both with number values sets to zero.

And set the ticker speed to 0.01.

</mack>

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


For this message mackavi has been thanked by : Ad Mulders


Top
 Profile Visit website  
 
 Post subject: Re: Countdown question
PostPosted: December 2nd, 2017, 8:35 am 
Offline

Joined: May 16th, 2008, 4:50 pm
Posts: 368
Location: Berghem The Netherlands
Opus: Opus Pro 9.75
OS: Windows 10
System: `HP
Great Mac, this works.
One thing i found out, when the myTickerFractionOne == 100 then he is running way to slow. 60 countdown seconds took 1:39
on my hand stopwatch and stopwatch on my iPhone.

I tested it on 2 laptops and set the value to 64 and that works fine.
It's not complete accurate but maybe you have a better solution to get it right.Is it better to change the ticker speed from 0.01 to another value?

Ad

_________________
Opus Pro v9.75
Windows 10 on HP EliteBook i7
http://www.csnmedia.nl


For this message Ad Mulders has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: Countdown question
PostPosted: December 3rd, 2017, 9:58 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Might be able to use a wait in a loop. Have some tweaks for a client to look at first though, but will try and see if it works better after that.

</mack>

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


For this message mackavi has been thanked by : Ad Mulders


Top
 Profile Visit website  
 
 Post subject: Re: Countdown question
PostPosted: December 6th, 2017, 8:56 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Okay, download this example using the code: dual-countdown-v2@digitalgrapevine.info

It uses wait() in a loop. The countdowns are asynchronous and appear accurate against the stopwatch on my phone.

</mack>

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 26 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group