|
eWON JTK | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ewon.ewonitf.TagControl
public class TagControl
This class represents an eWON tag.
It can be used to access the tag value or the tag alarm status.
It can also be used to force historical loggin and acknowledge alarm.
For tag creation and reconfiguration, the SysControlBlock
should be used.
The TagControl
object is also used for defining tag events handling in the DefaultEventHandler
.
Field Summary | |
---|---|
static int |
ALARM_STATUS_ACK
Alarm status value when an alarm is active (and it IS acknowledged), see getAlarmType() |
static int |
ALARM_STATUS_ALM
Alarm status value when an alarm is active (and not acknowledged), see getAlarmType() |
static int |
ALARM_STATUS_NONE
Alarm status value when no alarm is pending, see getAlarmType() |
static int |
ALARM_STATUS_RTN
Alarm status value when an alarm has returned to normal (but not acknowledged), see getAlarmType() |
static int |
ALARM_TYPE_HIGH
Alarm type value when no alarm is active with level HIGH, see getAlarmStatus() |
static int |
ALARM_TYPE_HIGH_HIGH
Alarm type value when no alarm is active with level HIGH HIGH, see getAlarmStatus() |
static int |
ALARM_TYPE_LEVEL
Alarm type value when no alarm is active with boolean level, see getAlarmStatus() |
static int |
ALARM_TYPE_LOW
Alarm type value when no alarm is active with level LOW, see getAlarmStatus() |
static int |
ALARM_TYPE_LOW_LOW
Alarm type value when no alarm is active with level LOW LOW, see getAlarmStatus() |
static int |
ALARM_TYPE_NONE
Alarm type value when no alarm is pending, see getAlarmStatus() |
static byte |
BY_ID
ReferenceType for TagControl(int,int) indicating if that the refence to the
tag is its ID. |
static byte |
BY_NDX
ReferenceType for TagControl(int,int) indicating if that the refence to the
tag is its index (starting at 0). |
Constructor Summary | |
---|---|
TagControl()
This constructor creates an unamned tag control object. |
|
TagControl(int TagId)
Creates an instance of TagControl associated to the given Tag ID. |
|
TagControl(int TagRefType,
int TagRef)
Creates a new instance of TagControl associated to Tag NDX or Tag ID. |
|
TagControl(String TagName)
Creates a new instance of TagControl associated to a Tag Name. |
Method Summary | |
---|---|
void |
ackAlarm()
Used to acknowledge an active alarm. The alarm will appear in the alarm history log as acknowledged by the administrator. See also ackAlarm(java.lang.String) |
void |
ackAlarm(String userLogin)
Used to acknowledge an active alarm. The userLogin provided will appear in the alarm log. |
int |
getAlarmStatus()
Read the current alarm status for the tag. |
int |
getAlarmType()
Read the current alarm type for the tag. |
int |
getTagId()
Return the ID of tag associated to this TagControl instance. |
String |
getTagName()
Return the Name of tag associated to this TagControl instance. |
double |
getTagValueAsDouble()
Read tag value and return value as Double. |
long |
getTagValueAsLong()
Read tag value and return value as Long. |
void |
logTag()
Force historical logging of the tags current value. |
void |
setTagId(int TagId)
Associates the TagControl instance with a tag by the tag's ID. Remark: success of this call does not mean that the given TagId is actually valid. |
void |
setTagName(String TagName)
Associates the TagControl instance with a tag by the tag's name. |
void |
setTagValueAsDouble(double value)
Change the tag value with Double value. |
void |
setTagValueAsInt(int value)
Change the tag value with Integer value. |
void |
setTagValueAsLong(long value)
Change the tag value with Long value. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final byte BY_NDX
TagControl(int,int)
indicating if that the refence to the
tag is its index (starting at 0).
public static final byte BY_ID
TagControl(int,int)
indicating if that the refence to the
tag is its ID.
public static final int ALARM_STATUS_NONE
getAlarmType()
public static final int ALARM_STATUS_ALM
getAlarmType()
public static final int ALARM_STATUS_ACK
getAlarmType()
public static final int ALARM_STATUS_RTN
getAlarmType()
public static final int ALARM_TYPE_NONE
getAlarmStatus()
public static final int ALARM_TYPE_HIGH
getAlarmStatus()
public static final int ALARM_TYPE_LOW
getAlarmStatus()
public static final int ALARM_TYPE_LEVEL
getAlarmStatus()
public static final int ALARM_TYPE_HIGH_HIGH
getAlarmStatus()
public static final int ALARM_TYPE_LOW_LOW
getAlarmStatus()
Constructor Detail |
---|
public TagControl(int TagId)
setTagId(int)
function.
TagId
- This is the ID of the the Tag that needs to be mapped.public TagControl(int TagRefType, int TagRef) throws EWException
TagControl(int)
function can be used also.
TagRefType
- This field defines the type of reference passed (either BY_NDX, BY_ID)TagRef
- This is an ID or an index according to TagRefType
EWException
- In case of invalid Tag NDX.public TagControl(String TagName) throws EWException
TagName
- The tag's name. The given tag must exist.
EWException
- In case the operation fails.public TagControl()
setTagId(int)
or setTagName(java.lang.String)
function has been called
This allows to dynamically reuse a TagControl object for multiple tags.
Method Detail |
---|
public int getTagId()
public String getTagName()
public double getTagValueAsDouble()
public long getTagValueAsLong()
public void setTagValueAsDouble(double value) throws EWException
value
- New value of the tag. This value will be converted to the actual tag type.
EWException
public void setTagValueAsLong(long value) throws EWException
value
- New value of the tag. This value will be converted to the actual tag type.
EWException
public void setTagValueAsInt(int value) throws EWException
value
- New value of the tag. This value will be converted to the actual tag type.
EWException
public void logTag() throws EWException
EWException
public void ackAlarm(String userLogin) throws EWException
userLogin
- This user will appear as having acknowledged the alarm in the alarm history log.ackAlarm()
EWException
public void ackAlarm() throws EWException
ackAlarm(java.lang.String)
EWException
public int getAlarmStatus() throws EWException
ALARM_STATUS_NONE,
ALARM_STATUS_ALM,ALARM_STATUS_ACK,ALARM_STATUS_RTN
.
EWException
public int getAlarmType() throws EWException
ALARM_TYPE_NONE,ALARM_TYPE_HIGH,ALARM_TYPE_LOW,
ALARM_TYPE_LEVEL,ALARM_TYPE_HIGH_HIGH,ALARM_TYPE_LOW_LOW
.
EWException
public void setTagId(int TagId)
TagId
- The ID of the tag the instance must be associated with.public void setTagName(String TagName)
TagName
- The name of the tag the instance must be associated with.
|
eWON JTK | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |