use of com.infiniteautomation.mango.monitor.DoubleMonitor in project ma-modules-public by infiniteautomation.
the class InternalDataSourceRT method forcePointRead.
@Override
public void forcePointRead(DataPointRT dataPoint) {
InternalPointLocatorRT locator = dataPoint.getPointLocator();
ValueMonitor<?> m = Common.MONITORED_VALUES.getValueMonitor(locator.getPointLocatorVO().getMonitorId());
if (m != null) {
if (m instanceof IntegerMonitor)
dataPoint.updatePointValue(new PointValueTime((double) ((IntegerMonitor) m).getValue(), Common.timer.currentTimeMillis()));
else if (m instanceof LongMonitor)
dataPoint.updatePointValue(new PointValueTime((double) ((LongMonitor) m).getValue(), Common.timer.currentTimeMillis()));
else if (m instanceof DoubleMonitor)
dataPoint.updatePointValue(new PointValueTime((double) ((DoubleMonitor) m).getValue(), Common.timer.currentTimeMillis()));
else if (m instanceof AtomicIntegerMonitor)
dataPoint.updatePointValue(new PointValueTime((double) ((AtomicIntegerMonitor) m).getValue(), Common.timer.currentTimeMillis()));
}
}
use of com.infiniteautomation.mango.monitor.DoubleMonitor in project ma-modules-public by infiniteautomation.
the class InternalDataSourceRT method doPoll.
@Override
public void doPoll(long time) {
if (createsPoints) {
for (ValueMonitor<?> m : Common.MONITORED_VALUES.getMonitors()) {
if (createPointsPattern.matcher(m.getId()).matches() && !monitorMap.containsKey(m.getId()))
createMonitorPoint(m);
}
}
for (DataPointRT dataPoint : dataPoints) {
InternalPointLocatorRT locator = dataPoint.getPointLocator();
ValueMonitor<?> m = Common.MONITORED_VALUES.getValueMonitor(locator.getPointLocatorVO().getMonitorId());
if (m != null) {
if (m instanceof IntegerMonitor)
dataPoint.updatePointValue(new PointValueTime((double) ((IntegerMonitor) m).getValue(), time));
else if (m instanceof LongMonitor)
dataPoint.updatePointValue(new PointValueTime((double) ((LongMonitor) m).getValue(), time));
else if (m instanceof DoubleMonitor)
dataPoint.updatePointValue(new PointValueTime((double) ((DoubleMonitor) m).getValue(), time));
else if (m instanceof AtomicIntegerMonitor)
dataPoint.updatePointValue(new PointValueTime((double) ((AtomicIntegerMonitor) m).getValue(), time));
}
}
}
Aggregations