Examples of DeviceAttribute


Examples of fr.esrf.TangoApi.DeviceAttribute

    URL url = field("location").ofType(URL.class).in(btn.getIcon()).get();
    assertThat(url.getPath()).endsWith("ledGreen.gif");

    // change attr value on device and check bean is correctly updated
    m_deviceProxy.write_attribute(new DeviceAttribute(attribute, false));
    Sleeper.SECONDS.sleep(2);

    url = field("location").ofType(URL.class).in(btn.getIcon()).get();
    assertThat(url.getPath()).endsWith("ledRed.gif");
View Full Code Here

Examples of fr.esrf.TangoApi.DeviceAttribute

    final JButton bt = (JButton) tth.findFirstComponent(JButton.class, jf1);

    toolTiptest(m_deviceName + "/" + attr, bt);

    // change attr value
    m_deviceProxy.write_attribute(new DeviceAttribute(attr, false));
    Sleeper.SECONDS.sleep(2);
    toolTiptest(m_deviceName + "/" + attr, bt);

    // change deviceName
    widget.setDeviceName(m_deviceName2);
View Full Code Here

Examples of fr.esrf.TangoApi.DeviceAttribute

    Sleeper.SECONDS.sleep(3);
    final JButton jb = (JButton) tth.findFirstComponent(JButton.class, jf1);
    toolTiptest(defaultToolTip ? toolTipByDefault : customToolTip, jb);

    // change attr value
    m_deviceProxy.write_attribute(new DeviceAttribute(attr, false));
    Sleeper.SECONDS.sleep(2);
    toolTiptest(defaultToolTip ? toolTipByDefault : customToolTip, jb);

    // change deviceName
    widget.setDeviceName(m_deviceName2);
View Full Code Here

