visual countdown timer on touch panel
Can anyone recommend a method for creating a countdown timer on a touch panel. I'm using an AXT-CA10 and Axcent3 controller. Some sample code would be greatly appreciated! I would like to use this as a visual feedback while a projector is warming up and cooling down.
Eric
Eric
Comments
define_constant TL_Countdown = 1 //make sure you change this to whatever works in your system if you have other timelines you use define_variable long lTL_countdowntimes[] = {1000} //1 second, could make this longer or shorter if you wanted to define_event button_event[dvTP,timeline_start] { push: { timeline_create(TL_Countdown,lTL_countdowntimes,1,timeline_relative,timeline_repeat) } } timeline_event[TL_Countdown] { stack_var integer nCountdownLength nCountdownLength = 30 send_command dvTP, "'^TXT,1,0,'ATOI(nCountdownLength-timeline.repetition),' seconds remaining'" if(timeline.repetition x timeline.time > nCountdownLength x 1000) { timeline_kill(TL_Countdown) } }That should work, haven't tested it and wrote it off the top of my head.
(also you have syntax errors ;p)
DEFINE_PROGRAM nTiming++ IF nCountdown=0 nCountdown=100 IF (nTiming=100) { nTiming=0 nCoutndown-- SEND_COMMAND dvTP,"I forget the G3 comand,ITOA(nCountdown)" } nTiming++Completely untested. Hopefully this gets you started.
INTEGER COUNTTIMER_W
INTEGER BARGRAPH_WARM
INTEGER COUNTTIMER_C
INTEGER BARGRAPH_COOL
*** Put this in program section***
// System Warm Up Timer and Bargraph Display
IF ((CountTimer_W <>999) and (CountTimer_W <40)) // second number is time to count up to
{
WAIT 10 // updates every second
{
CountTimer_W= CountTimer_W+1
SEND_LEVEL VTP , 3, COUNTTIMER_W
IF (CountTimer_W=40)
{
CountTimer_W=999 // stop counter
nSystem_Warm=1
WAIT 20
nSystem_Warm=0
SEND_LEVEL VTP, 3, 0
}
}
}
// System Cool Down Timer and Bargrahp Dispaly
IF ((CountTimer_C <>999) and (CountTimer_C <=120)) // second number is time to count up to
{
WAIT 10 // updates every second
{
CountTimer_C= CountTimer_C+1
SEND_LEVEL VTP , 4, COUNTTIMER_C
IF(COUNTTIMER_C=30)
{
PULSE[dvScr1,Scr1_Stop]
PULSE[dvScr2,Scr2_Stop]
}
IF(COUNTTIMER_C=120)
{
CountTimer_C=999 // stop counter
nSystem_Cool=1
WAIT 20
nSystem_Cool=0
SEND_LEVEL VTP, 4, 0
}
}
}
I use this code in all of my older units and have never had an issue. The only thing I have every found is not to have any other functions going on during the process because it might miss it.
Thanks guys, I'll give some of these a try...
Eric
Eric
Oops, neeed to read a little closer...and put my code in Netlinx studio first
I use it with Axcent III and Netlinx. It should work as it is for Axcecnt III. The VTP is just a device name but can be changed to TP.