use of org.csstudio.simplepv.BasicDataType in project yamcs-studio by yamcs.
the class ArrayEditPart method registerLoadPVDataTypeListener.
private void registerLoadPVDataTypeListener() {
if (getExecutionMode() == ExecutionMode.RUN_MODE) {
final ArrayModel model = getWidgetModel();
IPV pv = getPV();
if (pv != null) {
if (pvDataTypeListener == null)
pvDataTypeListener = new IPVListener.Stub() {
@Override
public void valueChanged(IPV pv) {
VType value = pv.getValue();
if (value != null) {
model.setArrayLength(VTypeHelper.getSize(value));
BasicDataType dataType = VTypeHelper.getBasicDataType(value);
model.setPropertyValue(ArrayModel.PROP_DATA_TYPE, mapBasicDataTypeToArrayType(dataType));
}
}
};
pv.addListener(pvDataTypeListener);
}
}
}
Aggregations