Search in sources :

Example 1 with Monitorfloat

use of alma.ACS.Monitorfloat in project ACS by ACS-Community.

the class PropertySeqTest method testCreateMonitorFloat.

public void testCreateMonitorFloat() {
    // TODO do test with null callback ;)
    // TODO implement...
    CBfloatSeqImpl cb = new CBfloatSeqImpl();
    CBDescIn descIn = new CBDescIn(50000, 50000, 1208);
    Monitorfloat monitor = ROpropertyFloatSeq.create_monitor(cb._this(orb), descIn);
    try {
        // 10.5 sec
        Thread.sleep(10500);
    } catch (InterruptedException ie) {
    }
    synchronized (cb) {
        try {
            monitor.destroy();
            // wait for 3s
            cb.wait(3000);
        } catch (InterruptedException ie) {
        }
    }
// TODO test if done was called
}
Also used : CBDescIn(alma.ACS.CBDescIn) Monitorfloat(alma.ACS.Monitorfloat)

Example 2 with Monitorfloat

use of alma.ACS.Monitorfloat in project ACS by ACS-Community.

the class PropertyPrimTest method testOnChangeMonitorFloat.

public void testOnChangeMonitorFloat() {
    // TODO implement...
    CBfloatImpl cb = new CBfloatImpl();
    CBDescIn descIn = new CBDescIn(50000, 50000, 1208);
    Monitorfloat monitor = ROpropertyFloat.create_monitor(cb._this(orb), descIn);
    // disable on time trigger
    monitor.set_timer_trigger(0);
    try {
        // sleep for 5 sec
        Thread.sleep(3000);
    } catch (InterruptedException ie) {
    }
    // TODO monitors should not come
    // every change test
    monitor.set_value_trigger(0, true);
    // TODO change value here...
    // ups RO monitor ;)
    // !!! TMP - tested with backdoor via alarm_high_on()...
    ROpropertyFloat.alarm_high_on();
    try {
        Thread.sleep(3000);
    } catch (InterruptedException ie) {
    }
    // disable test
    monitor.set_value_trigger(0, false);
    ROpropertyFloat.alarm_high_on();
    try {
        Thread.sleep(3000);
    } catch (InterruptedException ie) {
    }
    monitor.set_value_trigger(0, true);
    ROpropertyFloat.alarm_high_on();
    try {
        Thread.sleep(3000);
    } catch (InterruptedException ie) {
    }
    System.out.println("------");
    // disable test
    monitor.suspend();
    ROpropertyFloat.alarm_high_on();
    try {
        Thread.sleep(3000);
    } catch (InterruptedException ie) {
    }
    // / ... this should revive it
    monitor.resume();
    System.out.println("------");
    ROpropertyFloat.alarm_high_on();
    try {
        Thread.sleep(3000);
    } catch (InterruptedException ie) {
    }
    synchronized (cb) {
        try {
            monitor.destroy();
            // wait for 3s
            cb.wait(3000);
        } catch (InterruptedException ie) {
        }
    }
// TODO test if done was called
}
Also used : CBDescIn(alma.ACS.CBDescIn) Monitorfloat(alma.ACS.Monitorfloat)

Example 3 with Monitorfloat

use of alma.ACS.Monitorfloat in project ACS by ACS-Community.

the class PropertyPrimTest method testCreateMonitorFloat.

public void testCreateMonitorFloat() {
    // TODO do test with null callback ;)
    // TODO implement...
    CBfloatImpl cb = new CBfloatImpl();
    CBDescIn descIn = new CBDescIn(50000, 50000, 1208);
    Monitorfloat monitor = ROpropertyFloat.create_monitor(cb._this(orb), descIn);
    try {
        // 10.5 sec
        Thread.sleep(10500);
    } catch (InterruptedException ie) {
    }
    synchronized (cb) {
        try {
            monitor.destroy();
            // wait for 3s
            cb.wait(3000);
        } catch (InterruptedException ie) {
        }
    }
// TODO test if done was called
}
Also used : CBDescIn(alma.ACS.CBDescIn) Monitorfloat(alma.ACS.Monitorfloat)

Example 4 with Monitorfloat

use of alma.ACS.Monitorfloat in project ACS by ACS-Community.

the class PropertySeqTest method testOnChangeMonitorFloat.

public void testOnChangeMonitorFloat() {
    // TODO implement...
    CBfloatSeqImpl cb = new CBfloatSeqImpl();
    CBDescIn descIn = new CBDescIn(50000, 50000, 1208);
    Monitorfloat monitor = ROpropertyFloatSeq.create_monitor(cb._this(orb), descIn);
    // disable on time trigger
    monitor.set_timer_trigger(0);
    try {
        // sleep for 5 sec
        Thread.sleep(3000);
    } catch (InterruptedException ie) {
    }
    // TODO monitors should not come
    // every change test
    monitor.set_value_trigger(0, true);
    // TODO change value here...
    // ups RO monitor ;)
    // !!! TMP - tested with backdoor via alarm_high_on()...
    ROpropertyFloatSeq.alarm_high_on();
    try {
        Thread.sleep(3000);
    } catch (InterruptedException ie) {
    }
    // disable test
    monitor.set_value_trigger(0, false);
    ROpropertyFloatSeq.alarm_high_on();
    try {
        Thread.sleep(3000);
    } catch (InterruptedException ie) {
    }
    monitor.set_value_trigger(0, true);
    ROpropertyFloatSeq.alarm_high_on();
    try {
        Thread.sleep(3000);
    } catch (InterruptedException ie) {
    }
    System.out.println("------");
    // disable test
    monitor.suspend();
    ROpropertyFloatSeq.alarm_high_on();
    try {
        Thread.sleep(3000);
    } catch (InterruptedException ie) {
    }
    // / ... this should revive it
    monitor.resume();
    System.out.println("------");
    ROpropertyFloatSeq.alarm_high_on();
    try {
        Thread.sleep(3000);
    } catch (InterruptedException ie) {
    }
    synchronized (cb) {
        try {
            monitor.destroy();
            // wait for 3s
            cb.wait(3000);
        } catch (InterruptedException ie) {
        }
    }
// TODO test if done was called
}
Also used : CBDescIn(alma.ACS.CBDescIn) Monitorfloat(alma.ACS.Monitorfloat)

Aggregations

CBDescIn (alma.ACS.CBDescIn)4 Monitorfloat (alma.ACS.Monitorfloat)4