Examples of fr.esrf.TangoApi.DeviceAttribute

    final BooleanAttributeListenerImpl listenerTest = new BooleanAttributeListenerImpl();
    widget.addBooleanAttributeListener(listenerTest);

    deviceValue = !deviceValue;
    m_deviceProxy.write_attribute(new DeviceAttribute(attribute,
        deviceValue));

    Sleeper.SECONDS.sleep(3);

    // Test listener is notify only one time (per methods)
    // FIXME: when widget will be upgraded to cometeV2
    assertThat(listenerTest.getNotifyCount()).isEqualTo(3);

    assertThat(
        (Boolean) listenerTest
            .getNotification("readBooleanValueChange")).isEqualTo(
        deviceValue);
    assertThat(
        (Boolean) listenerTest
            .getNotification("writeBooleanValueChange")).isEqualTo(
        deviceValue);
    assertThat((String) listenerTest.getNotification("stateChange"))
        .isEqualTo("VALID");

    // check it's updated

    deviceValue = !deviceValue;
    m_deviceProxy.write_attribute(new DeviceAttribute(attribute,
        deviceValue));

    Sleeper.SECONDS.sleep(3);

    assertThat(
View Full Code Here

Examples of fr.esrf.TangoApi.DeviceAttribute

    jf1.remove(widget);

    // change the value on device to be sure the default value of bean is
    // not the same than attribute.
    deviceValue = !deviceValue;
    m_deviceProxy.write_attribute(new DeviceAttribute(attribute,
        deviceValue));
    widget = new AttributeBooleanCheckBoxCometeV2.Builder(m_deviceName,
        attribute).jframe(jf1).build();
    Sleeper.SECONDS.sleep(3);
    assertTrue("checkbox has not the same value than device",
View Full Code Here

Examples of fr.esrf.TangoApi.DeviceAttribute

  private void inputListenerTest() throws DevFailed {
    final String attribute = "boolean_scalar_rw";
    jf1 = new JFrame();
    initDevice();

    m_deviceProxy.write_attribute(new DeviceAttribute(attribute, false));

    final AttributeBooleanCheckBoxCometeV2 widget = new AttributeBooleanCheckBoxCometeV2.Builder(
        m_deviceName, attribute).jframe(jf1).build();
    Sleeper.SECONDS.sleep(3);
View Full Code Here

Examples of fr.esrf.TangoApi.DeviceAttribute

  public void start() {
    // Read attribute
    AttributeProxy proxy;
    try {
      proxy = new AttributeProxy(this.getParamText(ATTRIBUTE_NAME));
      DeviceAttribute attr = proxy.read();
     
      System.out.println("\n\n\n"+attr.getNbRead()+"\n\n\n");
      for (int i = 0; i < attr.getNbRead(); i++) {
       
      }
     
      sendMultiple("read", 0);
      send("read", AttributeHelper.extractToStringArray(attr));
     
      String stype = getParamText(TYPE);
      String format = getParamText(FORMAT);
      if(format.equals("SCALAR") && stype != null && !stype.equals("")){
        int type = toType(stype);
     
        if(type == 1) { //Boolean
          for (int i = 0; i < attr.getNbRead(); i++) {
            sendMultiple("read",attr.extractBooleanArray()[i],i);
            send("size",attr.getNbRead());
            }
        }else if (type>=2 && type<=7){ //Number
          for (int i = 0; i < attr.getNbRead(); i++) {
            sendMultiple("read",attr.extractDoubleArray()[i],i);
            }
        }else if (type==8){ //String
          for (int i = 0; i < attr.getNbRead(); i++) {
            sendMultiple("read",attr.extractStringArray()[i],i);
            }
        }
        /*******************************/
        if(type == 1) { //Boolean
          System.out.println("\n\n\nstart--Boolean------\n\n\n");
          for (int i = 0; i < attr.getNbRead(); i++) {
            sendMultiple("read",attr.extractBooleanArray()[i],i);
            }
        }if(type == 2) { //Short
          System.out.println("\n\n\nstart--Boolean------\n\n\n");
          for (int i = 0; i < attr.getNbRead(); i++) {
            sendMultiple("read",attr.extractShortArray()[i],i);
            }
        }if(type == 3) { //Float
          System.out.println("\n\n\nstart--Boolean------\n\n\n");
          for (int i = 0; i < attr.getNbRead(); i++) {
            sendMultiple("read",attr.extractFloatArray()[i],i);
            }
        }if(type == 4) { //Double
          System.out.println("\n\n\nstart--Boolean------\n\n\n");
          for (int i = 0; i < attr.getNbRead(); i++) {
            sendMultiple("read",attr.extractDoubleArray()[i],i);
            }
        }if(type == 5) { //Long
          System.out.println("\n\n\nstart--Boolean------\n\n\n");
          for (int i = 0; i < attr.getNbRead(); i++) {
            sendMultiple("read",attr.extractLongArray()[i],i);
            }
        }if(type == 6) { //Long64
          System.out.println("\n\n\nstart--Boolean------\n\n\n");
          for (int i = 0; i < attr.getNbRead(); i++) {
            sendMultiple("read",attr.extractLong64Array()[i],i);
            }
        }if(type == 7) { //ULong
          System.out.println("\n\n\nstart--Boolean------\n\n\n");
          for (int i = 0; i < attr.getNbRead(); i++) {
            sendMultiple("read",attr.extractULongArray()[i],i);
            }
        }
       
      }else{
        for (int i = 0; i < attr.getNbRead(); i++) {
          sendMultiple("read",attr.extractLongArray()[i],i);
          }
      }
     
    } catch (DevFailed e) {
      e.printStackTrace();
View Full Code Here

Examples of fr.esrf.TangoApi.DeviceAttribute

    private void writeData() {
        DeviceProxy proxy = TangoDeviceHelper.getDeviceProxy(DEVICE);

        if (proxy != null) {
            try {
                DeviceAttribute deviceAttribute = proxy.read_attribute("double_spectrum");
                double[] value1 = new double[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
                deviceAttribute.insert(value1);
                proxy.write_attribute(deviceAttribute);

                deviceAttribute = proxy.read_attribute("float_spectrum");
                float[] value2 = new float[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
                deviceAttribute.insert(value2);
                proxy.write_attribute(deviceAttribute);

                deviceAttribute = proxy.read_attribute("long_spectrum");
                int[] value3 = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
                deviceAttribute.insert(value3);
                proxy.write_attribute(deviceAttribute);

                deviceAttribute = proxy.read_attribute("double_image");
                double[] value4 = new double[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 };
                deviceAttribute.insert(value4, 10, 2);
                proxy.write_attribute(deviceAttribute);

            } catch (DevFailed e) {
                e.printStackTrace();
            }
View Full Code Here

Examples of fr.esrf.TangoApi.DeviceAttribute

    assertTrue((upButtons.size() == 8) & (downButtons.size() == 8));

    // v�rifier que la valeur courante de l'attribut est bien affich�e
    double value = 1234.567;
    m_deviceProxy
        .write_attribute(new DeviceAttribute(attributeName, value));
    String format = "%7.3f";
    assertTrue(waitLabelText(label, formatValue(value, format), 5000));

    tth.click(upButtons.get(7));
    value = 1234.568;
    assertTrue(waitAttributeValue(m_deviceProxy, attributeName, value, 5000));

    tth.click(downButtons.get(6));
    value = 1234.558;
    assertTrue(waitAttributeValue(m_deviceProxy, attributeName, value, 5000));

    tth.click(upButtons.get(5));
    value = 1234.658;
    assertTrue(waitAttributeValue(m_deviceProxy, attributeName, value, 5000));

    tth.click(downButtons.get(4));
    value = 1233.658;
    assertTrue(waitAttributeValue(m_deviceProxy, attributeName, value, 5000));

    // v�rifier les boutons de signe
    tth.click(upButtons.get(0));
    value = -1233.658;
    assertTrue(waitAttributeValue(m_deviceProxy, attributeName, value, 5000));
    tth.click(downButtons.get(0));
    value = 1233.658;
    assertTrue(waitAttributeValue(m_deviceProxy, attributeName, value, 5000));

    // v�rifier que le nombre de boutons s'adapte en cas de d�passement du
    // format
    value = 12345.678;
    m_deviceProxy
        .write_attribute(new DeviceAttribute(attributeName, value));
    Sleeper.SECONDS.sleep(1);
    // label = getLabel(jf);
    format = "%8.3f";
    assertTrue(waitLabelText(label, formatValue(value, format), 5000));
    getButtons(jf1, upButtons, downButtons);
    assertTrue((upButtons.size() == 9) & (downButtons.size() == 9));

    // v�rifier l'entr�e des chiffres au clavier
    // tth.click(label);
    // tth.simulateInput('1');
    // tth.simulateInput('3');
    // tth.simulateInput('2');
    // tth.simulateInput('4');
    // tth.simulateInput('.');
    // tth.simulateInput('7');
    // tth.simulateInput('6');
    // tth.simulateEnter();

    final KeyListener keyListener = ((WheelSwitch) tth.findFirstComponent(
        WheelSwitch.class, widget)).getKeyListeners()[0];

    tth.click(label);
    tth.sendEventsToKeyListener(keyListener, widget, "1324.76");
    tth.sendEnterToKeyListener(keyListener, widget, true);

    // to be "sure" the confirmation dialog has the necessary time to appear
    Sleeper.SECONDS.sleep(1);

    value = 1324.76;
    assertTrue("write failed, bean has not the same value as device",
        waitAttributeValue(m_deviceProxy, attributeName, value, 5000));

    // Faire varier le nom du device
    initSecondDevice();

    value = 1111.222;
    m_deviceProxy2
        .write_attribute(new DeviceAttribute(attributeName, value));

    widget.setDeviceName(m_deviceName2);
    Sleeper.SECONDS.sleep(1);

    assertTrue(waitLabelText(label, formatValue(value, format), 5000));
View Full Code Here

Examples of fr.esrf.TangoApi.DeviceAttribute

        && (downButtons.size() == 8));

    // v�rifier que la valeur courante de l'attribut est bien affich�e
    final double value = 1234.567;
    m_deviceProxy
        .write_attribute(new DeviceAttribute(attributeName, value));
    assertTrue(waitLabelText(label, formatValue(value, format), 5000));

    // tester la comfirmation sur l'utilisation des fl�ches
    tth.click(downButtons.get(6));
    final double newValue = 1234.557;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.