private String toStringDBR(DBR value) { StringBuilder builder = new StringBuilder(); if (value == null) { return "null"; } if (value.getValue() instanceof double[]) { builder.append(Arrays.toString((double[]) value.getValue())); } else if (value.getValue() instanceof short[]) { builder.append(Arrays.toString((short[]) value.getValue())); } else if (value.getValue() instanceof String[]) { builder.append(Arrays.toString((String[]) value.getValue())); } else { builder.append(value.getValue().toString()); } return builder.toString(); }
/** * Read value. * Fills-in DBR, sets timestamp (time when value was written) and copies value from local memory (array). * No status and severity (alarms) are set - to be done in <code>fillInDBR</code> method (extending it). * @see gov.aps.jca.cas.ProcessVariable#read(gov.aps.jca.dbr.DBR, gov.aps.jca.cas.ProcessVariableReadCallback) */ public synchronized CAStatus read(DBR value, ProcessVariableReadCallback asyncReadCallback) throws CAException { // fill fillInDBR(value); // given DBR is always at least TIME ((TIME)value).setTimeStamp(timestamp); int minCount = Math.min(count, value.getCount()); System.arraycopy(this.value, 0, value.getValue(), 0, minCount); return CAStatus.NORMAL; }
value = value.convert(DBRType.forValue(dataType)); } catch (CAStatusException cse) { eventAddFailureResponse(transport, dataType, dataCount, sid, ioid, cse.getStatus(), value);
if (value.isGR()) { if (value.isCTRL()) { if (value.isPRECSION()) { if (value.isLABELS()) {
String units = null; bitSet.clear(); DBRType requestDBRType = fromDBR.getType(); if(nativeDBRType.isENUM()) { int index = pvEnumerated.getIndex();
/** * Set data (units, limits, ...) to DBR. * GR and CTRL data is filled only if <code>isCTRLSupported</code> returns <code>true</code>. * @param value DBR to fill-in. */ public void fillInDBR(DBR value) { if (value.isGR()) { // fill GR GR gr = (GR)value; gr.setUnits(getUnits()); gr.setUpperDispLimit(getUpperDispLimit()); gr.setLowerDispLimit(getLowerDispLimit()); gr.setUpperAlarmLimit(getUpperAlarmLimit()); gr.setUpperWarningLimit(getUpperWarningLimit()); gr.setLowerWarningLimit(getLowerWarningLimit()); gr.setLowerAlarmLimit(getLowerAlarmLimit()); } if (value.isCTRL()) { // fill-up GR to CTRL CTRL ctrl = (CTRL)value; ctrl.setUpperCtrlLimit(getUpperCtrlLimit()); ctrl.setLowerCtrlLimit(getLowerCtrlLimit()); } }
/** * Set data (units, limits, ...) and precision to DBR. * @param value DBR to fill-in. */ public void fillInDBR(DBR value) { super.fillInDBR(value); if (value.isPRECSION()) { // fill PRECISION PRECISION precision = (PRECISION)value; precision.setPrecision(getPrecision()); } } }
value = value.convert(DBRType.forValue(dataType)); } catch (CAStatusException cse) { eventAddFailureResponse(transport, dataType, dataCount, sid, ioid, cse.getStatus(), value);
if (value.isGR()) { if (value.isCTRL()) { if (value.isPRECSION()) { if (value.isLABELS()) {
/** * Set data (units, limits, ...) to DBR. * GR and CTRL data is filled only if <code>isCTRLSupported</code> returns <code>true</code>. * @param value DBR to fill-in. */ public void fillInDBR(DBR value) { if (value.isGR()) { // fill GR GR gr = (GR)value; gr.setUnits(getUnits()); gr.setUpperDispLimit(getUpperDispLimit()); gr.setLowerDispLimit(getLowerDispLimit()); gr.setUpperAlarmLimit(getUpperAlarmLimit()); gr.setUpperWarningLimit(getUpperWarningLimit()); gr.setLowerWarningLimit(getLowerWarningLimit()); gr.setLowerAlarmLimit(getLowerAlarmLimit()); } if (value.isCTRL()) { // fill-up GR to CTRL CTRL ctrl = (CTRL)value; ctrl.setUpperCtrlLimit(getUpperCtrlLimit()); ctrl.setLowerCtrlLimit(getLowerCtrlLimit()); } }
/** * Set data (units, limits, ...) and precision to DBR. * @param value DBR to fill-in. */ public void fillInDBR(DBR value) { super.fillInDBR(value); if (value.isPRECSION()) { // fill PRECISION PRECISION precision = (PRECISION)value; precision.setPrecision(getPrecision()); } } }
private String toStringDBR(DBR value) { StringBuilder builder = new StringBuilder(); if (value == null) { return "null"; } if (value.getValue() instanceof double[]) { builder.append(Arrays.toString((double[]) value.getValue())); } else if (value.getValue() instanceof short[]) { builder.append(Arrays.toString((short[]) value.getValue())); } else if (value.getValue() instanceof String[]) { builder.append(Arrays.toString((String[]) value.getValue())); } else { builder.append(value.getValue().toString()); } return builder.toString(); }
value = value.convert(DBRType.forValue(dataType)); } catch (CAStatusException cse) { readNotifyFailureResponse(transport, dataType, dataCount, sid, ioid, cse.getStatus());
/** * Read value. * Fills-in DBR, sets timestamp (time when value was written) and copies value from local memory (array). * No status and severity (alarms) are set - to be done in <code>fillInDBR</code> method (extending it). * @see gov.aps.jca.cas.ProcessVariable#read(gov.aps.jca.dbr.DBR, gov.aps.jca.cas.ProcessVariableReadCallback) */ public synchronized CAStatus read(DBR value, ProcessVariableReadCallback asyncReadCallback) throws CAException { // fill fillInDBR(value); // given DBR is always at least TIME ((TIME)value).setTimeStamp(timestamp); int minCount = Math.min(count, value.getCount()); System.arraycopy(this.value, 0, value.getValue(), 0, minCount); return CAStatus.NORMAL; }
if (value.isPRECSION()) ((PRECISION)value).setPrecision((short)-1);