Package fr.soleil.salsa.api.item

Examples of fr.soleil.salsa.api.item.SensorReport


            super("RefreshSensorWorker");
        }

        @Override
        public SensorReport doInBackground() {
            SensorReport report;

            factoryClassName = SalsaDAOFactory.class.getName();
            sensorKRead = new SensorKey(sensor, factoryClassName, SensorKey.DataMode.READ);
            sensorKWrite = new SensorKey(sensor, factoryClassName, SensorKey.DataMode.WRITE);
            sensorStateKey = new SensorStateKey(sensor, factoryClassName);

            try {
                report = SensorDeviceApi.getSensorReport(sensor.getName());
                DimensionType dimensionType = report.getDimensionType();

                if (allowScalar || report == null
                        || report.getDimensionType() != DimensionType.SCALAR) {

                    // Resume the DAO if they were suspended.
                    // Also, it makes the DAO factory initialize them and store them in the cache if
                    // this was not done already, lessening the work done on the EDT.
                    AbstractDAOFactory factory = DAOFactoryManager
View Full Code Here


            return report;
        }

        @Override
        public void done() {
            SensorReport report = get();
            synchronized (viewDeviceLock) {
                if (report != null) {
                    view.setDimensionType(convertDimensionType(report.getDimensionType()));
                    view.setReadOnly(!report.isWriteable());
                }
                else {
                    errorMessage(exception.getMessage());
                    view.setDimensionType(convertDimensionType(DimensionType.SCALAR));
                    view.setReadOnly(true);
                }
                view.setSensorKey(factoryClassName, sensorKRead, sensorKWrite);
                view.setSensorStateKey(factoryClassName, sensorStateKey);
                view.switchDAOFactory(factoryClassName);
                view.setActive(true);
                if (!allowScalar && report != null
                        && report.getDimensionType() == DimensionType.SCALAR) {
                    errorMessage("HCS scans cannot use scalar sensors.");
                    view.setDimensionType(convertDimensionType(DimensionType.SCALAR));
                    view.setReadOnly(true);
                }
            }
View Full Code Here

            super("RefreshSensorWorker");
        }

        @Override
        public SensorReport doInBackground() {
            SensorReport report;

            factoryClassName = SalsaDAOFactory.class.getName();
            sensorKRead = new SensorKey(sensor, factoryClassName, SensorKey.DataMode.READ);
            sensorKWrite = new SensorKey(sensor, factoryClassName, SensorKey.DataMode.WRITE);
            sensorStateKey = new SensorStateKey(sensor, factoryClassName);

            ISensor sensorImpl = (ISensor) AutoCopier.toImpl(sensor);
            try {
                report = SensorDeviceApi.getSensorReport(sensorImpl);
                DimensionType dimensionType = report.getDimensionType();

                if (allowScalar || report == null
                        || report.getDimensionType() != DimensionType.SCALAR) {

                    // Resume the DAO if they were suspended.
                    // Also, it makes the DAO factory initialize them and store them in the cache if
                    // this
                    // was not done already, lessening the work done on the EDT.
View Full Code Here

            return report;
        }

        @Override
        public void done() {
            SensorReport report = get();
            synchronized (viewDeviceLock) {
                if (report != null) {
                    view.setDimensionType(convertDimensionType(report.getDimensionType()));
                    view.setReadOnly(!report.isWriteable());
                }
                else {
                    Salsa.getApplicationController().errorMessage(exception.getMessage());
                    view.setDimensionType(convertDimensionType(DimensionType.SCALAR));
                    view.setReadOnly(true);
                }
                view.setSensorKey(factoryClassName, sensorKRead, sensorKWrite);
                view.setSensorStateKey(factoryClassName, sensorStateKey);
                view.switchDAOFactory(factoryClassName);
                view.setActive(true);
                if (!allowScalar && report != null
                        && report.getDimensionType() == DimensionType.SCALAR) {
                    Salsa.getApplicationController().errorMessage(
                            "HCS scans cannot use scalar sensors.");
                    view.setDimensionType(convertDimensionType(DimensionType.SCALAR));
                    view.setReadOnly(true);
                }
View Full Code Here

     * Generates and return a report about a sensor.
     * @param device
     * @param report
     */
    public static SensorReport getSensorReport(ISensor sensor) throws SalsaDeviceException {
        SensorReport report = new SensorReport();
        DeviceConnector.fillDeviceReport(sensor, report);
        return report;
    }
View Full Code Here

     * Generates and return a report about a sensor.
     *
     * @param sensorName The name of the sensor
     */
    public static SensorReport getSensorReport(String sensorName) throws SalsaDeviceException {
        SensorReport report = new SensorReport();
        DeviceConnector.fillDeviceReport(sensorName, report);
        return report;
    }
View Full Code Here

TOP

Related Classes of fr.soleil.salsa.api.item.SensorReport

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.