Package fr.soleil.salsa.entity.scan1d

Examples of fr.soleil.salsa.entity.scan1d.IRange1D


     * @return the updated config. It may be another instance entirely.
     */
    // This function returns the configuration it received as parameter.
    // Note that this is specific to LocalConfigMathService and that other implementations of IConfigMathService may behave differently.
    public ITrajectory computeDeltaChange(ITrajectory trajectory) {
        IRange1D range = ((ITrajectory1D) trajectory).getRange();
        double beginPosition = trajectory.getBeginPosition();
        double endPosition = trajectory.getEndPosition();
        double delta = trajectory.getDelta();
        int stepsNumber = (int) Math.abs(Math.round((endPosition - beginPosition) / delta));
        range.setStepsNumber(stepsNumber);
        this.subComputeStepsNumberChange(trajectory);
        return trajectory;
    }
View Full Code Here


     * @param range the range that was modified.
     * @return the updated config. It may be another instance entirely.
     */
    // This function returns the configuration it received as parameter.
    private ITrajectory subComputeStepsNumberChange(ITrajectory newTrajectory) {
        IRange1D range = ((ITrajectory1D) newTrajectory).getRange();
        int stepsNumber = range.getStepsNumber();
        double integrationTime = range.getIntegrationTime();
        for(ITrajectory trajectory : range.getTrajectoriesList()) {
            if(trajectory.getBeginPosition() != null && trajectory.getEndPosition() != null) {
                trajectory.setDelta( Math.abs((trajectory.getEndPosition() - trajectory.getBeginPosition()) / stepsNumber ));
                trajectory.setSpeed(trajectory.getDelta() / integrationTime);
            }
        }
View Full Code Here

                    config = new Config1DImpl();
                    config.setScanAddOn(new ScanAddOnImp());
                    config.getScanAddOn().setDisplay(new DisplayImpl());
                    ((IConfig1D) config).setDimensionX(new Dimension1DImpl());
                    // Creates one range for a new 1D config.
                    IRange1D range1DToAdd = new Range1DImpl();
                    range1DToAdd.setDimension(((IConfig1D) config).getDimensionX());
                    range1DToAdd.setIntegrationTime(1.0);
                    range1DToAdd.setStepsNumber(1);
                    ((IConfig1D) config).getDimensionX().getRangesXList().add(range1DToAdd);
                    break;

                case SCAN_2D:
                    config = new Config2DImpl();
View Full Code Here

                    tmp.setScanAddOn(new ScanAddOnImp());
                    tmp.getScanAddOn().setDisplay(new DisplayImpl());
                    ((IConfig1D) tmp).setDimensionX(new Dimension1DImpl());

                    // Creates one range for a new 1D config.
                    IRange1D range1DToAdd = new Range1DImpl();
                    range1DToAdd.setDimension(((IConfig1D) tmp).getDimensionX());
                    range1DToAdd.setIntegrationTime(1.0);
                    range1DToAdd.setStepsNumber(1);
                    ((IConfig1D) tmp).getDimensionX().getRangesXList().add(range1DToAdd);
                    configModel = wrap(tmp);

                    break;
                case SCAN_2D:
View Full Code Here

    /**
     *
     */
    public void setRange(IRange1D range) {
        IRange1D oldValue = this.baseBean.getRange();
        this.baseBean.setRange(range);
        this.firePropertyChange("range", oldValue, range);
    }
View Full Code Here

                            IDimension1D dimensionX = config1d.getDimensionX();
                            List<IActuator> listActuator = dimensionX.getActuatorsList();
                            // System.out.println("Actuator Size=" + listActuator.size());
                            List<IRange1D> range1d = dimensionX.getRangesXList();
                            for (int rangeIndex = 0; rangeIndex < range1d.size(); rangeIndex++) {
                                IRange1D range1D = range1d.get(rangeIndex);
                                List<ITrajectory> listTrajectory = range1D.getTrajectoriesList();
                                int trajectorySize = listTrajectory.size();
                                if (listActuator.size() == trajectorySize) {
                                    // System.out.println("Trajectory Size=" + trajectorySize);
                                    for (int trajectoryIndex = 0; trajectoryIndex < trajectorySize; trajectoryIndex++) {
                                        IActuator actuator = listActuator.get(trajectoryIndex);
View Full Code Here

                            IDimension1D dimensionX = config1d.getDimensionX();
                            List<IActuator> listActuator = dimensionX.getActuatorsList();
                            // System.out.println("Actuator Size=" + listActuator.size());
                            List<IRange1D> range1d = dimensionX.getRangesXList();
                            for (int rangeIndex = 0; rangeIndex < range1d.size(); rangeIndex++) {
                                IRange1D range1D = range1d.get(rangeIndex);
                                List<ITrajectory> listTrajectory = range1D.getTrajectoriesList();
                                int trajectorySize = listTrajectory.size();
                                if (listActuator.size() == trajectorySize) {
                                    // System.out.println("Trajectory Size=" + trajectorySize);
                                    for (int trajectoryIndex = 0; trajectoryIndex < trajectorySize; trajectoryIndex++) {
                                        IActuator actuator = listActuator.get(trajectoryIndex);
View Full Code Here

        dim.setTrajectoriesList(new ArrayList<ITrajectory1D>());
        nc.setDimensionX(dim);

        dim.setRangesXList(new ArrayList<IRange1D>());
        for (int i = 0; i < _nbRanges; i++) {
            IRange1D r = new Range1DImpl();
            r.setDimension(dim);
            r.setIntegrationTime(4.5);
            r.setStepsNumber(100);
            List<ITrajectory> traj = new ArrayList<ITrajectory>();
            r.setTrajectoriesList(traj);
            dim.getRangesXList().add(r);
        }

        // Actuators
        for (int i = 0; i < _nbActuators; i++) {
            IActuator a = new ActuatorImpl();
            a.setName("/mon/actuator/" + i);
            a.setEnabled(i % 2 == 0);
            dim.getActuatorsList().add(a);
        }

        for (int i = 0; i < dim.getRangesXList().size(); i++) {
            for (int j = 0; j < dim.getActuatorsList().size(); j++) {
                IActuator a = dim.getActuatorsList().get(j);
                IRange1D r = dim.getRangesXList().get(i);

                ITrajectory1D t = new Trajectory1DImpl();
                t.setBeginPosition(0.0);
                t.setEndPosition(4.0);
                t.setActuator(a);
                t.setRange(r);
                r.getTrajectoriesList().add(t);
                dim.getTrajectoriesList().add(t);

            }
        }
View Full Code Here

        dim.setTrajectoriesList(new ArrayList<ITrajectory1D>());
        nc.setDimensionX(dim);
       
        dim.setRangesXList(new ArrayList<IRange1D>());
        for (int i = 0; i < _nbRanges; i++) {
            IRange1D r = new Range1DImpl();
            r.setDimension(dim);
            r.setIntegrationTime(4.5);
            r.setStepsNumber(100);
            List <ITrajectory> traj = new ArrayList<ITrajectory>();
            r.setTrajectoriesList(traj);
            dim.getRangesXList().add(r);
        }

        // Actuators
        for (int i = 0; i < _nbActuators; i++) {
            IActuator a = new ActuatorImpl();
            a.setName("/mon/actuator/" + i);
            a.setEnabled(i % 2 == 0);
            dim.getActuatorsList().add(a);
        }
       
        for(int i = 0; i< dim.getRangesXList().size(); i++) {
            for(int j = 0; j< dim.getActuatorsList().size(); j++) {
                IActuator a = dim.getActuatorsList().get(j);
                IRange1D r = dim.getRangesXList().get(i);
               
                ITrajectory1D t = new  Trajectory1DImpl();
                t.setBeginPosition(0.0);
                t.setEndPosition(4.0);
                t.setActuator(a);
                t.setRange(r);
                r.getTrajectoriesList().add(t);
                dim.getTrajectoriesList().add(t);
               
            }
        }
       
View Full Code Here

        dim.setTrajectoriesList(new ArrayList<ITrajectory1D>());
        nc.setDimensionX(dim);

        dim.setRangesXList(new ArrayList<IRange1D>());
        for (int i = 0; i < _nbRanges; i++) {
            IRange1D r = new Range1DImpl();
            r.setDimension(dim);
            r.setIntegrationTime(4.5);
            r.setStepsNumber(100);
            List<ITrajectory> traj = new ArrayList<ITrajectory>();
            r.setTrajectoriesList(traj);
            dim.getRangesXList().add(r);
        }

        // Actuators
        for (int i = 0; i < _nbActuators; i++) {
            IActuator a = new ActuatorImpl();
            a.setName("/mon/actuator/" + i);
            a.setEnabled(i % 2 == 0);
            dim.getActuatorsList().add(a);
        }

        for (int i = 0; i < dim.getRangesXList().size(); i++) {
            for (int j = 0; j < dim.getActuatorsList().size(); j++) {
                IActuator a = dim.getActuatorsList().get(j);
                IRange1D r = dim.getRangesXList().get(i);

                ITrajectory1D t = new Trajectory1DImpl();
                t.setBeginPosition(0.0);
                t.setEndPosition(4.0);
                t.setActuator(a);
                t.setRange(r);
                r.getTrajectoriesList().add(t);
                dim.getTrajectoriesList().add(t);

            }
        }
View Full Code Here

TOP

Related Classes of fr.soleil.salsa.entity.scan1d.IRange1D

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.