|
JMACS | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IProgram
to be implemented by all programs. Synchronization is not required.
Be sure to override Object.toString()
, returning a
description of what the program does. This will be called once only, prior to init().
Any non-Serializable fields (e.g. driver) should be declared as transient.
Nested Class Summary | |
---|---|
static interface |
IProgram.States
program states. |
Method Summary | |
---|---|
void |
init(IDevice.IDriver driver,
IDevice.IStatus status,
IDevice.IConstants constants,
Timer timer)
called once, first, when the program is run. |
void |
terminate(IDevice.IStatus status)
called last, if the program is terminated externally, to permit any tidying up to be performed. |
boolean |
wake(IDevice.IStatus status,
IAlert alert)
called after init, whenever timer.sleep() returns (where timer is one of the arguments passed to init). |
Method Detail |
---|
void init(IDevice.IDriver driver, IDevice.IStatus status, IDevice.IConstants constants, Timer timer)
driver
- Cast appropriately.status
- as of last boundary. Cast appropriately.constants
- Cast appropriately.timer
- wake is called whenever timer.sleep()
returns. By default, this will happen midway between consecutive (device
status) sampling boundaries. If timer is reconfigured by the
program, be sure to have the program implement ISamplingDependent
, otherwise timer will be
reconfigured again whenever the sampling parameters change.boolean wake(IDevice.IStatus status, IAlert alert)
status
- as of last boundary. Cast appropriately.alert
- this will be cleared automatically if not IAlert.trigger(String)
ed, each time wake is called.
void terminate(IDevice.IStatus status)
status
- as of last boundary. Cast appropriately.
|
JMACS | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |