javafish.clients.opc.component
Class OpcGroup

java.lang.Object
  extended by javafish.clients.opc.component.OpcGroup
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class OpcGroup
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

OPC Group class

See Also:
Serialized Form

Constructor Summary
OpcGroup(java.lang.String groupName, boolean active, int updateRate, float percentDeadBand)
          Create new instance of OPC Group
 
Method Summary
 void addAsynchListener(OpcAsynchGroupListener listener)
          Add asynch-group listener
 void addItem(OpcItem item)
          Add item to group note: throws ItemExistsException - runtime exception
 java.lang.Object clone()
          Return clone of opc-group
 void generateClientHandleByOwner(JOpc opc)
          Generate clientHandle by its owner.
 javax.swing.event.EventListenerList getAsynchListeners()
          Get asynchronous group listeners list
 int getClientHandle()
          Get clientHandle of group (unique key)
 java.lang.String getGroupName()
          Get group name
 OpcItem getItemByClientHandle(int clientHandle)
          Get opc-item by its clientHandle
 java.util.ArrayList<OpcItem> getItems()
          Get items as array list
 OpcItem[] getItemsAsArray()
          Get items as array
 int getNewItemClientHandle()
          Generate new clientHandle for its item.
 float getPercentDeadBand()
          Get percent dead band of group
 int getUpdateRate()
          Get update rate of group
 boolean isActive()
          Test activity of group
 void removeAsynchListener(OpcAsynchGroupListener listener)
          Remove asynch-group listener
 void removeItem(OpcItem item)
          Remove item from group note: throws ItemExistsException - runtime exception
 void setActive(boolean active)
          Set activity of group
 void setUpdateRate(int updateRate)
          Set update rate of group
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OpcGroup

public OpcGroup(java.lang.String groupName,
                boolean active,
                int updateRate,
                float percentDeadBand)
Create new instance of OPC Group

Parameters:
groupName - String (user identificatio name of group)
active - boolean - begin activity of group
updateRate - double - refresh time of group in milliseconds
percentDeadBand - float - see percentDeadBand definition:

Deadband will only apply to items in the group that have a dwEUType of Analog available. If the dwEUType is Analog, then the EU Low and EU High values for the item can be used to calculate the range for the item. This range will be multiplied with the Deadband to generate an exception limit.
An exception is determined as follows:

Exception if (absolute value of (last cached value - current value) > pPercentDeadband * (EU High - EU Low) )

If the exception limit is exceeded, then the last cached value is updated with the new value and a notification will be sent to the IAdviseSink (if any). The pPercentDeadband is an optional behavior for the server. If the client does not specify this value on a server that does support the behavior, the default value of 0 (zero) will be assumed, and all value changes will update the CACHE. Note that the timestamp will be updated regardless of wether the cached value is updated.

Method Detail

generateClientHandleByOwner

public void generateClientHandleByOwner(JOpc opc)
Generate clientHandle by its owner. It is internal support for control of OpcGroup ID (unique key).

Parameters:
opc - JOpc

getNewItemClientHandle

public int getNewItemClientHandle()
Generate new clientHandle for its item.

It is internal support for generation of unique items ID.

Returns:
clientHandle int

isActive

public boolean isActive()
Test activity of group

Returns:
is active, boolean

setActive

public void setActive(boolean active)
Set activity of group

Parameters:
active - boolean

getItems

public java.util.ArrayList<OpcItem> getItems()
Get items as array list

Returns:
items ArrayList

getItemsAsArray

public OpcItem[] getItemsAsArray()
Get items as array

Returns:
items OpcItem[]

addItem

public void addItem(OpcItem item)
Add item to group

note: throws ItemExistsException - runtime exception

Parameters:
item - OpcItem

removeItem

public void removeItem(OpcItem item)
Remove item from group

note: throws ItemExistsException - runtime exception

Parameters:
item - OpcItem

getUpdateRate

public int getUpdateRate()
Get update rate of group

Returns:
updateRatio [ms], int

setUpdateRate

public void setUpdateRate(int updateRate)
Set update rate of group

Parameters:
updateRate - [ms], int

getClientHandle

public int getClientHandle()
Get clientHandle of group (unique key)

Returns:
key int

getGroupName

public java.lang.String getGroupName()
Get group name

Returns:
name String

getPercentDeadBand

public float getPercentDeadBand()
Get percent dead band of group

Returns:
band float

getItemByClientHandle

public OpcItem getItemByClientHandle(int clientHandle)
Get opc-item by its clientHandle

Parameters:
clientHandle - int
Returns:
item OpcItem

addAsynchListener

public void addAsynchListener(OpcAsynchGroupListener listener)
Add asynch-group listener

Parameters:
listener - OpcReportListener

removeAsynchListener

public void removeAsynchListener(OpcAsynchGroupListener listener)
Remove asynch-group listener

Parameters:
listener - OpcReportListener

getAsynchListeners

public javax.swing.event.EventListenerList getAsynchListeners()
Get asynchronous group listeners list

Returns:
listeners EventListenerList

clone

public java.lang.Object clone()
Return clone of opc-group

Overrides:
clone in class java.lang.Object
Returns:
group Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object