Package fr.esrf.tangoatk.core

Examples of fr.esrf.tangoatk.core.INumberScalar


    // Number scalar listener
    // -------------------------------------------------------------
    @Override
    public void numberScalarChange(NumberScalarEvent evt) {

        INumberScalar tmpNumberScalar = evt.getNumberSource();
        if (m_scalarlistener != null) {
            m_scalarlistener.readNumberValueChange(evt.getValue());
            if (tmpNumberScalar != null) {
                m_scalarlistener.writeNumberValueChange(tmpNumberScalar
                        .getNumberScalarSetPointFromDevice());
            }
        }

        if (isEditable()) {
            return;
        }
        if (displayReadValue) {
            super.numberScalarChange(evt);
        }
        else {
            if (tmpNumberScalar == null) {
                return;
            }
            String tmpValue = getFormatString(tmpNumberScalar.getNumberScalarSetPointFromDevice(),
                    tmpNumberScalar.getFormat());
            if (getUnitVisible()) {
                setText(tmpValue + " " + tmpNumberScalar.getUnit());
            }
            else {
                setText(tmpValue);
            }
        }
View Full Code Here


        super.setText(newText);

        if (m_inputListener != null) {
            m_inputListener.stringValueChange(newText);
            try {
                INumberScalar tmpNumberScalar = getNumberModel();
                if (tmpNumberScalar != null) {
                    if (getUnitVisible()) {
                        String tmpUnit = tmpNumberScalar.getUnit();
                        newText = newText.replaceAll(tmpUnit, "");
                    }
                }
                m_inputListener.numberValueChange(Double.parseDouble(newText.trim()));
            }
View Full Code Here

      // -------------------------------------------------------------
      // Number scalar listener
      // -------------------------------------------------------------
      public void numberScalarChange(NumberScalarEvent evt) {
          INumberScalar tmpNumberScalar = evt.getNumberSource();
          if(tmpNumberScalar == null)
              return;
         
          if(displayReadValue)
              super.numberScalarChange(evt);
          else
          {
              String tmpValue = Double.toString(tmpNumberScalar.getNumberScalarSetPointFromDevice());
              if (getUnitVisible())
                  setText(tmpValue + " " + tmpNumberScalar.getUnit());
              else
                  setText(tmpValue);
          }
          if(m_scalarlistener != null)
          {
              m_scalarlistener.readNumberValueChange(evt.getValue());
              m_scalarlistener.writeNumberValueChange(tmpNumberScalar.getNumberScalarSetPointFromDevice());
          }
      }
View Full Code Here

    }
  
   
    public void numberScalarChange(NumberScalarEvent evt)
    {
        INumberScalar tmpNumberScalar = evt.getNumberSource();
        Double tmpDoubleValue = new Double(0);
        if(tmpNumberScalar == null)
            return;
        if(tmpNumberScalar.isWritable())
            tmpDoubleValue = new Double(tmpNumberScalar.getNumberScalarSetPointFromDevice() - evt.getValue());
       
        String tmpUnit = "";
       
        if(getUnitVisible())
            tmpUnit = tmpNumberScalar.getUnit();
       
        String format = tmpNumberScalar.getFormat();
        if (format.indexOf('%') == -1)
        {
            setText(tmpDoubleValue.toString() + " " + tmpUnit);
          return;
      }
View Full Code Here

  }

  @Override
  public void numberScalarChange(NumberScalarEvent arg0) {
    super.numberScalarChange(arg0);
    INumberScalar tmpNumberScalar = arg0.getNumberSource();
    if(m_scalarListener != null && tmpNumberScalar != null)
    {
      m_scalarListener.readNumberValueChange(arg0.getValue());
      if(tmpNumberScalar.isWritable()) {
        m_scalarListener.writeNumberValueChange(tmpNumberScalar.getNumberScalarSetPointFromDevice());
      }

    }
  }
View Full Code Here

    public void buildTrendList() {
        final double maxValue = getMaxValue();
        final double minValue = getMinValue();
        for (int i = 0; i < m_AttributeList.size(); i++) {
            final INumberScalar attribute = (INumberScalar) m_AttributeList.get(i);
            final Trend t = trendTable.get(attribute.getName().toLowerCase());
            t.setUnit(attribute.getUnit());
            t.setMinYScaleValue(minValue);
            t.setMaxYScaleValue(maxValue);
        }
    }
View Full Code Here

    }

    private double getMinValue() {
        double minValue = defaultMinValue;
        for (int i = 0; i < m_AttributeList.size(); i++) {
            final INumberScalar attribute = (INumberScalar) m_AttributeList.get(i);
            if (attribute.getMinValue() < minValue) {
                minValue = attribute.getMinValue();
            }
        }
        return minValue;
    }
View Full Code Here

    }

    private double getMaxValue() {
        double maxValue = defaultMaxValue;
        for (int i = 0; i < m_AttributeList.size(); i++) {
            final INumberScalar attribute = (INumberScalar) m_AttributeList.get(i);
            if (attribute.getMaxValue() > maxValue) {
                maxValue = attribute.getMaxValue();
            }
        }

        final double minvalue = getMinValue();
        if (maxValue == minvalue) {
View Full Code Here

    // Listen on valueChange and readSetpoint
    @Override
    public void numberScalarChange(NumberScalarEvent evt)
    {
        super.numberScalarChange(evt);
        INumberScalar tmpNumberScalar = evt.getNumberSource();
        if(m_listener != null && tmpNumberScalar != null)
        {
            m_listener.readNumberValueChange(evt.getValue());
            if(tmpNumberScalar.isWritable()) {
                m_listener.writeNumberValueChange(tmpNumberScalar.getNumberScalarSetPointFromDevice());
            }
        }
    }
View Full Code Here

   public void removeAttribute(String attributeName)
   {
     if (isAlreadyAdd(attributeName))
     {
       INumberScalar attribute = (INumberScalar)getModel().get(attributeName);
       super.removeAttribute(attribute);
     }
   }
View Full Code Here

TOP

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

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.