Package fr.soleil.salsa.entity.scan1d

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


    // IConfigMathService may behave differently.
    public ITrajectory computeEndPositionChange(ITrajectory trajectory, boolean deltaLock) {
        assert (trajectory.getBeginPosition() != null);
        double beginPosition = trajectory.getBeginPosition();
        double endPosition = trajectory.getEndPosition();
        IRange1D range = ((ITrajectory1D) trajectory).getRange();
        if (deltaLock) {
            double delta = trajectory.getDelta();
            int stepsNumber = (int) Math.abs(Math.round((endPosition - beginPosition) / delta));
            range.setStepsNumber(stepsNumber);
            this.subComputeStepsNumberChange(trajectory);
        }
        else {
            int stepsNumber = range.getStepsNumber();
            double delta = Math.abs((endPosition - beginPosition) / stepsNumber);
            trajectory.setDelta(delta);
            trajectory.setSpeed(delta / range.getIntegrationTime());
        }
        return trajectory;
    }
View Full Code Here


     */
    // 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

                    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

                    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

                    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

     */
    public void refresh() {
        if (this.rangeModelsList != null && this.actuatorModelsList != null && view != null) {

            for (int j = 0; j < ((IConfig1D) config).getDimensionX().getRangesXList().size(); j++) {
                IRange1D r = ((IConfig1D) config).getDimensionX().getRangesXList().get(j);
                view.setIntegrationTime(j, r.getIntegrationTime() + "");
                view.setStepNumber(j, r.getStepsNumber() + "");
            }

            for (int i = 0; i < ((IConfig1D) config).getDimensionX().getRangesXList().size(); i++) {
                for (int j = 0; j < ((IConfig1D) config).getDimensionX().getRangesXList().get(i)
                        .getTrajectoriesList().size(); j++) {
View Full Code Here

        if (this.rangeModelsList.size() == 0) {
            this.notifyNewRangeAction();
        }
        for (int i = 0; i < this.rangeModelsList.size(); i++) {
            Range1DModel range = rangeModelsList.get(i);
            IRange1D range1D = range1DList.get(i);
            Trajectory1DModel trajectory1DModelToAdd = new Trajectory1DModel();
            trajectory1DModelToAdd.setBeginPosition(0.0);
            trajectory1DModelToAdd.setEndPosition(0.0);
            trajectory1DModelToAdd.setDelta(0.0);
            trajectory1DModelToAdd.setRelative(false);
            trajectory1DModelToAdd.setSpeed(0.0);
            trajectory1DModelToAdd.setRange(rangeModelsList.get(i));
            range.getTrajectoriesList().add(trajectory1DModelToAdd);
            range1D.getTrajectoriesList().add(trajectory1DModelToAdd);
            dimension.getTrajectoriesList().add(trajectory1DModelToAdd);
            trajectory1DModelToAdd.addListener(listenerTrajectory1D);
            trajectory1DModelToAdd.setActuator(actuatorModel);
        }
        this.notifyAddActuator(actuatorModel.getName(), true);
View Full Code Here

     */
    public void refresh() {
        if (this.rangeModelsList != null && this.actuatorModelsList != null) {

            for (int j = 0; j < ((IConfig1D) config).getDimensionX().getRangesXList().size(); j++) {
                IRange1D r = ((IConfig1D) config).getDimensionX().getRangesXList().get(j);
                trajectoryListView.setIntegrationTime(j, r.getIntegrationTime() + "");
                trajectoryListView.setStepNumber(j, r.getStepsNumber() + "");
            }

            for (int i = 0; i < ((IConfig1D) config).getDimensionX().getRangesXList().size(); i++)
                for (int j = 0; j < ((IConfig1D) config).getDimensionX().getRangesXList().get(i)
                        .getTrajectoriesList().size(); j++) {
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.