Package fr.soleil.salsa.entity.scan1d

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


            this.rangeModelsList.clear();
            this.actuatorModelsList.clear();
            if (view != null) {
                view.clearTrajectoriesView();
            }
            IDimension1D dimension1D = ((IConfig1D) config).getDimensionX();
            if (dimension1D != null) {
                List<IRange1D> rangeList = dimension1D.getRangesXList();
                List<IActuator> actuatorsList = dimension1D.getActuatorsList();
                if (rangeList != null) {
                    for (int i = 0; i < rangeList.size(); i++) {
                        this.rangeModelsList.add((Range1DModel) rangeList.get(i));
                    }
                }
View Full Code Here


    @Override
    public void notifyNewRangeAction() {
        if (this.config != null) {
            Range1DModel rangeToAdd = new Range1DModel();
            rangeToAdd.setDimension(((IConfig1D) config).getDimensionX());
            IDimension1D dimension = ((IConfig1D) config).getDimensionX();
            rangeToAdd.setIntegrationTime(1.0);
            rangeToAdd.setStepsNumber(1);
            this.rangeModelsList.add(rangeToAdd);
            ((IConfig1D) config).getDimensionX().getRangesXList().add(rangeToAdd);
            IRange1D range = ((IConfig1D) config).getDimensionX().getRangesXList().get(
                    ((IConfig1D) config).getDimensionX().getRangesXList().size() - 1);
            ((Range1DModel) range).addListener(listenerRange1D);

            for (int i = 0; i < this.actuatorModelsList.size(); i++) {
                Trajectory1DModel trajectory1DModelToAdd = new Trajectory1DModel();
                trajectory1DModelToAdd.setBeginPosition(0.0);
                trajectory1DModelToAdd.setEndPosition(0.0);
                trajectory1DModelToAdd.setDelta(0.0);
                trajectory1DModelToAdd.setRelative(false);
                trajectory1DModelToAdd.setSpeed(0.0);

                rangeToAdd.getTrajectoriesList().add(trajectory1DModelToAdd);
                trajectory1DModelToAdd.setRange(rangeToAdd);
                trajectory1DModelToAdd.setActuator(actuatorModelsList.get(i));

                dimension.getTrajectoriesList().add(trajectory1DModelToAdd);
                ITrajectory1D t = dimension.getTrajectoriesList().get(
                        dimension.getTrajectoriesList().size() - 1);
                ((Trajectory1DModel) t).addListener(listenerTrajectory1D);

            }
            this.trajectoryListView.addRange();
            startListening(config);
View Full Code Here

            trajectory1DModelToAdd.setDelta(0.0);
            trajectory1DModelToAdd.setRelative(false);
            trajectory1DModelToAdd.setSpeed(0.0);
            trajectory1DModelToAdd.setRange(rangeModelsList.get(i));
            this.rangeModelsList.get(i).getTrajectoriesList().add(trajectory1DModelToAdd);
            IDimension1D dimension = ((IConfig1D) config).getDimensionX();

            dimension.getTrajectoriesList().add(trajectory1DModelToAdd);
            ITrajectory1D t = dimension.getTrajectoriesList().get(
                    dimension.getTrajectoriesList().size() - 1);
            ((Trajectory1DModel) t).addListener(listenerTrajectory1D);
            ITrajectory tr = ((IConfig1D) config).getDimensionX().getRangesXList().get(i)
                    .getTrajectoriesList().get(
                            ((IConfig1D) config).getDimensionX().getRangesXList().get(i)
                                    .getTrajectoriesList().size() - 1);
View Full Code Here

        if (dimensionK == null) {
            dimensionK = new DimensionKImpl();
            configK.setDimensionX(dimensionK);
        }

        IDimension1D dimension1D = config1D.getDimensionX();
        if (dimension1D == null) {
            dimension1D = new Dimension1DImpl();
            config1D.setDimensionX(dimension1D);
        }
    }
View Full Code Here

                // Actuators
                List<IActuator> actuatorsList;
                List<String> actuatorsNamesList;
                String[] actuatorsNamesArray;
                IDimension1D dimension = config.getDimensionX();
                actuatorsList = dimension.getActuatorsList();
                actuatorsNamesList = new ArrayList<String>(actuatorsList.size());
                for (IActuator actuator : actuatorsList) {
                    if (actuator.isEnabled()) {
                        actuatorsNamesList.add(actuator.getName());
                    }
                }
                actuatorsNamesArray = actuatorsNamesList.toArray(new String[actuatorsNamesList
                        .size()]);
                setAttribute("actuators", actuatorsNamesArray);

                // Dimensions
                // Tango exchanges trajectories as double arrays that contains the positions, in
                // order,
                // actuator after actuator, range after range, of the trajectories of all the
                // actuators.
                // There is one such array per dimension.
                double[] allActuatorsPositionsArray;
                double initialValue;
                // Contains the positions in order, range after range, of the trajectories of an
                // actuator.
                List<Double> actuatorPositionsList;
                // Contains the positions in order, actuator after actuator, range after range, of
                // the trajectories of all the actuators.
                List<Double> allActuatorsPositionsList;
                // The list of integrations times.
                List<Double> integrationsTimesList;
                double[] integrationsTimesArray;
                int integrationTimeIndex;
                // The list of speeds.
                List<Double> speedList = new ArrayList<Double>();
                double[] speedArray;
                // The number of points, which is the total steps numbers + 1 per range.
                int totalStepsNumber;
                // The actuators used for this dimension
                List<IActuator> dimensionActuatorsList;
                // Dimension.
                // Initial computations.
                dimensionActuatorsList = dimension.getActuatorsList();
                // The positions, sorted as Tango expect them.
                allActuatorsPositionsList = new ArrayList<Double>();
                // The number of enabled actuators.
                int enabledActuatorsNumber = 0;
                // The positions must be sorted by actuator, so we loop over the actuators.
                for (IActuator actuator : dimensionActuatorsList) {
                    if (actuator.isEnabled()) {
                        initialValue = ActuatorConnector.getData(actuator);
                        actuatorPositionsList = new ArrayList<Double>();
                        // For each actuators, the positions must be sorted by range.
                        for (ITrajectory trajectory : findActuatorTrajectories(dimension, actuator)) {
                            actuatorPositionsList.addAll(TrajectoryCalculator
                                    .calculateLinearTrajectoriesPosition(
                                            (ITrajectory1D) trajectory, initialValue));
                            // The speeds must be sorted in the same order, so we read them here.
                            speedList.add(trajectory.getSpeed());
                        }
                        allActuatorsPositionsList.addAll(actuatorPositionsList);
                        ++enabledActuatorsNumber;
                    }
                }

                // Integration Time and steps number.
                integrationsTimesList = new ArrayList<Double>(dimension.getRangesXList().size());
                int stepsNumber;
                totalStepsNumber = 0;
                for (IRange1D range : dimension.getRangesXList()) {
                    stepsNumber = range.getStepsNumber();
                    for (integrationTimeIndex = 0; integrationTimeIndex < stepsNumber + 1; ++integrationTimeIndex) {
                        integrationsTimesList.add(range.getIntegrationTime());
                    }
                    totalStepsNumber += stepsNumber + 1;
View Full Code Here

        indent("**" + c1.getName(), _d);
        indent("  id : " + c1.getId(), _d);
        indent("  scanNumber : " + c1.getScanNumber(), _d);

        IDimension1D X = c1.getDimensionX();
        if (X != null) {
            for (int i = 0; i < X.getActuatorsList().size(); i++) {
                IActuator actuator = X.getActuatorsList().get(i);
                indent("  actuator" + i + " : " + actuator.getName()
                        + (actuator.isEnabled() ? " (on)" : " (off)"), _d);
            }
        }

View Full Code Here

                    if ((action != null) && action.equalsIgnoreCase(ILogService.START_ACTION) && (config != null)) {
                        Element actuators = document.createElement("actuators");
                        ArrayList<ITrajectory> trajectories = new ArrayList<ITrajectory>();
                        if (config instanceof IConfig1D) {
                            IConfig1D config1d = (IConfig1D) config;
                            IDimension1D dimensionX = config1d.getDimensionX();
                            List<IActuator> listActuator = dimensionX.getActuatorsList();
                            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) {
View Full Code Here

    @Override
    public List<? extends IRange> getRangeList() {
        List<? extends IRange> tmpRangeList = null;

        if (this instanceof IDimension1D) {
            IDimension1D dimension1D = ((IDimension1D) this);
            tmpRangeList = dimension1D.getRangesXList();
        } else if (this instanceof IDimension2DX) {
            IDimension2DX dimension2DX = ((IDimension2DX) this);
            tmpRangeList = dimension2DX.getRangesList();
        } else if (this instanceof IDimension2DY) {
            IDimension2DY dimension2DY = ((IDimension2DY) this);
View Full Code Here

    }

    @Override
    public void setRangeList(List<? extends IRange> arangeList) {
        if (this instanceof IDimension1D) {
            IDimension1D dimension1D = ((IDimension1D) this);
            dimension1D.setRangesXList((List<IRange1D>) arangeList);
        } else if (this instanceof IDimension2DX) {
            IDimension2DX dimension2DX = ((IDimension2DX) this);
            dimension2DX.setRangesList((List<IRange2DX>) arangeList);
        } else if (this instanceof IDimension2DY) {
            IDimension2DY dimension2DY = ((IDimension2DY) this);
View Full Code Here

        if (dimensionK == null) {
            dimensionK = new DimensionKImpl();
            configK.setDimensionX(dimensionK);
        }

        IDimension1D dimension1D = config1D.getDimensionX();
        if (dimension1D == null) {
            dimension1D = new Dimension1DImpl();
            config1D.setDimensionX(dimension1D);
        }
    }
View Full Code Here

TOP

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

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.