Package fr.soleil.data.service

Examples of fr.soleil.data.service.IDataSourceProducer


    private void setChartWidgetModel(IKey attributeKey) {
        setWidgetModel(chartViewer, chartBox, attributeKey);
        // System.out.println("Id read =" + attributeKey.getInformationKey());
        chartViewer.setDataViewColor(attributeKey.getInformationKey(), Color.RED);
        IDataSourceProducer producer = getProducer();
        if (producer != null) {
            boolean isSettable = producer.isSourceSettable(attributeKey);
            wheelswitch.setVisible(false);
            if (isSettable) {
                IKey writeAttributeKey = generateWriteAttributeKey(attributeName);
                // System.out.println("Id read =" + writeAttributeKey.getInformationKey());
                setWidgetModel(chartViewer, chartBox, writeAttributeKey);
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

        }
    }

    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

                TangoKey key = null;
                if (!isSimpleMotorBeanGUI) {
                    property = deviceBundle.getString("UserMotorBean.command.defineposition");
                    // - Define Position Command
                    key = generateCommandKey(property);
                    final IDataSourceProducer producer = getProducer();
                    if (producer != null) {
                        final boolean isCreatable = producer.isSourceCreatable(key);
                        // System.out.println("isCreatable=" + isCreatable);
                        if (isCreatable) {
                            setWidgetModel(getDefinePositionViewer(), stringBox, key);
                            getDefinePositionViewer().setText(DEFINE_POSITION_TEXT);
                        }
                        getDefinePositionViewer().setVisible(isCreatable);
                    }
                }

                // SetModel for StateViewer
                key = UserMotorBean.this.generateAttributeKey("State");
                UserMotorBean.this.setStateModel();

                // For some motor Backward and Forward Command does not
                // exist XPSAxis
                final IDataSourceProducer producer = getProducer();
                if (producer != null) {
                    property = deviceBundle.getString("UserMotorBean.command.backward");
                    if (TangoCommandHelper.isCommandExist(getModel(), property)) {
                        key = generateCommandKey(property);
                        try {
                            // Backward Command
                            backwardCmd = producer.createDataSource(key);
                        } catch (final Exception e) {
                            Logger.getLogger(Mediator.LOGGER_ACCESS).log(
                                    Level.WARNING,
                                    UserMotorBean.this.getClass().getSimpleName()
                                            + " failed to connect to backward command", e);
                        }
                        getBackwardButton().setVisible(true);
                    } else {
                        getBackwardButton().setVisible(false);
                    }

                    property = deviceBundle.getString("UserMotorBean.command.forward");
                    if (TangoCommandHelper.isCommandExist(getModel(), property)) {
                        key = generateCommandKey(property);
                        try {
                            // Forward Command
                            forwardCmd = producer.createDataSource(key);
                        } catch (final Exception e) {
                            Logger.getLogger(Mediator.LOGGER_ACCESS).log(
                                    Level.WARNING,
                                    UserMotorBean.this.getClass().getSimpleName()
                                            + " failed to connect to forward command", e);
View Full Code Here

        this.jButtonIncActionPerformed(evt);
    }

    @SuppressWarnings("unchecked")
    private AbstractDataSource<Number> getNumberSource(final IKey key) {
        final IDataSourceProducer producer = getProducer();
        AbstractDataSource<Number> dataSource = null;
        AbstractDataSource<?> src = null;
        try {
            src = producer.createDataSource(key);
            if ((src != null) && (src.getDataType() != null)
                    && Number.class.equals(src.getDataType().getConcernedClass())) {
                dataSource = (AbstractDataSource<Number>) src;
            }
        } catch (final Exception e) {
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();
                    if (producer != null) {
                        // Backward Command
                        try {
                            backwardCmd = producer.createDataSource(tangoKey);
                        }
                        catch (UnhandledDataTypeException e) {
                            System.out.println("Couldn't create backward command");
                        }
                    }

                    propertyValue = deviceBundle.getString("UserMotorBean.command.forward");
                    tangoKey = generateCommandKey(propertyValue);
                    producer = getProducer();
                    if (producer != null) {
                        // Forward Command
                        try {
                            forwardCmd = producer.createDataSource(tangoKey);
                        }
                        catch (UnhandledDataTypeException e) {
                            System.out.println("Couldn't create forward command");
                        }
                    }
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);
        }
        catch (UnhandledDataTypeException e1) {
            e1.printStackTrace();
        }
        if ((src != null) && Number.class.equals(src.getDataType().getConcernedClass())) {
View Full Code Here

        if (!this.isSimpleMotorBeanGUI) {
            propertyValue = this.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 = this.deviceBundle.getString("UserMotorBean.command.backward");
        tangoKey = generateCommandKey(propertyValue);

        IDataSourceProducer producer = getProducer();
        if (producer != null) {
            // Backward Command
            try {
                backwardCmd = producer.createDataSource(tangoKey);
            }
            catch (UnhandledDataTypeException e) {
                System.out.println("Couldn't create backward command");
            }
        }

        propertyValue = this.deviceBundle.getString("UserMotorBean.command.forward");
        tangoKey = generateCommandKey(propertyValue);
        producer = getProducer();
        if (producer != null) {
            // Forward Command
            try {
                forwardCmd = producer.createDataSource(tangoKey);
            }
            catch (UnhandledDataTypeException e) {
                System.out.println("Couldn't create forward command");
            }
        }
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);
        }
        catch (UnhandledDataTypeException e1) {
            e1.printStackTrace();
        }
        if ((src != null) && Number.class.equals(src.getDataType().getConcernedClass())) {
View Full Code Here

        // DO NOT POLLED TO FAST => TIME OUT ERROR BUG 23612
        if (refreshingPeriod < 1000) {
            refreshingPeriod = 1000;
        }
        if (refreshingPeriod != TangoDataSourceFactory.DEFAULT_SLEEPING_PERIOD) {
            IDataSourceProducer producer = DataSourceProducerProvider
                    .getProducer(TangoDataSourceFactory.SOURCE_PRODUCER_ID);
            if ((producer instanceof AbstractRefreshingManager<?>) && (key != null)) {
                ((AbstractRefreshingManager<?>) producer).setRefreshingStrategy(key, new PolledRefreshingStrategy(
                        refreshingPeriod));
            }
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.