Package fr.soleil.comete.dao.tangodao

Examples of fr.soleil.comete.dao.tangodao.TangoDAOFactory


                generateAttributeKey(Initial.PARAMETERS_MODE_ATTRIBUTE));
        setWidgetModel(getInitialWidthEditor(), generateWriteAttributeKey(Initial.WIDTH_ATTRIBUTE));
        setWidgetModel(getInitialWidthViewer(), generateAttributeKey(Initial.WIDTH_ATTRIBUTE));

        // listen the type of function
        TangoDAOFactory DAOFactory = new TangoDAOFactory();
        AbstractDAO<String> fittingFunctionType = DAOFactory
                .createStringDAO(generateAttributeKey(Initial.FUNCTION_TYPE_ATTRIBUTE));

        if (fittingFunctionType != null) {
            fittingFunctionType.addDAOListener(this);
        }
View Full Code Here


        setWidgetModel(getXHighViewer(), generateAttributeKey(Characteristics.XHIGH_ATTRIBUTE));
        setWidgetModel(getXHighViewer(), generateAttributeKey(Characteristics.XHIGH_ATTRIBUTE));
        setWidgetModel(getXHighViewer(), generateAttributeKey(Characteristics.XHIGH_ATTRIBUTE));

        // listen the type of function
        TangoDAOFactory DAOFactory = new TangoDAOFactory();
        AbstractDAO<String> fittingFunctionType = DAOFactory
                .createStringDAO(generateAttributeKey(Characteristics.FUNCTION_TYPE_ATTRIBUTE));

        if (fittingFunctionType != null) {
            fittingFunctionType.addDAOListener(this);
        }
View Full Code Here

        }

        double position = 0;
        TangoKey positionKey = generateAttributeKey(this.deviceBundle
                .getString("UserMotorBean.attribut.position"));
        TangoDAOFactory factory = new TangoDAOFactory();
        AbstractDAO<Number> positionDAO = factory.createNumberDAO(positionKey);
        if (positionDAO != null && positionDAO.getData() != null) {
            position = positionDAO.getData().doubleValue();
            position -= getIncrementDoubleValue();
            positionDAO.setData(position);
        }
