Package fr.soleil.salsa.entity.scanenergy

Examples of fr.soleil.salsa.entity.scanenergy.IRangeEnergy


            return;
        }

        IDimensionEnergy dimensionEnergy = config.getDimensionEnergy();
        List<IRangeEnergy> rangesList = dimensionEnergy.getRangesEnergyList();
        IRangeEnergy rangeEnergy = rangesList.get(row);
        ITrajectoryEnergy trajectoryEnergy = (ITrajectoryEnergy) rangeEnergy.getTrajectoriesList()
                .get(0);

        if (stepsNumber == rangeEnergy.getStepsNumber()) {
            return;
        }

        rangeEnergy.setStepsNumber(stepsNumber);

        ConfigEnergyApiClient.computeStepsNumberChange(trajectoryEnergy);

        refresh();
    }
View Full Code Here


        if (config != null) {
            IDimensionEnergy dimensionEnergy = config.getDimensionEnergy();
            List<IActuator> actuatorsList = dimensionEnergy.getActuatorsList();
            if (actuatorsList.size() != 0) {
                IActuator actuator = actuatorsList.get(0);
                IRangeEnergy rangeEnergy = createRange(dimensionEnergy);
                ITrajectoryEnergy trajectoryEnergy = createTrajectory(rangeEnergy, actuator);
                List<ITrajectory> trajectoriesList = rangeEnergy.getTrajectoriesList();
                if (trajectoriesList == null) {
                    trajectoriesList = new ArrayList<ITrajectory>();
                    rangeEnergy.setTrajectoriesList(trajectoriesList);
                }
                rangeEnergy.getTrajectoriesList().add(trajectoryEnergy);
                dimensionEnergy.getRangesEnergyList().add(rangeEnergy);
            }
        }
        refresh();
    }
View Full Code Here

        this.firePropertyChange("actuator", oldValue, actuator);
    }

    @Override
    public void setRange(IRangeEnergy range) {
        IRangeEnergy oldValue = this.baseBean.getRange();
        this.baseBean.setRange(range);
        this.firePropertyChange("range", oldValue, range);
    }
View Full Code Here

        this.firePropertyChange("actuator", oldValue, actuator);
    }

    @Override
    public void setRange(IRangeEnergy range) {
        IRangeEnergy oldValue = this.baseBean.getRange();
        this.baseBean.setRange(range);
        this.firePropertyChange("range", oldValue, range);
    }
View Full Code Here

     * @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 computeIntegrationTimeChange(ITrajectory newTrajectory) {
        IRangeEnergy range = ((ITrajectoryEnergy) newTrajectory).getRange();
        double integrationTime = range.getIntegrationTime();
        for(ITrajectory trajectory : range.getTrajectoriesList()) {
            if(trajectory.getDelta() != null) {
                trajectory.setSpeed(trajectory.getDelta() / integrationTime);
            }
        }
        return newTrajectory;
View Full Code Here

       
        assert(trajectory.getEndPosition() != null);

        double beginPosition = trajectory.getBeginPosition();
        double endPosition = trajectory.getEndPosition();
        IRangeEnergy range = ((ITrajectoryEnergy) trajectory).getRange();
        if(endPosition == 0){
            endPosition = beginPosition;
            trajectory.setEndPosition(endPosition);
            trajectory.setDelta(0.0);
        }       
        else if(range != null){
            if(deltaLock) {
                double delta = trajectory.getDelta();
                if(delta != 0) {
                    double steps = Math.abs((endPosition - beginPosition) / delta);
                    int stepsNumber = (int) Math.round(steps);               
                    range.setStepsNumber(stepsNumber);
                    delta = Math.abs((beginPosition - endPosition) / stepsNumber);
                    trajectory.setDelta(delta);
                }
            }
            else {
                int stepsNumber = range.getStepsNumber();
                double delta = Math.abs((beginPosition - endPosition) / stepsNumber);
                trajectory.setDelta(delta);
               
            }
           
View Full Code Here

        double beginPosition = trajectory.getBeginPosition();
        double endPosition = trajectory.getEndPosition();
       
        trajectory.setSpeed(this.subComputeSpeedChange(trajectory));
       
        IRangeEnergy range = ((ITrajectoryEnergy) trajectory).getRange();
        if(range != null){
            if(deltaLock) {
                double delta = trajectory.getDelta();
                if(delta != 0) {
                    double steps = Math.abs((endPosition - beginPosition) / delta);
                    int stepsNumber = (int) Math.round(steps);               
                    range.setStepsNumber(stepsNumber);
                    delta = Math.abs((beginPosition - endPosition) / stepsNumber);
                    trajectory.setDelta(delta);   
                }
            }
            else {
                int stepsNumber = range.getStepsNumber();
                double delta = Math.abs((beginPosition - endPosition) / stepsNumber);
                trajectory.setDelta(delta);               
            }
        }
        return trajectory;
View Full Code Here

    private ITrajectory subComputeDeltaChange(ITrajectory trajectory, boolean deltaLock) {
        double beginPosition = trajectory.getBeginPosition();
        double endPosition = trajectory.getEndPosition();
        double delta = trajectory.getDelta();

        IRangeEnergy range = ((ITrajectoryEnergy) trajectory).getRange();
   
        // Update step number
        if (deltaLock && range != null) {
            double steps = Math.abs((endPosition - beginPosition) / delta);
            int stepsNumber = (int) Math.round(steps);
            range.setStepsNumber(stepsNumber);

        }
       
        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) {
        IRangeEnergy range = ((ITrajectoryEnergy) 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

        return newTrajectory;
    }   

    private double subComputeSpeedChange(ITrajectory newTrajectory){
        IRangeEnergy range = ((ITrajectoryEnergy) newTrajectory).getRange();
        int stepsNumber = range.getStepsNumber();
        double integrationTime = range.getIntegrationTime();
        double    delta = Math.abs((newTrajectory.getEndPosition() - newTrajectory.getBeginPosition()) / (stepsNumber*integrationTime));       
       
        return delta;
    }
View Full Code Here

TOP

Related Classes of fr.soleil.salsa.entity.scanenergy.IRangeEnergy

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.