Package fr.soleil.data.service

Examples of fr.soleil.data.service.IDataSourceProducer


                        if (!isSimpleMotorBeanGUI) {
                            propertyValue = deviceBundle
                                    .getString("UserMotorBean.command.defineposition");
                            // - Define Position Command
                            tangoKey = generateCommandKey(propertyValue);
                            IDataSourceProducer producer = getProducer();
                            if (producer != null) {
                                boolean isCreatable = producer.isSourceCreatable(tangoKey);
                                // System.out.println("isCreatable=" + isCreatable);
                                if (isCreatable) {
                                    setWidgetModel(getDefinePositionViewer(), stringBox, tangoKey);
                                    getDefinePositionViewer().setText("<-|->");
                                }
                                getDefinePositionViewer().setVisible(isCreatable);
                            }
                        }

                        // SetModel for StateViewer
                        tangoKey = generateAttributeKey("State");
                        setStateModel();

                        propertyValue = deviceBundle.getString("UserMotorBean.command.backward");
                        tangoKey = generateCommandKey(propertyValue);

                        IDataSourceProducer producer = getProducer();
                        try {
                            if (producer != null) {
                                // Backward Command
                                backwardCmd = producer.createDataSource(tangoKey);
                            }
                        }
                        catch (Exception e) {
                            // TODO: handle exception
                        }

                        propertyValue = deviceBundle.getString("UserMotorBean.command.forward");
                        tangoKey = generateCommandKey(propertyValue);
                        producer = getProducer();
                        if (producer != null) {
                            try {
                                // Forward Command
                                forwardCmd = producer.createDataSource(tangoKey);
                            }
                            catch (Exception e) {
                                // TODO: handle exception
                            }
                        }
View Full Code Here


    }

    private void setScalarWidgetModel(IKey attributeKey) {
        setWidgetModel(readNumberField, stringBox, attributeKey);

        IDataSourceProducer producer = getProducer();
        if (producer != null) {
            boolean isSettable = producer.isSourceSettable(attributeKey);
            wheelswitch.setVisible(isSettable);
            if (isSettable) {
                attributeKey = generateWriteAttributeKey(attributeName);
                setWidgetModel(wheelswitch, numberScalarBox, attributeKey);
            }
View Full Code Here

        jButtonIncActionPerformed(evt);
    }

    @SuppressWarnings("unchecked")
    private AbstractDataSource<Number> getNumberSource(IKey key) {
        IDataSourceProducer producer = getProducer();
        AbstractDataSource<Number> dataSource = null;
        AbstractDataSource<?> src = null;
        try {
            src = producer.createDataSource(key);
            if ((src != null) && Number.class.equals(src.getDataType().getConcernedClass())) {
                dataSource = (AbstractDataSource<Number>) src;
            }
        }
        catch (Exception e) {
View Full Code Here

        }
    }

    private void setChartWidgetModel(IKey attributeKey) {
        setWidgetModel(chartViewer, chartBox, attributeKey);
        IDataSourceProducer producer = getProducer();
        if (producer != null) {
            boolean isSettable = producer.isSourceSettable(attributeKey);
            wheelswitch.setVisible(false);
            if (isSettable) {
                attributeKey = generateWriteAttributeKey(attributeName);
                setWidgetModel(chartViewer, chartBox, attributeKey);
            }
View Full Code Here

            }
        }
    }

    private void setStringSpectrumModel(IKey attributeKey) {
        IDataSourceProducer producer = getProducer();
        if ((producer != null) && producer.isSourceCreatable(attributeKey)) {
            stringBox.connectWidget(textArea, attributeKey);
        }
    }
View Full Code Here

                    if (!isSimpleMotorBeanGUI) {
                        propertyValue = deviceBundle
                                .getString("UserMotorBean.command.defineposition");
                        // - Define Position Command
                        tangoKey = generateCommandKey(propertyValue);
                        IDataSourceProducer producer = getProducer();
                        if (producer != null) {
                            boolean isCreatable = producer.isSourceCreatable(tangoKey);
                            // System.out.println("isCreatable=" + isCreatable);
                            if (isCreatable) {
                                setWidgetModel(getDefinePositionViewer(), stringBox, tangoKey);
                                getDefinePositionViewer().setText("<-|->");
                            }
                            getDefinePositionViewer().setVisible(isCreatable);
                        }
                    }

                    // SetModel for StateViewer
                    tangoKey = generateAttributeKey("State");
                    setStateModel();

                    propertyValue = deviceBundle.getString("UserMotorBean.command.backward");
                    tangoKey = generateCommandKey(propertyValue);

                    IDataSourceProducer producer = getProducer();
                    try {
                        if (producer != null) {
                            // Backward Command
                            backwardCmd = producer.createDataSource(tangoKey);
                        }
                    }
                    catch (Exception e) {
                        // TODO: handle exception
                    }

                    propertyValue = deviceBundle.getString("UserMotorBean.command.forward");
                    tangoKey = generateCommandKey(propertyValue);
                    producer = getProducer();
                    if (producer != null) {
                        try {
                            // Forward Command
                            forwardCmd = producer.createDataSource(tangoKey);
                        }
                        catch (Exception e) {
                            // TODO: handle exception
                        }
                    }
View Full Code Here

        jButtonIncActionPerformed(evt);
    }

    @SuppressWarnings("unchecked")
    private AbstractDataSource<Number> getNumberSource(IKey key) {
        IDataSourceProducer producer = getProducer();
        AbstractDataSource<Number> dataSource = null;
        AbstractDataSource<?> src = null;
        try {
            src = producer.createDataSource(key);
            if ((src != null) && Number.class.equals(src.getDataType().getConcernedClass())) {
                dataSource = (AbstractDataSource<Number>) src;
            }
        }
        catch (Exception e) {
View Full Code Here

    // CometeV1 will be deleted
    public static final String TANGO_FACTORY_CLASS = "fr.soleil.comete.dao.tangodao.TangoDAOFactory";

    private static void initProducer() {
        IDataSourceProducer producer = DataSourceProducerProvider
                .getProducer(TangoDataSourceFactory.SOURCE_PRODUCER_ID);
        if (producer == null) {
            DataSourceProducerProvider.pushNewProducer(TangoDataSourceFactory.class);
        }
    }
View Full Code Here

            return stateSource;
        }

        TangoKey tangoKey = new TangoKey();
        TangoKeyTool.registerAttribute(tangoKey, scanServerName, "State");
        IDataSourceProducer producer = getProducer();
        try {
            AbstractDataSource<?> src = producer.createDataSource(tangoKey);
            if ((src != null) && String.class.equals(src.getDataType().getConcernedClass())) {
                stateSource = (AbstractDataSource<String>) src;
            }
        }
        catch (UnhandledDataTypeException e1) {
View Full Code Here

            return stateSource;
        }

        TangoKey tangoKey = new TangoKey();
        TangoKeyTool.registerAttribute(tangoKey, scanServerName, "State");
        IDataSourceProducer producer = getProducer();
        try {
            AbstractDataSource<?> src = producer.createDataSource(tangoKey);
            if ((src != null) && String.class.equals(src.getDataType().getConcernedClass())) {
                stateSource = (AbstractDataSource<String>) src;
            }
        }
        catch (UnhandledDataTypeException e1) {
View Full Code Here

TOP

Related Classes of fr.soleil.data.service.IDataSourceProducer

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.