Package fr.soleil.salsa.entity

Examples of fr.soleil.salsa.entity.IDimension


        refresh(true);
    }

    public void refresh(boolean saved) {
        IConfig<?> currentConfig = config;
        IDimension currentDimension = null;
        if (saved) {
            currentConfig = dbconfig;
        }

        if (currentConfig != null) {
View Full Code Here


                        if (sensors.size() == 0) {
                            view.addSensor(null, "Not defined");
                        }

                        // Actuators
                        IDimension dimension = currentConfig.getDimensionX();
                        if (dimension != null) {
                            List<IActuator> actuators = dimension.getActuatorsList();
                            view.clearActuators();
                            if (actuators != null) {
                                for (int i = 0; i < actuators.size(); i++) {
                                    IActuator a = actuators.get(i);
                                    if (a.isEnabled()) {
View Full Code Here

        refresh(true);
    }

    public void refresh(boolean saved) {
        IConfig<?> currentConfig = config;
        IDimension currentDimension = null;
        if (saved) {
            currentConfig = dbconfig;
        }

        if (currentConfig != null) {
View Full Code Here

     * @see IRange#setDimension(IDimension)
     * @param IDimension
     */
    @Override
    public void setDimension(IDimension dimension) {
        IDimension oldValue = this.baseBean.getDimension();
        this.baseBean.setDimension(dimension);
        this.firePropertyChange("dimension", oldValue, dimension);
    }
View Full Code Here

        refresh(true);
    }

    public void refresh(boolean saved) {
        IConfig<?> currentConfig = config;
        IDimension currentDimension = null;
        if (saved) {
            currentConfig = dbconfig;
        }

        if (currentConfig != null) {
View Full Code Here

        refresh(true);
    }

    public void refresh(boolean saved) {
        IConfig<?> currentConfig = config;
        IDimension currentDimension = null;
        if (saved) {
            currentConfig = dbconfig;
        }

        if (currentConfig != null) {
View Full Code Here

            if (device != null) {
                device.setCommon(true);
            } else {
                device = new ActuatorModel();
                actuatorList.add((IActuator) device);
                IDimension tmpDimension = null;
                if (!yActuator && !dimensionList.isEmpty()) {
                    tmpDimension = dimensionList.get(0);
                } else if (dimensionList.size() > 1) {
                    tmpDimension = dimensionList.get(1);
                }
                if (tmpDimension != null) {
                    tmpActuatorList = tmpDimension.getActuatorsList();
                    if (tmpActuatorList != null) {
                        tmpActuatorList.add((IActuator) device);
                    }
                }
            }
View Full Code Here

        }
    }

    @Override
    protected IDimension initDimension(IConfig<?> aconfig) {
        IDimension newDimension = null;
        if (aconfig != null && aconfig instanceof IConfigEnergy) {
            newDimension = aconfig.getDimensionX();
        }
        return newDimension;
    }
View Full Code Here

                }
            }

            // Get actuators
            List<IDimension> tmpDimensionList = config.getDimensionList();
            IDimension tmpDimension = null;
            IDimension managerDimension = null;
            List<IActuator> managerActuators = null;
            if ((tmpDimensionList != null) && !tmpDimensionList.isEmpty()) {
                for (int index = 0; index < tmpDimensionList.size(); index++) {
                    tmpDimension = tmpDimensionList.get(index);
                    tmpDeviceList = tmpDimension.getActuatorsList();
                    if (index < dimensionList.size()) {
                        managerDimension = dimensionList.get(index);
                    } else {
                        managerDimension = new DimensionImpl();
                        dimensionList.add(managerDimension);
                    }

                    managerActuators = managerDimension.getActuatorsList();
                    if (managerActuators == null) {
                        managerActuators = new ArrayList<IActuator>();
                        managerDimension.setActuatorsList(managerActuators);
                    }
                    for (IDevice actuator : tmpDeviceList) {
                        IDevice newActuator = updateDeviceList(config, actuator, actuatorList);
                        if (super.getDevice(newActuator.getName(), managerActuators) == null) {
                            managerActuators.add((IActuator) newActuator);
                        }
                    }
                }
            }
        }
        // System.out.println("after configList=" + configList.size());
        super.setSensorsList(sensorList);
        super.setTimebaseList(timeBaseList);
        // Update common properties
        updateCommonDevice(sensorList);
        updateCommonDevice(timeBaseList);
        // updateCommonDevice(actuatorList);
        IDimension tmpDimension = null;
        for (int index = 0; index < dimensionList.size(); index++) {
            tmpDimension = dimensionList.get(index);
            tmpDeviceList = tmpDimension.getActuatorsList();
            updateCommonDevice(tmpDeviceList, index);
        }
    }
View Full Code Here

    private void updateCommonDevice(List<? extends IDevice> deviceList, int dimensionIndex) {
        if (deviceList != null) {
            List<? extends IDevice> configDeviceList = null;
            List<IDimension> configDimensionList = null;
            IDimension configDimension = null;
            // Sensors
            for (IDevice device : deviceList) {
                boolean first = true;
                for (IConfig<?> config : configList) {
                    if (first) {
                        if (device instanceof IActuator) {
                            configDimensionList = config.getDimensionList();
                            if (dimensionIndex < configDimensionList.size()) {
                                configDimension = configDimensionList.get(dimensionIndex);
                            }
                            if (configDimension != null) {
                                configDeviceList = configDimension.getActuatorsList();
                            }
                        }
                        first = false;
                    }
                    if (super.getDevice(device.getName(), configDeviceList) == null) {
View Full Code Here

TOP

Related Classes of fr.soleil.salsa.entity.IDimension

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.