mglib

Personal IDL library for M. Galloy

single page | use frames     summary     class     fields     routine details     file attributes

vis/animation/

mg_timer__define.pro

includes main-level program

Timer class.

Examples

See the main-level example program:

IDL> .run mg_timer__define
The following creates a timer which will go off 5 times with 1.0 seconds between alarms, and then starts it:
IDL> timer = obj_new('MG_Timer', duration=1.0, nframes=5, $ callback='print', $ uvalue='Callback routine called') IDL> timer->start IDL> Callback routine called IDL> Callback routine called IDL> Callback routine called IDL> Callback routine called IDL> Callback routine called
The callback routine specified with the CALLBACK keyword must accept a single positional parameter where the value of the UVALUE property is passed to it.

Class description for mg_timer

Properties

Properties in mg_timer

active get type=boolean

whether the timer is currently running; read-only, use stop/start methods to change

callback get set init type=string

procedure to call when timer goes off; this procedure should accept a single positional parameter which is the value of the UVALUE property

current_frame get set type=long

number of times the timer has already gone off

duration get set init type=float

time in seconds between timer going off

nframes get set init type=long

total number of times the timer should go off; defaults to 1

repeating get set init type=boolean

set to repeat forever

uvalue get set init type=any

user-defined value passed to callback routine

Routines

Routines from mg_timer__define.pro

mg_timer_event, event

Timer event handler.

mg_timer::getProperty, /active, duration=float, /repeating, current_frame=long, nframes=long, callback=string, uvalue=any

Get properties.

mg_timer::setProperty, duration=float, /repeating, current_frame=long, nframes=long, callback=string, uvalue=any

Set properties.

mg_timer::start

Start the timer.

mg_timer::stop

Stop the timer.

mg_timer::cleanup

Free resources.

result = mg_timer::init(duration=float, /repeating, nframes=long, callback=string, uvalue=any)

Create a timer instance.

mg_timer__define

Define instance variables.

Routine details

top mg_timer_event

mg_timer_event, event

Timer event handler.

Parameters

event in required type=structure

timer event

top mg_timer::getProperty

mg_timer::getProperty, /active, duration=float, /repeating, current_frame=long, nframes=long, callback=string, uvalue=any

Get properties.

Keywords

active type=boolean

whether the timer is currently running; read-only, use stop/start methods to change

duration type=float

time in seconds between timer going off

repeating type=boolean

set to repeat forever

current_frame type=long

number of times the timer has already gone off

nframes type=long

total number of times the timer should go off; defaults to 1

callback type=string

procedure to call when timer goes off; this procedure should accept a single positional parameter which is the value of the UVALUE property

uvalue type=any

user-defined value passed to callback routine

top mg_timer::setProperty

mg_timer::setProperty, duration=float, /repeating, current_frame=long, nframes=long, callback=string, uvalue=any

Set properties.

Keywords

duration type=float

time in seconds between timer going off

repeating type=boolean

set to repeat forever

current_frame type=long

number of times the timer has already gone off

nframes type=long

total number of times the timer should go off; defaults to 1

callback type=string

procedure to call when timer goes off; this procedure should accept a single positional parameter which is the value of the UVALUE property

uvalue type=any

user-defined value passed to callback routine

top mg_timer::start

mg_timer::start

Start the timer.

top mg_timer::stop

mg_timer::stop

Stop the timer.

top mg_timer::cleanup

mg_timer::cleanup

Free resources.

top mg_timer::init

result = mg_timer::init(duration=float, /repeating, nframes=long, callback=string, uvalue=any)

Create a timer instance.

Return value

1 for success, 0 for failure

Keywords

duration type=float

time in seconds between timer going off

repeating type=boolean

set to repeat forever

nframes type=long

total number of times the timer should go off; defaults to 1

callback type=string

procedure to call when timer goes off; this procedure should accept a single positional parameter which is the value of the UVALUE property

uvalue type=any

user-defined value passed to callback routine

top mg_timer__define

mg_timer__define

Define instance variables.

File attributes

Modification date: Wed May 14 15:07:14 2014
Lines: 82
Docformat: rst rst
Personal library of Michael Galloy
Contact me if you have enhancement requests or bug fixes.