View Full Code Here

            double position = 0;

            TangoKey attrKey = generateAttributeKey(this.deviceBundle
                    .getString("UserMotorBean.attribut.position"));

            TangoDAOFactory DAOFactory = new TangoDAOFactory();
            AbstractDAO<Number> attrDAO = DAOFactory.createNumberDAO(attrKey);

            if (attrDAO != null && attrDAO.getData() != null) {
                position = attrDAO.getData().doubleValue();
            }

            double distance = Math.abs(this.targetValue - position);
            if (distance > 0.00001) {
                if (increment == 0) {
                    position = this.targetValue;
                }
                else if (this.targetValue != position) {
                    if (distance > increment) {
                        position += increment * Math.signum(this.targetValue - position);
                    }
                    else {
                        position = this.targetValue;
                    }
                }
            }

            attrDAO.setData(position);

        }
        else {

            double position = 0;
            TangoKey positionKey = generateAttributeKey(this.deviceBundle
                    .getString("UserMotorBean.attribut.position"));

            TangoDAOFactory daoFactory = new TangoDAOFactory();
            AbstractDAO<Number> positionDAO = daoFactory.createNumberDAO(positionKey);

            if (positionDAO != null && positionDAO.getData() != null) {

                position = positionDAO.getData().doubleValue();
                position += increment;
View Full Code Here

    void refreshGraphics(TangoKey valueKey, TangoKey timeKey, TangoKey modeKey,
            TangoKey maxTrendKey, TangoKey tickSpacingKey, String unit, String format) {
        refreshGUI(unit, format);

        // Retrieve attribute history
        TangoDAOFactory factory = new TangoDAOFactory();
        AbstractDAO<List<DataArray>> valueDAO = factory.createNumberDataArrayDAO(valueKey);
        AbstractDAO<List<DataArray>> timeDAO = factory.createNumberDataArrayDAO(timeKey);
        AbstractDAO<StringMatrix> modeDAO =  factory.createStringImageDAO(modeKey);

        AbstractDAO<Number> maxTrendDAO = factory.createNumberDAO(maxTrendKey);
        AbstractDAO<Number> tickSpacingDAO = factory.createNumberDAO(tickSpacingKey);

        if(maxTrendDAO != null && tickSpacingDAO != null){
            setScale(maxTrendDAO.getData().doubleValue(), tickSpacingDAO.getData().doubleValue());
        }
View Full Code Here

      TangoKey timeKey = generateAttributeKey(CurrentTimeTrendUser.TIME_ATTRIBUTE);
      TangoKey modeKey = generateAttributeKey(CurrentTimeTrendUser.FUNC_MODE_SPECTRUM_ATTRIBUTE);
      TangoKey maxTrendKey = generateAttributeKey(CurrentTimeTrendUser.MAXTREND_ATTRIBUTE);
      TangoKey tickSpacingKey = generateAttributeKey(CurrentTimeTrendUser.TICKSPACING_ATTRIBUTE);
     
      TangoDAOFactory DAOFactory = new TangoDAOFactory();
     
      // UNIT
      TangoKey unitKey = generateAttributePropertyKey(SPECTRUM_ATTRIBUTE, AttributePropertyType.UNIT);
      AbstractDAO<String> unitDAO =  DAOFactory.createStringDAO(unitKey);
     
      String unit = "";
      if(unitDAO != null) {
        unit = unitDAO.getData();
      }
     
      // FORMAT
      TangoKey formatKey = generateAttributePropertyKey(SPECTRUM_ATTRIBUTE, AttributePropertyType.FORMAT);
      AbstractDAO<String> formatDAO =  DAOFactory.createStringDAO(formatKey);
     
      String format = "";
      if(formatDAO != null) {
        format = formatDAO.getData();
     
View Full Code Here

   *
   * @see fr.soleil.comete.bean.AbstractTangoBean#refreshGUI()
   */
  @Override
  protected void refreshGUI() {
    TangoDAOFactory DAOFactory = new TangoDAOFactory();

    // CURRENT
    setWidgetModel( this.builder.getCurrentViewer(), generateAttributeKey("current"));

    // CURRENT TIME TREND
    TangoKey valueKey = generateAttributeKey(SPECTRUM_ATTRIBUTE);
    TangoKey timeKey = generateAttributeKey(TIME_ATTRIBUTE);
    TangoKey modeKey = generateAttributeKey(FUNC_MODE_SPECTRUM_ATTRIBUTE);
    TangoKey maxTrendKey = generateAttributeKey(MAXTREND_ATTRIBUTE);
    TangoKey tickSpacingKey = generateAttributeKey(TICKSPACING_ATTRIBUTE);

    // UNIT
    TangoKey unitKey = generateAttributePropertyKey(SPECTRUM_ATTRIBUTE, AttributePropertyType.UNIT);
    AbstractDAO<String> unitDAO =  DAOFactory.createStringDAO(unitKey);

    String unit = "";
    if(unitDAO != null) {
      unit = unitDAO.getData();
    }

    // FORMAT
    TangoKey formatKey = generateAttributePropertyKey(SPECTRUM_ATTRIBUTE, AttributePropertyType.FORMAT);
    AbstractDAO<String> formatDAO =  DAOFactory.createStringDAO(formatKey);

    String format = "";
    if(formatDAO != null) {
      format = formatDAO.getData();
    }
    // CURRENT TIME TREND
    this.builder.getTimeScanDeviceViewer().refreshGraphics(
        valueKey, timeKey, modeKey, maxTrendKey, tickSpacingKey, unit, format);

    // CURRENT TOTAL
    setWidgetModel(this.builder.getCurrentTotalScalarViewer(), generateAttributeKey("currentTotal"));

    // HEMITTANCE
    setWidgetModel(this.builder.getHEmittanceViewer(), generateAttributeKey("hEmittance"));

    // VEMITTANCE
    setWidgetModel(this.builder.getVEmittanceViewer(), generateAttributeKey("vEmittance"));

    // HRMS ORBIT
    setWidgetModel(this.builder.getHOrbitRMSViewer(), generateAttributeKey("hRMSOrbit"));

    // VRMS ORBIT
    setWidgetModel(this.builder.getVOrbitRMSViewer(), generateAttributeKey("vRMSOrbit"));

    // H PEAK ORBIT
    setWidgetModel(this.builder.getHOrbitPeakViewer(), generateAttributeKey("hPeakOrbit"));

    // V PEAK ORBIT
    setWidgetModel(this.builder.getVOrbitPeakViewer(), generateAttributeKey("vPeakOrbit"));

    // H TUNES
    setWidgetModel(this.builder.getHTunesViewer(), generateAttributeKey("hTunes"));

    // V TUNES
    setWidgetModel(this.builder.getVTunesViewer(), generateAttributeKey("vTunes"));

    // AVERAGE PRESSURE
    setWidgetModel(this.builder.getAveragePressureViewer(), generateAttributeKey("averagePressure"));

    // LIFE TIME
    setWidgetModel(this.builder.getLifetimeViewer(), generateAttributeKey("lifeTime"));

    // USER INFO
    setWidgetModel(this.builder.getUserInfoViewer(), generateAttributeKey("userInfo"));

    // END OF CURRENT FUNCTION MODE
    setWidgetModel(this.builder.getCountDownViewer(), generateAttributeKey("endOfCurrentFunctionMode"));

    // NEXT USER BEAM
    setWidgetModel(this.builder.getNextUserBeamDateViewer(), generateAttributeKey("nextUserBeam"));

    // FUNCTION MODE
    setWidgetModel(this.builder.getFunctionModeViewer(), generateAttributeKey("functionMode"));

    // FILLING MODE
    setWidgetModel(this.builder.getModeViewer(), generateAttributeKey("fillingMode"));

    // MESSAGE
    setWidgetModel(this.builder.getMessageScalarViewer(), generateAttributeKey("message"));

    // MESSAGE DAO
    this.message = DAOFactory.createStringDAO(generateAttributeKey("message"));

    // USABLE SINCE
    setWidgetModel(this.builder.getLhDateViewer(), generateAttributeKey("usableSince"));

    // STATE
    setWidgetModel(this.builder.getStatusViewer(), generateAttributeKey("State"));

    // Id & Bendings
    // TODO YLE: pas d equivalent comete
    //this.builder.getStateOfBendingsViewer().setColors(stateColors);
    //this.builder.getStateOfIDsViewer().setColors(stateColors);

    String[] values = null;

    // BugFix : Get the names of beamlines from RCL (FacadeDevice can't show proxy properties
    // #??? From A.Buteau
    // VH
    double version = Double.parseDouble(this.getVersion());
    if(version >= 2.1){
      // Only compatible with this version which implements
      // 2 new attributes
      values = getStringArrayFromAttribute("nameOfBendings");
    }else{
      values = getStringArrayFromProperty("TDLProxies");
      for (int i = 0; i < values.length; i++) {
        values[i] = values[i].split( ":" )[0];
      }
    }

    // Fill texts with beamlines' names
    String[][] texts = new String[values.length][stateColors.length];
    for (int i = 0; i < values.length; i++) {
      Arrays.fill(texts[i], values[i]);
    }

    // TODO : equivalent comete a developper
    //this.builder.getStateOfBendingsViewer().setTexts( texts );
    ((JComponent)this.builder.getStateOfBendingsViewer().getComponent()).setFont( this.getTdlFont() );

    // Get names of Beamlines on Insertion
    if(version >= 2.1){
      // Only compatible with this version which implements
      // 2 new attributes
      values = getStringArrayFromAttribute("nameOfIDs");
    }else{
      values = getStringArrayFromProperty("InsertionProxies");
      for (int i = 0; i < values.length; i++) {
        values[i] = values[i].split( ":" )[0];
      }
    }

    texts = new String[values.length][stateColors.length];
    for (int i = 0; i < values.length; i++) {
      Arrays.fill(texts[i], values[i]);
    }

    // STATE OF IDS
    setWidgetModel(this.builder.getStateOfIDsViewer(), generateAttributeKey("stateOfIDs"));
    ((JComponent)this.builder.getStateOfIDsViewer().getComponent()).setFont( this.getTdlFont() );
    this.builder.getStateOfIDsViewer().setHorizontalAlignment( JLabel.CENTER );
    // TODO : equivalent comete a developper
    //this.builder.getStateOfIDsViewer().setTexts( texts );
    //this.builder.getStateOfIDsViewer().setColumns(3);


    // STATE OF BENDINGS
    setWidgetModel(this.builder.getStateOfBendingsViewer(), generateAttributeKey("stateOfBendings"));
    this.builder.getStateOfBendingsViewer().setHorizontalAlignment( JLabel.CENTER );
    // TODO : equivalent comete a developper
    //this.builder.getStateOfBendingsViewer().setColumns(1);

    if ( !USER_MODE.equals(this.INTERFACE_MODE) ) {
      ((JComponent)this.builder.getMessageScalarViewer().getComponent()).addMouseListener( new MouseAdapter() {
        /*
         * (non-Javadoc)
         *
         * @see java.awt.event.MouseAdapter#mousePressed(java.awt.event.MouseEvent)
         */
        @Override
        public void mousePressed (MouseEvent arg0) {
          String message = (String)JOptionPane.showInputDialog(
              MachineStatus.this,
              "Enter a new Run message",
              "Change Run message",
              JOptionPane.QUESTION_MESSAGE,
              null,
              null,
              MachineStatus.this.builder.getMessageScalarViewer().getText()
          );
          if ( message != null ) {
            MachineStatus.this.message.setData(message);
          }
        }
      } );

      ((JComponent)this.builder.getStringSpectrumScrolledViewer().getComponent()).addMouseListener(
          new MouseAdapter() {
            @Override
            public void mousePressed (MouseEvent arg0) {
              String message = (String) JOptionPane
              .showInputDialog(
                  MachineStatus.this,
                  "Enter a new operator message",
                  "Change operator message",
                  JOptionPane.QUESTION_MESSAGE,
                  null,
                  null,
                  MachineStatus.this.builder.getStringSpectrumScrolledViewer()
                  .getText()
              );
              if ( message != null
                  && MachineStatus.this.operatorMessageString != null ) {
                MachineStatus.this.operatorMessageString.setData(message);
              }
            }
          }
      );

    }

    // OPERATOR MESSAGE DAO
    this.operatorMessageString = DAOFactory.createStringDAO(generateAttributeKey("operatorMessage"));

    // TODO YLE :le textField peut il etre lie a une liste de String?
    setWidgetModel(this.builder.getStringSpectrumScrolledViewer(), generateAttributeKey("operatorMessageHistory"));

  }
View Full Code Here

   * @param attributeName : nom de l attribut
   * @return valeurs de l attribut
   */
  protected String[] getStringArrayFromAttribute(String attributeName) {

    TangoDAOFactory factory = new TangoDAOFactory();

    AbstractDAO<StringMatrix> DAO = factory.createStringImageDAO( generateAttributeKey(attributeName));

    String[] values = null;
    if(DAO != null) {
      values = DAO.getData().getFlatValues();
    }
View Full Code Here

        }

        double position = 0;
        TangoKey positionKey = generateWriteAttributeKey(this.deviceBundle
                .getString("UserMotorBean.attribut.position"));
        TangoDAOFactory factory = new TangoDAOFactory();
        AbstractDAO<Number> positionDAO = factory.createNumberDAO(positionKey);
        if (positionDAO != null && positionDAO.getData() != null) {
            position = positionDAO.getData().doubleValue();
            position -= this.increment;
            positionDAO.setData(position);
        }
View Full Code Here

            double position = 0;
            TangoKey attrKey = generateAttributeKey(this.deviceBundle
                    .getString("UserMotorBean.attribut.position"));

            TangoDAOFactory DAOFactory = new TangoDAOFactory();
            AbstractDAO<Number> attrDAO = DAOFactory.createNumberDAO(attrKey);

            if (attrDAO != null && attrDAO.getData() != null) {
                position = attrDAO.getData().doubleValue();
            }

            double distance = Math.abs(this.targetValue - position);
            if (distance > 0.00001) {
                if (this.increment == 0) {
                    position = this.targetValue;
                }
                else if (this.targetValue != position) {
                    if (distance > this.increment) {
                        position += this.increment * Math.signum(this.targetValue - position);
                    }
                    else {
                        position = this.targetValue;
                    }
                }
            }

            this.attr.insert(position);

        }
        else {

            double position = 0;
            TangoKey positionKey = generateAttributeKey(this.deviceBundle
                    .getString("UserMotorBean.attribut.position"));

            TangoDAOFactory daoFactory = new TangoDAOFactory();
            AbstractDAO<Number> positionDAO = daoFactory.createNumberDAO(positionKey);

            if (positionDAO != null && positionDAO.getData() != null) {

                position = positionDAO.getData().doubleValue();
                position += this.increment;
View Full Code Here

TOP

Related Classes of fr.soleil.comete.dao.tangodao.TangoDAOFactory

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.