Examples of ISensor


Examples of fr.soleil.salsa.entity.ISensor

            if (scanResult.getSensorsList() != null) {
                Map<ISensor, DataArray> dataSensorMap = new HashMap<ISensor, DataArray>();
                Map<IActuator, DataArray> dataActuatorMap = new HashMap<IActuator, DataArray>();
                DataArray dataTime = null;
                Object component;
                ISensor sensorComponent;
                IActuator actuatorComponent;
                for (String dataName : yAxisComponents) {
                    component = getComponent(scanResult, dataName);
                    if (component instanceof ISensor) {
                        sensorComponent = (ISensor) component;
                        DataArray dataArray = new DataArray();
                        dataArray.setId(sensorComponent.getName());
                        dataArray.setDisplayName(sensorComponent.getName());
                        dataArray.setFormat(getFormat());
                        dataArray.setReadOnly(true);
                        dataList.add(dataArray);
                        dataSensorMap.put(sensorComponent, dataArray);
                    }
                    else if (component instanceof IActuator) {
                        actuatorComponent = (IActuator) component;
                        DataArray dataArray = new DataArray();
                        dataArray.setId(actuatorComponent.getName());
                        dataArray.setDisplayName(actuatorComponent.getName());
                        dataArray.setFormat(getFormat());
                        dataArray.setReadOnly(true);
                        dataList.add(dataArray);
                        dataActuatorMap.put(actuatorComponent, dataArray);
                    }
                    else {
                        dataTime = new DataArray();
                        dataTime.setId(dataName);
                        dataTime.setDisplayName(dataName);
                        dataTime.setFormat(getFormat());
                        dataTime.setReadOnly(true);
                        dataList.add(dataTime);
                    }
                }

                Object xComponent = getComponent(scanResult, xAxisComponent);

                List<IScanPoint> scanPointList = scanResult.getScanPointsList();
                Double xx;
                DataArray dataArray;
                Point point;
                ISensor sensor;
                IActuator actuator;
                for (IScanPoint scanPoint : scanPointList) {
                    if (xComponent instanceof IActuator) {
                        xx = scanPoint.getValue((IActuator) xComponent);
                    }
View Full Code Here

Examples of fr.soleil.salsa.entity.ISensor

                }

                String[] sensorsValueKeysArray = new TangoAttribute(scanServerName
                        + "/sensorsDataList").readSpecOrImage(String.class);

                ISensor sensor;
                String sensorValueKey;
                String sensorName;
                double[] sensorValuesArray;
                TangoAttribute sensorValueAttribute;
                for (int sensorIndex = 0; sensorIndex < sensorsNamesArray.length
                        && sensorIndex < sensorsValueKeysArray.length; ++sensorIndex) {
                    sensorName = sensorsNamesArray[sensorIndex];
                    sensor = new SensorImpl();
                    sensor.setName(sensorName);
                    sensor.setEnabled(true);
                    scanResult.getSensorsList().add(sensor);

                    sensorValueKey = sensorsValueKeysArray[sensorIndex];
                    sensorValueAttribute = new TangoAttribute(scanServerName + "/" + sensorValueKey);
                    sensorValuesArray = (double[]) sensorValueAttribute.readArray(Double.TYPE);
                    sensor.setScanServerAttributeName(scanServerName + "/" + sensorValueKey);

                    row = 0;
                    column = 0;
                    for (double sensorValue : sensorValuesArray) {
                        if ((row < rowsNumber) && (column < columnsNumber)) {
View Full Code Here

Examples of fr.soleil.salsa.entity.ISensor

                }

                String[] sensorsValueKeysArray = scanServerProxy.read_attribute("sensorsDataList")
                        .extractStringArray();

                ISensor sensor;
                String sensorValueKey;
                String sensorName;
                double[] sensorValuesArray;
                DeviceAttribute sensorValueAttribute;
                for (int sensorIndex = 0; sensorIndex < sensorsNamesArray.length
                        && sensorIndex < sensorsValueKeysArray.length; ++sensorIndex) {
                    sensorName = sensorsNamesArray[sensorIndex];
                    sensor = new SensorImpl();
                    sensor.setName(sensorName);
                    sensor.setEnabled(true);
                    scanResult.getSensorsList().add(sensor);

                    sensorValueKey = sensorsValueKeysArray[sensorIndex];
                    sensorValueAttribute = scanServerProxy.read_attribute(sensorValueKey);
                    sensorValuesArray = AttributeHelper.extractToDoubleArray(sensorValueAttribute);
                    sensor.setScanServerAttributeName(scanServerProxy.get_name() + "/"
                            + sensorValueKey);

                    row = 0;
                    column = 0;
                    for (double sensorValue : sensorValuesArray) {
View Full Code Here

Examples of fr.soleil.salsa.entity.ISensor

            if (scanResult.getSensorsList() != null) {
                Map<ISensor, DataArray> dataSensorMap = new HashMap<ISensor, DataArray>();
                Map<IActuator, DataArray> dataActuatorMap = new HashMap<IActuator, DataArray>();
                DataArray dataTime = null;
                Object component;
                ISensor sensorComponent;
                IActuator actuatorComponent;
                for (String dataName : yAxisComponents) {
                    component = getComponent(scanResult, dataName);
                    if (component instanceof ISensor) {
                        sensorComponent = (ISensor) component;
                        DataArray dataArray = new DataArray();
                        dataArray.setId(sensorComponent.getName());
                        dataArray.setDisplayName(sensorComponent.getName());
                        dataArray.setFormat(getFormat());
                        dataArray.setReadOnly(true);
                        dataList.add(dataArray);
                        dataSensorMap.put(sensorComponent, dataArray);
                    }
                    else if (component instanceof IActuator) {
                        actuatorComponent = (IActuator) component;
                        DataArray dataArray = new DataArray();
                        dataArray.setId(actuatorComponent.getName());
                        dataArray.setDisplayName(actuatorComponent.getName());
                        dataArray.setFormat(getFormat());
                        dataArray.setReadOnly(true);
                        dataList.add(dataArray);
                        dataActuatorMap.put(actuatorComponent, dataArray);
                    }
                    else {
                        dataTime = new DataArray();
                        dataTime.setId(dataName);
                        dataTime.setDisplayName(dataName);
                        dataTime.setFormat(getFormat());
                        dataTime.setReadOnly(true);
                        dataList.add(dataTime);
                    }
                }

                Object xComponent = getComponent(scanResult, xAxisComponent);

                List<IScanPoint> scanPointList = scanResult.getScanPointsList();
                Double xx;
                DataArray dataArray;
                Point point;
                ISensor sensor;
                IActuator actuator;
                for (IScanPoint scanPoint : scanPointList) {
                    if (xComponent instanceof IActuator) {
                        xx = scanPoint.getValue((IActuator) xComponent);
                    }
View Full Code Here

Examples of fr.soleil.salsa.entity.ISensor

            // Sensors
            List<ISensor> sensors = config.getSensorsList();
            view.clearSensors();
            for (int i = 0; i < sensors.size(); i++) {

                ISensor s = sensors.get(i);
                SensorModel eSensort = (SensorModel) s;
                eSensort.addListener(sensorListener);
                view.addSensor(s.getName(), s.getName());
                if (i == postScanBehaviour.getSensor()) {
                    view.setSensorSelected(i);
                }
            }
            if (sensors.size() == 0) {
View Full Code Here

Examples of fr.soleil.salsa.entity.ISensor

     */
    @Override
    public void notifyGotoClicked() {
        if(selectedFunction != null) {
            String scanServerName = ModelPreferences.getInstance().getScanServer();
            ISensor sensor = selectedFunction.getArgumentCount() > 0 ? selectedSensor : null;
            IActuator actuator = selectedFunction.getArgumentCount() > 1 ? selectedActuator : null;
            try {
                ScanApi.doScanFunction(scanServerName, selectedFunction, sensor, actuator);
            } catch (SalsaDeviceException e) {
                Salsa.getApplicationController().errorMessage(e.getMessage());
View Full Code Here

Examples of fr.soleil.salsa.entity.ISensor

            List<IActuator> actuatorsList = result.getActuatorsXList();
           
            Option[] sensorsArray = new Option[sensorsList.size()];
            int sensorIndex;
            int sensorsNumber =  sensorsList.size();
            ISensor sensor;
            for(sensorIndex = 0; sensorIndex < sensorsNumber; ++sensorIndex) {
                sensor = sensorsList.get(sensorIndex);
                sensorsArray[sensorIndex] = new Option(sensor, sensor.getName());
            }
            view.setSensorsArray(sensorsArray);
           
            Option[] actuatorsArray = new Option[actuatorsList.size()];
            int actuatorIndex;
View Full Code Here

Examples of fr.soleil.salsa.entity.ISensor

                    sensorsNamesArray[sensorIndex] = sensorsNamesArrayTmp[sensorIndex];
                }
               
                String[] sensorsValueKeysArray = scanServerProxy.read_attribute("sensorsDataList").extractStringArray();
   
                ISensor sensor;
                String sensorValueKey;
                String sensorName;
                double[] sensorValuesArray;
                DeviceAttribute sensorValueAttribute;
                for(int sensorIndex = 0; sensorIndex < sensorsNamesArray.length && sensorIndex < sensorsValueKeysArray.length; ++sensorIndex) {
                    sensorName = sensorsNamesArray[sensorIndex];
                    sensor = new SensorImpl();
                    sensor.setName(sensorName);
                    sensor.setEnabled(true);
                    scanResult.getSensorsList().add(sensor);
                   
                    sensorValueKey = sensorsValueKeysArray[sensorIndex];
                    sensorValueAttribute = scanServerProxy.read_attribute(sensorValueKey);
                    sensorValuesArray = AttributeHelper.extractToDoubleArray(sensorValueAttribute);
                    sensor.setScanServerAttributeName(scanServerProxy.get_name() + "/" + sensorValueKey);
                   
                    pointIndex = 0;
                    for(double sensorValue : sensorValuesArray) {
                        // The reading can occur during the scan. Because of this, more values can have been added since
                        // scanPointsList was initialized. Hence the test scanPointsList.size() > pointIndex.
View Full Code Here

Examples of fr.soleil.salsa.entity.ISensor

        setDimension(dimension);

    }

    public void addSensor(String sensorName) {
        ISensor device = new SensorModel();
        device.setName(sensorName);
        device.setEnabled(true);
        sensorsList.add(device);
    }
View Full Code Here

Examples of fr.soleil.salsa.entity.ISensor

    @Override
    public void notifyNewAction(String value) {

        if (config != null) {
            updateListSensors();
            ISensor sensor = new SensorModel();
            sensor.setName(defaultSensorName);
            if (value != null) {
                sensor.setName(value);
            }
            sensor.setEnabled(true);

            boolean addSucces = this.sensorsListView.addRow(sensor);
            if (addSucces)
                this.listSensor.add(sensor);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.