|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdk.opi.io.DefaultIOGroup
dk.opi.io.opc.opcclient.OpcGroup
This class implements functionality related to groups. Groups are containers for OpcItems. This class has no public constructor - use the OpcClientApi.addGroup() method to create instances of this class.
OpcClientApi.addGroup(java.lang.String, boolean, int, float)
Field Summary |
Fields inherited from class dk.opi.io.DefaultIOGroup |
active, description, ioListeners, items, name, updateRate |
Method Summary | |
OpcItem |
addItem(String itemId,
String accessPath,
boolean active,
int dataType,
String actionCmd)
Add an item to this group. |
OpcItem |
addItem(String itemId,
String accessPath,
boolean active,
int dataType,
String actionCmd,
String descr)
Add an item to this group. |
void |
fireAllItems(IOListener iol,
boolean performRead,
int dataSource)
Use this method to manually fire a IOListener.onValueChanged(dk.opi.io.IOItem) notification to
the specified IOListener. |
void |
readAllItems(int dataSource)
Read the item value for all items in this group. |
void |
removeItem(IOItem ioi)
Remove an item from this group |
void |
setActive(boolean b)
Turn off/on automatical updating from the IOItems in this group depending on the value of b. |
Methods inherited from class dk.opi.io.DefaultIOGroup |
addIOListener, addItem, finalize, fireAllItems, fireAllItems, fireIOListenerOnValueChanged, getDescription, getItem, getItems, getName, getUpdateRate, isActive, removeIOListener, setDescription |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public OpcItem addItem(String itemId, String accessPath, boolean active, int dataType, String actionCmd) throws RbxIOException
itemId
- name or id of the item. Does not have to be be unique within groupaccessPath
- The AccessPath is intended as a way for the client to provide to the
server a suggested data path (e.g. a particular modem or network
interface). It indicates HOW to get the data.active
- if items in this group are going to be monitoredactionCmd
- a String allowing users to assign logical names to Items
RbxIOException
public OpcItem addItem(String itemId, String accessPath, boolean active, int dataType, String actionCmd, String descr) throws RbxIOException
itemId
- name or id of the item. Does not have to be be unique within groupaccessPath
- The AccessPath is intended as a way for the client to provide to the
server a suggested data path (e.g. a particular modem or network
interface). It indicates HOW to get the data.active
- if items in this group are going to be monitoredactionCmd
- a String allowing users to assign logical names to Itemsdescr
- description of the item. Can be queried by a call to
RbxIOException
public void removeItem(IOItem ioi) throws RbxIOException
removeItem
in interface IOGroup
removeItem
in class DefaultIOGroup
ioi
- The item to remove
RbxIOException
- thrown if it was not possible to remove the specified item, for
instance if the specified item is not a member of this group.public void setActive(boolean b)
setActive
in interface IOGroup
setActive
in class DefaultIOGroup
b
- if true IOItems in this group will fire the valueChanged() event
everytime a value is changedpublic void fireAllItems(IOListener iol, boolean performRead, int dataSource) throws RbxIOException
IOListener.onValueChanged(dk.opi.io.IOItem)
notification to
the specified IOListener. This method is usefull right after items have been added
to the group. A call to this method will initialize your application with the
current values.
fireAllItems
in interface IOGroup
fireAllItems
in class DefaultIOGroup
iol
- the listener to notifyperformRead
- if true a read will be performed for all items in the group
prior to firing of the event. In combination with a dataSource value of
DEVICE_READ this will ensure that the onValueChanged() is fired with the most
recent and up to date value.dataSource
- The source to read from, ie. CACHE_READ or DEVICE_READ. Also see
IOItem.readValue(int)
. Ignored unless performRead
is
set to true
RbxIOException
- Will only be thrown if performRead
is true and the read operation
for some reason failspublic void readAllItems(int dataSource) throws RbxIOException
IOListener.onValueChanged(dk.opi.io.IOItem)
on registered listeners for
the group will be called for changed values. The quality of the item is
updated as part of making this call, so make sure that you as part of the
IOListener.onValueChanged(dk.opi.io.IOItem)
notification is making a check
for the quality.
readAllItems
in interface IOGroup
readAllItems
in class DefaultIOGroup
dataSource
- The source to read from, ie. IOItem.CACHE_READ or IOItem.DEVICE_READ.
A CACHE read will obtain the current value for the item from the device
server cache (eg. OPC server). This is fast but the value is only
updated with the specified update rate, ie. a CACHE read is accurate to
within the 'UpdateRate' of the group.RbxIOException
- thrown if one or more read operations failed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |