/** * Fill-in status and time to DBR. * @param timeDBR DBR to fill-in. */ protected void fillInStatusAndTime(TIME timeDBR) { // set status and severity timeDBR.setStatus(status); timeDBR.setSeverity(severity); // set timestamp timeDBR.setTimeStamp(timestamp); }
/** * Fill-in status and time to DBR. * @param timeDBR DBR to fill-in. */ protected void fillInStatusAndTime(TIME timeDBR) { // set status and severity timeDBR.setStatus(status); timeDBR.setSeverity(severity); // set timestamp timeDBR.setTimeStamp(timestamp); }
/** * 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; }
/** * 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; }
/** * Write value. * Copies given value to local memory (array). * If event interest flag <code>interest</code> is set, an event is fired to <code>eventCallback</code>. * @see gov.aps.jca.cas.ProcessVariable#write(gov.aps.jca.dbr.DBR, gov.aps.jca.cas.ProcessVariableWriteCallback) */ public synchronized CAStatus write(DBR value, ProcessVariableWriteCallback asyncWriteCallback) throws CAException { this.value = value.getValue(); this.count = java.lang.reflect.Array.getLength(this.value); this.timestamp = new TimeStamp(); // notify if (interest) { DBR monitorDBR = AbstractCASResponseHandler.createDBRforReading(this); fillInDBR(monitorDBR); ((TIME)monitorDBR).setTimeStamp(timestamp); System.arraycopy(this.value, 0, monitorDBR.getValue(), 0, count); eventCallback.postEvent(Monitor.VALUE|Monitor.LOG, monitorDBR); } return CAStatus.NORMAL; }
/** * Write value. * Copies given value to local memory (array). * If event interest flag <code>interest</code> is set, an event is fired to <code>eventCallback</code>. * @see gov.aps.jca.cas.ProcessVariable#write(gov.aps.jca.dbr.DBR, gov.aps.jca.cas.ProcessVariableWriteCallback) */ public synchronized CAStatus write(DBR value, ProcessVariableWriteCallback asyncWriteCallback) throws CAException { this.value = value.getValue(); this.count = java.lang.reflect.Array.getLength(this.value); this.timestamp = new TimeStamp(); // notify if (interest) { DBR monitorDBR = AbstractCASResponseHandler.createDBRforReading(this); fillInDBR(monitorDBR); ((TIME)monitorDBR).setTimeStamp(timestamp); System.arraycopy(this.value, 0, monitorDBR.getValue(), 0, count); eventCallback.postEvent(Monitor.VALUE|Monitor.LOG, monitorDBR); } return CAStatus.NORMAL; }
retVal.setTimeStamp(new TimeStamp(secPastEpoch, nsec));
retVal.setTimeStamp(new TimeStamp(secPastEpoch, nsec));