Search in sources :

Example 16 with CompletionHolder

use of alma.ACSErr.CompletionHolder in project ACS by ACS-Community.

the class RWCommonComparablePropertyImpl method incrementImpl.

/**
	 * Increment action implementation.
	 * @throws AcsJException	thown on any failure.
	 */
protected Completion incrementImpl() throws AcsJException {
    CompletionHolder completionHolder = CompletionUtil.createCompletionHolder();
    Object currentValue = getSync(completionHolder);
    // TODO completion error (type != 0) check
    // increment
    Object incrementedValue = sum(currentValue, minStep, false);
    return setSync(incrementedValue);
}
Also used : CompletionHolder(alma.ACSErr.CompletionHolder)

Example 17 with CompletionHolder

use of alma.ACSErr.CompletionHolder in project ACS by ACS-Community.

the class HistoryMonitorImpl method retrieveValueAndDispatch.

/**
	 * Retrieve property value via cached <code>mnemonicValue</code>
	 * and add response to the history buffer. 
	 * @see alma.ACS.CommonMonitor#retrieveValueAndDispatch(long, boolean)
	 */
protected void retrieveValueAndDispatch(long keyTime, boolean done) {
    // create new holder (done expeditiously)
    CompletionHolder completionHolder = CompletionUtil.createCompletionHolder();
    // retrieve value
    Object value = property.mnemonicValue(keyTime, completionHolder);
    // TODO check completion error state - what do to then?
    // add to history
    property.addValueToHistory(value, completionHolder.value.timeStamp);
}
Also used : CompletionHolder(alma.ACSErr.CompletionHolder)

Example 18 with CompletionHolder

use of alma.ACSErr.CompletionHolder in project ACS by ACS-Community.

the class EnumPropertyTest method testSetNonBlockingSync.

public void testSetNonBlockingSync() {
    RWproperty.set_nonblocking(States.SHUTDOWN);
    // check value
    CompletionHolder completionHolder = new CompletionHolder();
    States value = RWproperty.get_sync(completionHolder);
    assertEquals(States.SHUTDOWN, value);
}
Also used : RWStates(jbaciEnumPropTest.RWStates) ROStates(jbaciEnumPropTest.ROStates) States(jbaciEnumPropTest.States) CompletionHolder(alma.ACSErr.CompletionHolder)

Example 19 with CompletionHolder

use of alma.ACSErr.CompletionHolder in project ACS by ACS-Community.

the class PropertyDoubleTest method testSetAsync.

public void testSetAsync() {
    CBvoidImpl cb = new CBvoidImpl();
    CBDescIn descIn = new CBDescIn(50000, 50000, 1208);
    synchronized (cb) {
        RWproperty.set_async(500.0, cb._this(orb), descIn);
        try {
            // wait for 5s
            cb.wait(5000);
        } catch (InterruptedException ie) {
        }
    }
    // only 1 response is expected
    //assertEquals(1, cb.getResponseQueue().size());
    //CBResponse response = (CBResponse)cb.getResponseQueue().firstElement();
    // check reponse type
    //assertEquals(CBResponse.DONE_TYPE, response.type);
    // check value
    // TODO check value
    CompletionHolder completionHolder = new CompletionHolder();
    double value = RWproperty.get_sync(completionHolder);
    assertEquals(500.0, value, 0.0);
}
Also used : RWdouble(alma.ACS.RWdouble) ROdouble(alma.ACS.ROdouble) Monitordouble(alma.ACS.Monitordouble) CompletionHolder(alma.ACSErr.CompletionHolder) CBDescIn(alma.ACS.CBDescIn)

Example 20 with CompletionHolder

use of alma.ACSErr.CompletionHolder in project ACS by ACS-Community.

the class PropertyDoubleTest method testGetSync.

public void testGetSync() {
    CompletionHolder completionHolder = new CompletionHolder();
    // TODO check value
    /*double value =*/
    ROproperty.get_sync(completionHolder);
    //assertEquals(property.default_value(), value, 0.0);
    assertEquals(0, completionHolder.value.code);
    assertEquals(0, completionHolder.value.type);
    assertEquals(0, completionHolder.value.previousError.length);
    // less than 5s
    assertTrue((UTCUtility.utcJavaToOmg(System.currentTimeMillis()) - completionHolder.value.timeStamp) < 50000000);
}
Also used : CompletionHolder(alma.ACSErr.CompletionHolder)

Aggregations

CompletionHolder (alma.ACSErr.CompletionHolder)30 CBDescIn (alma.ACS.CBDescIn)11 RWdouble (alma.ACS.RWdouble)5 Monitordouble (alma.ACS.Monitordouble)4 ROdouble (alma.ACS.ROdouble)3 AcsJCompletion (alma.acs.exceptions.AcsJCompletion)3 AcsJException (alma.acs.exceptions.AcsJException)3 ROStates (jbaciEnumPropTest.ROStates)3 RWStates (jbaciEnumPropTest.RWStates)3 States (jbaciEnumPropTest.States)3 AcsJCouldntPerformActionEx (alma.ACSErrTypeCommon.wrappers.AcsJCouldntPerformActionEx)2 LampUnavailable (alma.demo.LampUnavailable)2 POAManager (org.omg.PortableServer.POAManager)2 ClientInfo (si.ijs.maci.ClientInfo)2 Manager (si.ijs.maci.Manager)2 CBdouble (alma.ACS.CBdouble)1 Monitor (alma.ACS.Monitor)1 MonitorstringSeq (alma.ACS.MonitorstringSeq)1 ROstring (alma.ACS.ROstring)1 ROstringSeq (alma.ACS.ROstringSeq)1