use of com.serotonin.m2m2.virtual.rt.ChangeTypeRT in project ma-modules-public by infiniteautomation.
the class VirtualPointLocatorVO method createRuntime.
@Override
public PointLocatorRT<VirtualPointLocatorVO> createRuntime() {
ChangeTypeRT changeType = getChangeType().createRuntime();
String startValue = getChangeType().getStartValue();
DataValue startObject;
if (dataTypeId == DataTypes.BINARY)
startObject = BinaryValue.parseBinary(startValue);
else if (dataTypeId == DataTypes.MULTISTATE) {
try {
startObject = MultistateValue.parseMultistate(startValue);
} catch (NumberFormatException e) {
startObject = new MultistateValue(0);
}
} else if (dataTypeId == DataTypes.NUMERIC) {
try {
startObject = NumericValue.parseNumeric(startValue);
} catch (NumberFormatException e) {
startObject = new NumericValue(0);
}
} else {
if (startValue == null)
startObject = new AlphanumericValue("");
else
startObject = new AlphanumericValue(startValue);
}
return new VirtualPointLocatorRT(this, changeType, startObject, isSettable());
}
Aggregations