Package fr.esrf.tangoatk.core

Examples of fr.esrf.tangoatk.core.IAttribute


                else
                    return false;
            }
        });
       
        IAttribute tmpIAttribute = null;
        int tmpInvalidAttribute = 0;
        Enumeration<IAttribute> tmpEnumeration = aattributeList.elements();
        while (tmpEnumeration.hasMoreElements())
        {
            tmpIAttribute = (IAttribute) tmpEnumeration.nextElement();
            for (int i = 0; i < attributeNameList.length; i++)
            {
                if(tmpIAttribute.getName().equalsIgnoreCase(attributeNameList[i].trim()))
                {
                    tmpAttributePolledList.add(tmpIAttribute);  
                    if(!(tmpIAttribute instanceof INumberScalar)
                      && !(tmpIAttribute instanceof IStringScalar)
                      && !(tmpIAttribute instanceof IBooleanScalar))
                    {
                        tmpInvalidAttribute++;
                        if(displayErrorOnFormat)
                            ConnectionErrorDialog.showMessageDialog(this, null, "\n" + tmpIAttribute.getName() + "is not a scalar");
                    }                  
                    break;
                }
            }
        }
       
        if(tmpAttributePolledList.size() + tmpInvalidAttribute + m_attributeKOList.size() == attributeNameList.length)       
        {
            BindingTango.removeConnectionListener(this);
            boolean isPossValue = attributePossibleValueList.length == attributeNameList.length;
            Enumeration<IAttribute> enumeration = aattributeList.elements();
            while(enumeration.hasMoreElements() && isPossValue)
            {
                IAttribute attribute = (IAttribute)enumeration.nextElement();
                int tmpIndex = getIndex(attribute.getName());
                if(tmpIndex != -1)
                {
                    if(attribute instanceof INumberScalar || attribute instanceof IStringScalar)
                    {
                            if(isPossValue)
View Full Code Here


            return;
        }
        // System.out.println("createAttribute =" + listener.hashCode());
        BindingTango.addConnectionListener(listener);

        IAttribute tmpAttribute = BindingTango.getAttribute(attributeName);
        if (tmpAttribute != null) {
            notifyAttributeIsConnected(tmpAttribute);
            return;
        }
        AttributeConnectionThread.addAttribute(attributeName);
View Full Code Here

        if (isSimuled(listener)) {
            return;
        }
        BindingTango.addConnectionListener(listener);
        if (m_AttributeList.containsKey(attributeName.toLowerCase())) {
            IAttribute attribute = m_AttributeList.get(attributeName.toLowerCase());
            notifyAttributeIsConnected(attribute);
            return;
        }
        AttributeConnectionThread.addAttribute(attributeName);
    }
View Full Code Here

            return;
        }
        try {
            Enumeration<?> enumerationAttribute = attributeList.elements();
            while (enumerationAttribute.hasMoreElements()) {
                IAttribute attribute = (IAttribute) enumerationAttribute.nextElement();
                BindingTango.addAttribute(attribute);
            }

            Enumeration<ConnectionListener> enumeration = connectionListener.elements();
            ConnectionListener listener = null;
View Full Code Here

   
   
   
    protected void addAttributes(DefaultMutableTreeNode top, AttributeList attributes) {
    NodeFactory nodeFactory = NodeFactory.getInstance();
  IAttribute attribute;
  DefaultMutableTreeNode node;
  for (int j = 0; j < attributes.size(); j++) {
      attribute = (IAttribute)attributes.get(j);
      node = new DefaultMutableTreeNode(nodeFactory.getNode4Entity(attribute));
      top.add(node);
View Full Code Here

  error(e);
    }

    if (al.size() > 0) {
    {
        IAttribute attribute = null;
        for(int j = 0; j < al.size() ; j++)
        {
            attribute = (IAttribute)al.get(j);
            if(attribute instanceof INumberScalar)
          {
                //System.out.println(attribute.getName() + " is a scalar ");
                try
                {
                    scalarList.add(attribute.getName());
                  }
                catch (ConnectionException e1) {}
          }
        }
       
View Full Code Here

    if (hasToolTip)
    {
      if (qualityInTooltip)
      { //set a ToolTip attributename + quality
        IAttribute attSource = (IAttribute)evt.getSource();
        setToolTipText(attSource.getName() + " : " + state);
      }
    }

    if(state.equals(IAttribute.INVALID)) {
      setText(error);
View Full Code Here

   *
   * @param b If True the attribute quality factor will be displayed inside the tooltip.
   */
  public void setQualityInTooltip(boolean b)
  {
    IAttribute    attModel = null;

    if (!hasToolTip)
    {
      qualityInTooltip = b;
      return;
    }

    if (qualityInTooltip != b)
    {
      if (stringModel != null)
      {
        attModel = stringModel;
      }
      else if (numberModel != null)
      {
        attModel = numberModel;
      }
      else if (booleanModel != null)
      {
        attModel = booleanModel;
      }

      if (b == false) {
        if (attModel != null) {
          setToolTipText(attModel.getName());
        }
      }
      qualityInTooltip=b;
    }
  }
View Full Code Here

    }
  }

  public void attributeListIsConnected(Vector<IAttribute>  aattributeList) {
    //System.out.println("notifyAttributeListIsConnected =" +  aattributeList.size());
    IAttribute tmpAttribute = null;
    String tmpAttributeName = null;
    Hashtable<String,IAttribute> tmpXY1AttributeList = new Hashtable<String,IAttribute>();
    Hashtable<String,IAttribute> tmpXY2AttributeList = new Hashtable<String,IAttribute>();
    Hashtable<String,IAttribute> tmpY1AttributeList = new Hashtable<String,IAttribute>();
    Hashtable<String,IAttribute> tmpY2AttributeList = new Hashtable<String,IAttribute>();
    Enumeration<IAttribute> tmpIAttributeEnumeration =aattributeList.elements();
    while (tmpIAttributeEnumeration.hasMoreElements()){
      tmpAttribute = tmpIAttributeEnumeration.nextElement();
      tmpAttributeName = tmpAttribute.getName();
      if(!(tmpAttribute instanceof INumberSpectrum)){
        ConnectionErrorDialog.showMessageDialog(this, new Exception("Attribute type error"), "\n"  + tmpAttributeName + "is not a Spectrum !" );
        return;
      }
      if(isXY1Attribute(tmpAttributeName)){
        tmpXY1AttributeList.put(tmpAttributeName.toLowerCase(),tmpAttribute);
      }
      if(isXY2Attribute(tmpAttributeName)){
        tmpXY2AttributeList.put(tmpAttributeName.toLowerCase(),tmpAttribute);
      }
      if(isY1Attribute(tmpAttributeName)){
        tmpY1AttributeList.put(tmpAttributeName.toLowerCase(),tmpAttribute);
      }
      if(isY2Attribute(tmpAttributeName)){
        tmpY2AttributeList.put(tmpAttributeName.toLowerCase(),tmpAttribute);
      }
    }

    if(!tmpY1AttributeList.isEmpty() && !tmpXY1AttributeList.isEmpty()) {
      BindingTango.removeConnectionListener(this);
    }
    else {
      return;
    }

    IAttribute tmpXAttribute = null;
    IAttribute tmpYAttribute = null;
    String  tmpXAttributeName = null;
    AttrDualSpectrum tmpAttributeDualSpectrum = null;
    //For Y1
    Enumeration<String> keys = tmpY1AttributeList.keys();
    while (keys.hasMoreElements()) {
      tmpAttributeName = keys.nextElement();
      tmpYAttribute = tmpY1AttributeList.get(tmpAttributeName);
      tmpXAttributeName = getXY1AttributeNameForY1(tmpAttributeName);
      if(tmpXAttributeName != null &&
          tmpXY1AttributeList.containsKey(tmpXAttributeName.toLowerCase())){
        tmpXAttribute = tmpXY1AttributeList.get(tmpXAttributeName.toLowerCase());
      }

      if(tmpYAttribute != null && tmpXAttribute != null){

        tmpAttributeDualSpectrum = new AttrDualSpectrum(tmpXAttribute.getDevice(),tmpXAttribute.getNameSansDevice(),tmpYAttribute.getDevice(),tmpYAttribute.getNameSansDevice());
        tmpAttributeDualSpectrum.setYUnit(getUnitY1ForY1(tmpAttributeName));
        tmpAttributeDualSpectrum.setYName(getAxisNameY1ForY1(tmpAttributeName));
        tmpAttributeDualSpectrum.setRefreshInterval(refreshingPeriod);
        m_DualList.add(tmpAttributeDualSpectrum);
        addModel(tmpAttributeDualSpectrum,NonAttrNumberSpectrumViewer.Y1_AXIS);
      }
    }

    //For Y2
    keys = tmpY2AttributeList.keys();
    while (keys.hasMoreElements()) {
      tmpAttributeName = keys.nextElement();
      tmpYAttribute = tmpY2AttributeList.get(tmpAttributeName);
      tmpXAttributeName = getXY2AttributeNameForY2(tmpAttributeName);
      if(tmpXAttributeName != null &&
          tmpXY2AttributeList.containsKey(tmpXAttributeName.toLowerCase())){
        tmpXAttribute = tmpXY2AttributeList.get(tmpXAttributeName.toLowerCase());
      }

      if(tmpYAttribute != null && tmpXAttribute != null){

        tmpAttributeDualSpectrum = new AttrDualSpectrum(tmpXAttribute.getDevice(),tmpXAttribute.getNameSansDevice(),tmpYAttribute.getDevice(),tmpYAttribute.getNameSansDevice());
        tmpAttributeDualSpectrum.setYUnit(getUnitY2ForY2(tmpAttributeName));
        tmpAttributeDualSpectrum.setYName(getAxisNameY2ForY2(tmpAttributeName));
        tmpAttributeDualSpectrum.setRefreshInterval(refreshingPeriod);
        m_DualList.add(tmpAttributeDualSpectrum);
        addModel(tmpAttributeDualSpectrum,NonAttrNumberSpectrumViewer.Y2_AXIS);
View Full Code Here

   {
       try
       {
            //Wait until all is loaded
            Vector<IAttribute> tmpAttributeList = new Vector<IAttribute>();
            IAttribute tmpAttribute= null;
            String tmpAttributeName = null;
            String tmpCheckedAttributeName = null;
            for (String element : attributeNameList) {
                tmpAttributeName = element.trim();
                tmpCheckedAttributeName = BindingTango.valideEntityFullName(tmpAttributeName);
View Full Code Here

TOP

Related Classes of fr.esrf.tangoatk.core.IAttribute

Copyright © 2018 www.massapicom. 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.