Package fr.soleil.salsa.entity.scan2D

Examples of fr.soleil.salsa.entity.scan2D.IConfig2D


                                .getDimension()).removeListener(dimensionListener);
                    }

                }
                else if (this.config instanceof IConfig2D) {
                    IConfig2D config2D = (IConfig2D) this.config;
                    IDimension dimension;
                    if (this.yActuator) {
                        dimension = config2D.getDimensionY();
                    }
                    else {
                        dimension = config2D.getDimensionX();
                    }
                    if (dimension != null) {
                        ((IEventSource<EntityPropertyChangedEvent<? extends IDimension>>) dimensionListener
                                .getDimension()).removeListener(dimensionListener);
                    }
                }
                else if (this.config instanceof IConfigEnergy) {
                    IConfigEnergy configEnergy = (IConfigEnergy) this.config;
                    IDimension dimension = configEnergy.getDimensionEnergy();
                    if (dimension != null) {
                        ((IEventSource<EntityPropertyChangedEvent<? extends IDimension>>) dimensionListener
                                .getDimension()).removeListener(dimensionListener);
                    }
                }
            }
            this.config = config;
            actuatorListenersList.clear();
            if (config != null) {
                ((IEventSource<EntityPropertyChangedEvent<IConfig>>) this.config)
                        .addListener(configListener);

                if (config instanceof IConfig1D) {
                    IConfig1D config1D = (IConfig1D) config;
                    this.setViewVisible(true);
                    listActuator = config1D.getDimensionX().getActuatorsList();

                    IDimension dimension = config1D.getDimensionX();
                    if (dimension != null) {
                        dimensionListener = new DimensionListener(dimension);
                        ((IEventSource<EntityPropertyChangedEvent<? extends IDimension>>) dimension)
                                .addListener(dimensionListener);
                    }
                }
                else if (config instanceof IConfig2D) {
                    IConfig2D config2D = (IConfig2D) config;
                    if (this.yActuator) { // Case of Y Actuator.
                        this.setViewVisible(true);
                        listActuator = config2D.getDimensionY().getActuatorsList();
                        IDimension dimension = config2D.getDimensionY();
                        if (dimension != null) {
                            dimensionListener = new DimensionListener(dimension);
                            ((IEventSource<EntityPropertyChangedEvent<? extends IDimension>>) dimension)
                                    .addListener(dimensionListener);
                        }
                    }
                    else { // Case of X Actuator.
                        this.setViewVisible(true);
                        listActuator = config2D.getDimensionX().getActuatorsList();
                        IDimension dimension = config2D.getDimensionX();
                        if (dimension != null) {
                            dimensionListener = new DimensionListener(dimension);
                            ((IEventSource<EntityPropertyChangedEvent<? extends IDimension>>) dimension)
                                    .addListener(dimensionListener);
                        }
View Full Code Here


                                                actuatorTrajectoryMap);
                                    }
                                    break;

                                case SCAN_2D:
                                    IConfig2D config2d = (IConfig2D) config;
                                    IDimension2DX dimension2DX = config2d.getDimensionX();
                                    actuatorList = dimension2DX.getActuatorsList();
                                    List<IRange2DX> range2DXList = dimension2DX.getRangesList();

                                    for (int rangeid = 0; rangeid < range2DXList.size(); rangeid++) {
                                        modifyTrajectory(range2DXList.get(rangeid), actuatorList,
                                                actuatorTrajectoryMap);
                                    }

                                    IDimension2DY dimension2DY = config2d.getDimensionY();
                                    actuatorList = dimension2DY.getActuatorsList();
                                    List<IRange2DY> range2DYList = dimension2DY.getRangesList();

                                    for (int rangeid = 0; rangeid < range2DYList.size(); rangeid++) {
                                        modifyTrajectory(range2DYList.get(rangeid), actuatorList,
View Full Code Here

        if (config != null) {
            IDimension dimension = null;
            // All type of config have an X dimension
            if ((config instanceof IConfig2D) && this.yActuator) {
                // For 2D config there is the YDimension to add
                IConfig2D config2D = (IConfig2D) this.config;
                dimension = config2D.getDimensionY();
            } else {
                dimension = config.getDimensionX();
            }
            if (dimension != null) {
                deviceList = dimension.getActuatorsList();
View Full Code Here

                        }

                        break;

                    case SCAN_2D:
                        IConfig2D config2d = (IConfig2D) config;
                        IDimension2DX dimension2DX = config2d.getDimensionX();
                        List<IActuator> listActuator2DX = dimension2DX.getActuatorsList();

                        ArrayList<ITrajectory> trajectories2DX = new ArrayList<ITrajectory>();

                        List<IRange2DX> range2DX = dimension2DX.getRangesList();

                        for (int i = 0; i < range2DX.size(); i++) {
                            List<ITrajectory> listTrajectory = range2DX.get(i)
                                    .getTrajectoriesList();
                            for (int j = 0; j < listTrajectory.size(); j++) {
                                ITrajectory trajectory = new TrajectoryImpl();
                                trajectory.setName(listActuator2DX.get(j).getName());
                                trajectory.setBeginPosition(listTrajectory.get(j)
                                        .getBeginPosition());
                                trajectory.setEndPosition(listTrajectory.get(j).getEndPosition());
                                trajectories2DX.add(trajectory);
                            }
                        }
                        if (!trajectories2DX.isEmpty()) {

                            for (int i = 0; i < trajectories2DX.size(); i++) {
                                ITrajectory trajectory2DX = trajectories2DX.get(i);
                                String tempId = trajectory2DX.getName();
                                StringTokenizer st = new StringTokenizer(tempId, "/");
                                String id = null;
                                while (st.hasMoreTokens()) {
                                    id = st.nextToken();
                                }
                                Double from = trajectory2DX.getBeginPosition();
                                Double to = trajectory2DX.getEndPosition();
                                Element actuator = document.createElement("actuator");
                                actuator.setAttribute("id", id);
                                actuator.setAttribute("from", String.valueOf(from));
                                actuator.setAttribute("to", String.valueOf(to));
                                actuators.appendChild(actuator);
                            }
                            element.appendChild(actuators);
                        }
                        IDimension2DY dimension2DY = config2d.getDimensionY();
                        List<IActuator> listActuator2DY = dimension2DY.getActuatorsList();

                        ArrayList<ITrajectory> trajectories2DY = new ArrayList<ITrajectory>();
                        List<IRange2DY> range2DY = dimension2DY.getRangesList();
View Full Code Here

                }

                // All type of config have an X dimension
                if (config instanceof IConfig2D && this.yActuator) {
                    // For 2D config there is the YDimension to add
                    IConfig2D config2D = (IConfig2D) this.config;
                    this.setViewVisible(true);
                    deviceList = config2D.getDimensionY().getActuatorsList();
                    IDimension dimensionY = config2D.getDimensionY();
                    if (dimensionY != null) {
                        ((IEventSource<EntityPropertyChangedEvent<? extends IDimension>>) dimensionListenerY
                                .getDimension()).removeListener(dimensionListenerY);
                    }
                }
                else {
                    this.setViewVisible(true);
                    IDimension dimension = config.getDimensionX();
                    if (dimension != null) {
                        ((IEventSource<EntityPropertyChangedEvent<? extends IDimension>>) dimensionListener
                                .getDimension()).removeListener(dimensionListener);
                    }
                }

            }
            this.config = aconfig;
            deviceListenersList.clear();
            if (config != null) {
                ((IEventSource<EntityPropertyChangedEvent<IConfig<?>>>) this.config)
                        .addListener(configListener);

                // All type of config have an X dimension
                if (config instanceof IConfig2D && this.yActuator) {
                    // For 2D config there is the YDimension to add
                    IConfig2D config2D = (IConfig2D) config;
                    this.setViewVisible(true);
                    deviceList = config2D.getDimensionY().getActuatorsList();
                    IDimension dimensionY = config2D.getDimensionY();
                    if (dimensionY != null) {
                        dimensionListenerY = new DimensionListener(dimensionY);
                        ((IEventSource<EntityPropertyChangedEvent<? extends IDimension>>) dimensionY)
                                .addListener(dimensionListenerY);
                    }
View Full Code Here

            if ((config.getDimensionX() != null)
                    && (config.getDimensionX().getActuatorsList() != null)) {
                deviceList.addAll(config.getDimensionX().getActuatorsList());
            }
            if (config instanceof IConfig2D) {
                IConfig2D config2D = (IConfig2D) config;
                if ((config2D.getDimensionY() != null)
                        && (config2D.getDimensionX().getActuatorsList() != null)) {
                    deviceList.addAll(config2D.getDimensionY().getActuatorsList());
                }
            }
            List<String> displayableList = extractAvailableDeviceNames(true, deviceList);
            deviceList.clear();
            int size = Math.min(axisList.size(), displayableList.size());
View Full Code Here

                                }
                            }

                        }
                        else if (config instanceof IConfig2D) {
                            IConfig2D config2d = (IConfig2D) config;
                            IDimension2DX dimension2DX = config2d.getDimensionX();
                            List<IActuator> listActuator2DX = dimension2DX.getActuatorsList();
                            List<IRange2DX> range2DX = dimension2DX.getRangesList();

                            for (int i = 0; i < range2DX.size(); i++) {
                                List<ITrajectory> listTrajectory = range2DX.get(i)
                                .getTrajectoriesList();
                                for (int j = 0; j < listTrajectory.size(); j++) {
                                    IActuator actuator = listActuator2DX.get(j);
                                    if ((actuator != null) && actuator.isEnabled()) {
                                        ITrajectory trajectory = copyToTrajectoryImpl(actuator,
                                                listTrajectory.get(j));
                                        if (trajectory != null) {
                                            trajectories.add(trajectory);
                                        }
                                    }
                                }
                            }

                            IDimension2DY dimension2DY = config2d.getDimensionY();
                            List<IActuator> listActuator2DY = dimension2DY.getActuatorsList();
                            List<IRange2DY> range2DY = dimension2DY.getRangesList();

                            for (int i = 0; i < range2DY.size(); i++) {
                                List<ITrajectory> listTrajectory = range2DY.get(i)
View Full Code Here

                        }

                        break;

                    case SCAN_2D:
                        IConfig2D config2d = (IConfig2D) config;
                        IDimension2DX dimension2DX = config2d.getDimensionX();
                        List<IActuator> listActuator2DX = dimension2DX.getActuatorsList();

                        ArrayList<ITrajectory> trajectories2DX = new ArrayList<ITrajectory>();

                        List<IRange2DX> range2DX = dimension2DX.getRangesList();

                        for (int i = 0; i < range2DX.size(); i++) {
                            List<ITrajectory> listTrajectory = range2DX.get(i)
                                    .getTrajectoriesList();
                            for (int j = 0; j < listTrajectory.size(); j++) {
                                ITrajectory trajectory = new TrajectoryImpl();
                                trajectory.setName(listActuator2DX.get(j).getName());
                                trajectory.setBeginPosition(listTrajectory.get(j)
                                        .getBeginPosition());
                                trajectory.setEndPosition(listTrajectory.get(j).getEndPosition());
                                trajectories2DX.add(trajectory);
                            }
                        }
                        if (!trajectories2DX.isEmpty()) {

                            for (int i = 0; i < trajectories2DX.size(); i++) {
                                ITrajectory trajectory2DX = trajectories2DX.get(i);
                                String tempId = trajectory2DX.getName();
                                StringTokenizer st = new StringTokenizer(tempId, "/");
                                String id = null;
                                while (st.hasMoreTokens()) {
                                    id = st.nextToken();
                                }
                                Double from = trajectory2DX.getBeginPosition();
                                Double to = trajectory2DX.getEndPosition();
                                Element actuator = document.createElement("actuator");
                                actuator.setAttribute("id", id);
                                actuator.setAttribute("from", String.valueOf(from));
                                actuator.setAttribute("to", String.valueOf(to));
                                actuators.appendChild(actuator);
                            }
                            element.appendChild(actuators);
                        }
                        IDimension2DY dimension2DY = config2d.getDimensionY();
                        List<IActuator> listActuator2DY = dimension2DY.getActuatorsList();

                        ArrayList<ITrajectory> trajectories2DY = new ArrayList<ITrajectory>();
                        List<IRange2DY> range2DY = dimension2DY.getRangesList();
View Full Code Here

                        }

                        break;

                    case SCAN_2D:
                        IConfig2D config2d = (IConfig2D) config;
                        IDimension2DX dimension2DX = config2d.getDimensionX();
                        List<IActuator> listActuator2DX = dimension2DX.getActuatorsList();

                        ArrayList<ITrajectory> trajectories2DX = new ArrayList<ITrajectory>();

                        List<IRange2DX> range2DX = dimension2DX.getRangesList();

                        for (int i = 0; i < range2DX.size(); i++) {
                            List<ITrajectory> listTrajectory = range2DX.get(i)
                                    .getTrajectoriesList();
                            for (int j = 0; j < listTrajectory.size(); j++) {
                                ITrajectory trajectory = new TrajectoryImpl();
                                trajectory.setName(listActuator2DX.get(j).getName());
                                trajectory.setBeginPosition(listTrajectory.get(j)
                                        .getBeginPosition());
                                trajectory.setEndPosition(listTrajectory.get(j).getEndPosition());
                                trajectories2DX.add(trajectory);
                            }
                        }
                        if (!trajectories2DX.isEmpty()) {

                            for (int i = 0; i < trajectories2DX.size(); i++) {
                                ITrajectory trajectory2DX = trajectories2DX.get(i);
                                String tempId = trajectory2DX.getName();
                                StringTokenizer st = new StringTokenizer(tempId, "/");
                                String id = null;
                                while (st.hasMoreTokens()) {
                                    id = st.nextToken();
                                }
                                Double from = trajectory2DX.getBeginPosition();
                                Double to = trajectory2DX.getEndPosition();
                                Element actuator = document.createElement("actuator");
                                actuator.setAttribute("id", id);
                                actuator.setAttribute("from", String.valueOf(from));
                                actuator.setAttribute("to", String.valueOf(to));
                                actuators.appendChild(actuator);
                            }
                            element.appendChild(actuators);
                        }
                        IDimension2DY dimension2DY = config2d.getDimensionY();
                        List<IActuator> listActuator2DY = dimension2DY.getActuatorsList();

                        ArrayList<ITrajectory> trajectories2DY = new ArrayList<ITrajectory>();
                        List<IRange2DY> range2DY = dimension2DY.getRangesList();
View Full Code Here

                            }

                            break;

                        case SCAN_2D:
                            IConfig2D config2d = (IConfig2D) config;
                            IDimension2DX dimension2DX = config2d.getDimensionX();
                            List<IActuator> listActuator2DX = dimension2DX.getActuatorsList();
                            List<IRange2DX> range2DX = dimension2DX.getRangesList();

                            for (int i = 0; i < range2DX.size(); i++) {
                                List<ITrajectory> listTrajectory = range2DX.get(i)
                                        .getTrajectoriesList();
                                for (int j = 0; j < listTrajectory.size(); j++) {
                                    IActuator actuator = listActuator2DX.get(j);
                                    if (actuator != null && actuator.isEnabled()) {
                                        ITrajectory trajectory = copyToTrajectoryImpl(actuator,
                                                listTrajectory.get(j));
                                        if (trajectory != null) {
                                            trajectories.add(trajectory);
                                        }
                                    }
                                }
                            }

                            IDimension2DY dimension2DY = config2d.getDimensionY();
                            List<IActuator> listActuator2DY = dimension2DY.getActuatorsList();
                            List<IRange2DY> range2DY = dimension2DY.getRangesList();

                            for (int i = 0; i < range2DY.size(); i++) {
                                List<ITrajectory> listTrajectory = range2DY.get(i)
View Full Code Here

TOP

Related Classes of fr.soleil.salsa.entity.scan2D.IConfig2D

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.