public class DataPointRT extends java.lang.Object implements IDataPoint, com.serotonin.util.ILifecycle, TimeoutClient
| Modifier and Type | Class and Description |
|---|---|
(package private) class |
DataPointRT.EventNotifyWorkItem |
| Modifier and Type | Field and Description |
|---|---|
private java.util.Map<java.lang.String,java.lang.Object> |
attributes |
private java.util.List<IValueTime> |
averagingValues |
private java.util.List<PointEventDetectorRT> |
detectors |
private java.lang.Object |
intervalLoggingLock |
private com.serotonin.timer.TimerTask |
intervalLoggingTask |
private long |
intervalStartTime |
private PointValueTime |
intervalValue |
private static org.apache.commons.logging.Log |
LOG |
private PointLocatorRT |
pointLocator |
private PointValueTime |
pointValue |
private static PvtTimeComparator |
pvtTimeComparator |
private RuntimeManager |
rm |
private double |
toleranceOrigin
This is the value around which tolerance decisions will be made when
determining whether to log numeric values.
|
private PointValueCache |
valueCache |
private DataPointVO |
vo |
| Constructor and Description |
|---|
DataPointRT(DataPointVO vo,
PointLocatorRT pointLocator) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
private void |
fireEvents(PointValueTime oldValue,
PointValueTime newValue,
boolean set,
boolean backdate) |
java.lang.Object |
getAttribute(java.lang.String key) |
java.util.Map<java.lang.String,java.lang.Object> |
getAttributes() |
int |
getDataSourceId() |
int |
getDataTypeId() |
int |
getId() |
java.util.List<PointValueTime> |
getLatestPointValues(int limit) |
<T extends PointLocatorRT> |
getPointLocator() |
PointValueTime |
getPointValue() |
PointValueTime |
getPointValueAt(long time) |
PointValueTime |
getPointValueBefore(long time) |
java.util.List<PointValueTime> |
getPointValues(long since) |
java.util.List<PointValueTime> |
getPointValuesBetween(long from,
long to) |
DataPointVO |
getVO() |
int |
hashCode() |
void |
initialize() |
void |
initializeHistorical() |
private void |
initializeIntervalLogging() |
private void |
intervalSave(PointValueTime pvt) |
void |
joinTermination() |
void |
resetValues() |
private void |
savePointValue(PointValueTime newValue,
SetPointSource source,
boolean async) |
void |
scheduleTimeout(long fireTime) |
void |
setAttribute(java.lang.String key,
java.lang.Object value) |
void |
setPointValue(PointValueTime newValue,
SetPointSource source)
Use this method to update a data point for reasons other than just data
source update.
|
void |
terminate() |
void |
terminateHistorical() |
private void |
terminateIntervalLogging() |
java.lang.String |
toString() |
void |
updatePointValue(PointValueTime newValue)
This method should only be called by the data source.
|
void |
updatePointValue(PointValueTime newValue,
boolean async) |
private static final org.apache.commons.logging.Log LOG
private static final PvtTimeComparator pvtTimeComparator
private final DataPointVO vo
private final PointLocatorRT pointLocator
private volatile PointValueTime pointValue
private final PointValueCache valueCache
private RuntimeManager rm
private java.util.List<PointEventDetectorRT> detectors
private final java.util.Map<java.lang.String,java.lang.Object> attributes
private PointValueTime intervalValue
private long intervalStartTime
private java.util.List<IValueTime> averagingValues
private final java.lang.Object intervalLoggingLock
private com.serotonin.timer.TimerTask intervalLoggingTask
private double toleranceOrigin
public DataPointRT(DataPointVO vo, PointLocatorRT pointLocator)
public java.util.List<PointValueTime> getLatestPointValues(int limit)
getLatestPointValues in interface IDataPointpublic PointValueTime getPointValueBefore(long time)
getPointValueBefore in interface IDataPointpublic PointValueTime getPointValueAt(long time)
public java.util.List<PointValueTime> getPointValues(long since)
getPointValues in interface IDataPointpublic java.util.List<PointValueTime> getPointValuesBetween(long from, long to)
getPointValuesBetween in interface IDataPointpublic void updatePointValue(PointValueTime newValue)
updatePointValue in interface IDataPointnewValue - public void updatePointValue(PointValueTime newValue, boolean async)
updatePointValue in interface IDataPointpublic void setPointValue(PointValueTime newValue, SetPointSource source)
setPointValue in interface IDataPointnewValue - the value to setsource - the source of the set. This can be a user object if the point
was set from the UI, or could be a program run by schedule or
on event.private void savePointValue(PointValueTime newValue, SetPointSource source, boolean async)
private void initializeIntervalLogging()
private void terminateIntervalLogging()
private void intervalSave(PointValueTime pvt)
public void scheduleTimeout(long fireTime)
scheduleTimeout in interface TimeoutClientpublic void resetValues()
public int getId()
public PointValueTime getPointValue()
getPointValue in interface IDataPointpublic <T extends PointLocatorRT> T getPointLocator()
public int getDataSourceId()
public DataPointVO getVO()
public int getDataTypeId()
getDataTypeId in interface IDataPointpublic java.util.Map<java.lang.String,java.lang.Object> getAttributes()
public void setAttribute(java.lang.String key,
java.lang.Object value)
public java.lang.Object getAttribute(java.lang.String key)
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectprivate void fireEvents(PointValueTime oldValue, PointValueTime newValue, boolean set, boolean backdate)
public void initialize()
initialize in interface com.serotonin.util.ILifecyclepublic void terminate()
terminate in interface com.serotonin.util.ILifecyclepublic void joinTermination()
joinTermination in interface com.serotonin.util.ILifecyclepublic void initializeHistorical()
public void terminateHistorical()