Search in sources :

Example 16 with AbstractPointWrapper

use of com.serotonin.m2m2.rt.script.AbstractPointWrapper in project ma-core-public by MangoAutomation.

the class DataSourceQuery method getPointsForSource.

/**
 * Helper to extract points for a source
 */
private List<DataPointWrapper> getPointsForSource(DataSourceVO ds) {
    List<DataPointWrapper> points = new ArrayList<DataPointWrapper>();
    List<DataPointVO> dataPoints = DataPointDao.getInstance().getDataPoints(ds.getId());
    for (DataPointVO vo : dataPoints) {
        DataPointRT rt = Common.runtimeManager.getDataPoint(vo.getId());
        AbstractPointWrapper wrapper = null;
        if (rt != null)
            wrapper = service.wrapPoint(engine, rt, setter);
        points.add(new DataPointWrapper(vo, wrapper));
    }
    return points;
}
Also used : DataPointVO(com.serotonin.m2m2.vo.DataPointVO) DataPointRT(com.serotonin.m2m2.rt.dataImage.DataPointRT) ArrayList(java.util.ArrayList)

Aggregations

AbstractPointWrapper (com.serotonin.m2m2.rt.script.AbstractPointWrapper)8 DataPointRT (com.serotonin.m2m2.rt.dataImage.DataPointRT)7 DataPointVO (com.serotonin.m2m2.vo.DataPointVO)7 IDataPointValueSource (com.serotonin.m2m2.rt.dataImage.IDataPointValueSource)6 HashMap (java.util.HashMap)6 HashSet (java.util.HashSet)6 Bindings (javax.script.Bindings)6 SimpleBindings (javax.script.SimpleBindings)6 ArrayList (java.util.ArrayList)5 Map (java.util.Map)4 Set (java.util.Set)4 AlphanumericValue (com.serotonin.m2m2.rt.dataImage.types.AlphanumericValue)3 BinaryValue (com.serotonin.m2m2.rt.dataImage.types.BinaryValue)3 DataValue (com.serotonin.m2m2.rt.dataImage.types.DataValue)3 MultistateValue (com.serotonin.m2m2.rt.dataImage.types.MultistateValue)3 NumericValue (com.serotonin.m2m2.rt.dataImage.types.NumericValue)3 ConditionSortLimitWithTagKeys (com.infiniteautomation.mango.db.query.ConditionSortLimitWithTagKeys)2 ScriptUtility (com.infiniteautomation.mango.util.script.ScriptUtility)2 ShouldNeverHappenException (com.serotonin.ShouldNeverHappenException)2 TranslatableMessage (com.serotonin.m2m2.i18n.TranslatableMessage)2