|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcern.cmw.rda.examples.NoiseGenerator
public class NoiseGenerator
A device simulator that allows to check all basic device access methods.
A NoiseGenerator device has two properties:
double
double
Method Summary | |
---|---|
Data |
get(IOPoint iop,
Data context)
Returns a value of the specified property in a Data object. |
void |
monitorOff(IOPoint iop,
ValueChangeListener listener)
Detaches the specified listener from the specified property. |
void |
monitorOn(IOPoint iop,
ValueChangeListener listener)
Attaches the specified listener to the specified property. |
void |
set(IOPoint iop,
Data value,
Data context)
Sets the specified property to the specified value. |
void |
update()
Updates the AQN value and notifies attached listeners, if any. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void update()
In a real device this method would perform physical I/O; here it adds a random value within the -5.0 ... 5.0 range to the current CCV value, then informs all attached listeners on the value update. The on-change monitors will be fired if difference between new and old values is more then 1.0. The reported Data contains "value" and "timestamp" entries. If the AQN value occasionally goes out of its legal range then a simulated IOError will be reported.
public Data get(IOPoint iop, Data context) throws BadParameter, IOError
BadParameter
- if there is no such property in the device
IOError
- if an I/O error has been detected in the last update cycle
(AQN only)update()
public void set(IOPoint iop, Data value, Data context) throws BadParameter, IOError
BadParameter
- if there is no such property in the device, or if the value Data
does not contain the "value" entry, or if the value contained is
not a double
, or if the new value is out of the legal
CCV range.
IOError
- if the specified property is AQN (no write access)public void monitorOn(IOPoint iop, ValueChangeListener listener) throws BadParameter
BadParameter
- if there is no such property in the devicepublic void monitorOff(IOPoint iop, ValueChangeListener listener)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |