Rotimer (hd2000 only) – BrightSign HD2000 Object Reference Manual User Manual

Page 36

Advertising
background image

 rotVOID SubtractSeconds(rotINT32 seconds)
 rotVOID AddMilliseconds(rotINT32 milliseconds)
 rotVOID SubtractMilliseconds(rotINT32 milliseconds)
 rotBOOL Normalize()

o

Check that all the fields supplied are correct. It fails if values are out of bounds


A newly created object is at the time represented by zero seconds.
When used via the ifString interface ifDateTime will always use the sortable date format "YYYY-MM-DD
hh:mm:ss".

roTimer (HD2000 only)


The roTimer object implements ifTimer and ifSetMessagePort. This ifTimer interface provides:
 rotVOID SetTime(rotINT32 hour, rotINT32 minute, rotINT32 second,

rotINT32 millisecond)

 rotVOID SetDate(rotINT32 year, rotINT32 month, rotINT32 day)
 rotVOID SetDayOfWeek(rotINT32 day_of_week)

o

Set the time that you wish the event to trigger. In general if a value is -1 then it is a wildcard

and will cause the event to trigger every time the rest of the specification matches. If there are
no wildcards, then the timer will trigger only once, when the specified date/time occurs. It is
possible using a combination of day and day_of_week to specify invalid combinations that
will never occur.

o

If specifications include any wildcard then the second and millisecond specification must be

zero. Events will be raised at most once a minute near the whole minute.

 rotVOID SetDateTime(ifDateTime)

o

Set the time that you wish the event to trigger from a roDateTime object. It is not possible to

set wildcards using this method.

 rotBOOL Start()

o

Start the timer based on the current values specified via the above functions.

 rotBOOL Stop()

o

Stop the timer.


Example: This code creates a timer that triggers every 30 seconds.

st=CreateObject("roSystemTime")
timer=CreateObject("roTimer")
mp=CreateObject("roMessagePort")
timer.SetPort(mp)

timeout=st.GetLocalDateTime()

timeout.AddSeconds(30)
timer.SetDateTime(timeout)

timer.Start()

while true

ev = wait(0, mp)

if (type(ev) = "roTimerEvent") then

print "timer event received"

timeout=st.GetLocalDateTime()

timeout.AddSeconds(30)

timer.SetDateTime(timeout)

36

Advertising
This manual is related to the following products: