org.openiec61850
Class DaTimestamp

java.lang.Object
  extended by org.openiec61850.ModelNode
      extended by org.openiec61850.FcModelNode
          extended by org.openiec61850.BasicDataAttribute
              extended by org.openiec61850.DaTimestamp
All Implemented Interfaces:
java.lang.Iterable<ModelNode>

public class DaTimestamp
extends BasicDataAttribute


Field Summary
 
Fields inherited from class org.openiec61850.BasicDataAttribute
basicType, dchg, dupd, qchg, sAddr
 
Fields inherited from class org.openiec61850.FcModelNode
fc
 
Fields inherited from class org.openiec61850.ModelNode
children, objectReference
 
Constructor Summary
DaTimestamp(ObjectReference objectReference, FunctionalConstraint fc, java.lang.String sAddr, byte[] value, boolean dchg, boolean dupd)
           
 
Method Summary
 DaTimestamp copy()
          Copies the whole node with all of its children.
 boolean getClockFailure()
          The attribute clockFailure shall indicate that the time source of the sending device is unreliable.
 boolean getClockNotSynchronized()
          The attribute clockNotSynchronized shall indicate that the time source of the sending device is not synchronized with the external UTC time.
 java.util.Date getDate()
           
 int getFractionOfSecond()
          The attribute FractionOfSecond shall be the fraction of the current second when the value of the TimeStamp has been determined.
 boolean getLeapSecondsKnown()
          The value TRUE of the attribute LeapSecondsKnown shall indicate that the value for SecondSinceEpoch takes into account all leap seconds occurred.
 long getSecondsSinceEpoch()
          The SecondSinceEpoch shall be the interval in seconds continuously counted from the epoch 1970-01-01 00:00:00 UTC
 int getTimeAccuracy()
          The attribute TimeAccuracy shall represent the time accuracy class of the time source of the sending device relative to the external UTC time.
 byte[] getValue()
           
 void setCurrentTime()
          Sets Timestamp to current time
 void setDate(java.util.Date date)
           
 void setDate(java.util.Date date, boolean leapSecondsKnown, boolean clockFailure, boolean clockNotSynchronized, int timeAccuracy)
           
 void setDefault()
          Sets Timestamp to 8Byte with all zeros
 void setValue(byte[] value)
           
 void setValue(java.lang.Object value)
           
 java.lang.String toString()
           
 
Methods inherited from class org.openiec61850.BasicDataAttribute
getBasicDataAttributes, getBasicType, getChild, getChild, getChildren, getDchg, getDupd, getQchg, getSAddr, iterator
 
Methods inherited from class org.openiec61850.FcModelNode
getFunctionalConstraint
 
Methods inherited from class org.openiec61850.ModelNode
findSubNode, findSubNode, findSubNode, findSubNode, getIterators, getNodeName, getReference
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DaTimestamp

public DaTimestamp(ObjectReference objectReference,
                   FunctionalConstraint fc,
                   java.lang.String sAddr,
                   byte[] value,
                   boolean dchg,
                   boolean dupd)
Method Detail

getSecondsSinceEpoch

public long getSecondsSinceEpoch()
The SecondSinceEpoch shall be the interval in seconds continuously counted from the epoch 1970-01-01 00:00:00 UTC


getFractionOfSecond

public int getFractionOfSecond()
The attribute FractionOfSecond shall be the fraction of the current second when the value of the TimeStamp has been determined. The fraction of second shall be calculated as (SUM from I = 0 to 23 of bi*2**–(I+1) s). NOTE 1 The resolution is the smallest unit by which the time stamp is updated. The 24 bits of the integer provides 1 out of 16777216 counts as the smallest unit; calculated by 1/2**24 which equals approximately 60 ns. NOTE 2 The resolution of a time stamp may be 1/2**1 (= 0,5 s) if only the first bit is used; or may be 1/2**2 (= 0,25 s) if the first two bits are used; or may be approximately 60 ns if all 24 bits are used. The resolution provided by an IED is outside the scope of this standard.


setDate

public void setDate(java.util.Date date)

setDate

public void setDate(java.util.Date date,
                    boolean leapSecondsKnown,
                    boolean clockFailure,
                    boolean clockNotSynchronized,
                    int timeAccuracy)

setValue

public void setValue(byte[] value)

setValue

public void setValue(java.lang.Object value)
Specified by:
setValue in class BasicDataAttribute

getDate

public java.util.Date getDate()

getValue

public byte[] getValue()
Specified by:
getValue in class BasicDataAttribute

getLeapSecondsKnown

public boolean getLeapSecondsKnown()
The value TRUE of the attribute LeapSecondsKnown shall indicate that the value for SecondSinceEpoch takes into account all leap seconds occurred. If it is FALSE then the value does not take into account the leap seconds that occurred before the initialization of the time source of the device. Java Date and Calendar objects do handle leap seconds, so this is usually true.


getClockFailure

public boolean getClockFailure()
The attribute clockFailure shall indicate that the time source of the sending device is unreliable. The value of the TimeStamp shall be ignored.


getClockNotSynchronized

public boolean getClockNotSynchronized()
The attribute clockNotSynchronized shall indicate that the time source of the sending device is not synchronized with the external UTC time.


getTimeAccuracy

public int getTimeAccuracy()
The attribute TimeAccuracy shall represent the time accuracy class of the time source of the sending device relative to the external UTC time. The timeAccuracy classes shall represent the number of significant bits in the FractionOfSecond If the time is set via Java Date objects, the accuracy is 1 ms, that is a timeAccuracy value of 10.


setDefault

public void setDefault()
Sets Timestamp to 8Byte with all zeros

Specified by:
setDefault in class BasicDataAttribute

setCurrentTime

public void setCurrentTime()
Sets Timestamp to current time


copy

public DaTimestamp copy()
Description copied from class: ModelNode
Copies the whole node with all of its children. Creates new BasicDataAttribute values but reuses ObjectReferences, FunctionalConstraints.

Specified by:
copy in class ModelNode

toString

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