Package fr.soleil.salsa.entity.scan1d

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


    /**
     *
     */
    public void setDimensionX(IDimension1D dimensionX) {
        IDimension1D oldValue = this.baseBean.getDimensionX();
        this.baseBean.setDimensionX(dimensionX);
        this.firePropertyChange("dimensionX", oldValue, dimensionX);
    }
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

                    ArrayList<ITrajectory> trajectories = new ArrayList<ITrajectory>();
                    switch (config.getType()) {

                        case SCAN_1D:
                            IConfig1D config1d = (IConfig1D) config;
                            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();
                                // System.out.println("Trajectory Size=" + trajectorySize);
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

                    // Actuators

                    List<String> actuatorsNamesList;
                    String[] actuatorsNamesArray;
                    IDimension1D dimension = config.getDimensionX();
                    List<IActuator> 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 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 (int index = 0; index < actuatorsList.size(); index++) {
                        IActuator actuator = actuatorsList.get(index);
                        if (actuator.isEnabled()) {
                            initialValue = ActuatorConnector.getData(actuator);
                            actuatorPositionsList = new ArrayList<Double>();
                            // For each actuators, the positions must be sorted by range.
                            List<ITrajectory> trajectoryList = findActuatorTrajectories(dimension,
                                    index);
                            for (ITrajectory trajectory : trajectoryList) {
                                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());
                                // speedList.addAll(TrajectoryCalculator
                                // .calculateScanSpeedList(trajectory));
                            }
                            // System.out.println(actuator.getName() + "="
                            // + Arrays.toString(actuatorPositionsList.toArray()));
                            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

    @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);

            }
            if (view != null) {
                view.addRange();
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

                    // Actuators

                    List<String> actuatorsNamesList;
                    String[] actuatorsNamesArray;
                    IDimension1D dimension = config.getDimensionX();
                    List<IActuator> 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 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 (int index = 0; index < actuatorsList.size(); index++) {
                        IActuator actuator = actuatorsList.get(index);
                        if (actuator.isEnabled()) {
                            initialValue = ActuatorConnector.getData(actuator);
                            actuatorPositionsList = new ArrayList<Double>();
                            // For each actuators, the positions must be sorted by range.
                            List<ITrajectory> trajectoryList = findActuatorTrajectories(dimension,
                                    index);
                            for (ITrajectory trajectory : trajectoryList) {
                                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());
                            }
                            // System.out.println(actuator.getName() + "="
                            // + Arrays.toString(actuatorPositionsList.toArray()));
                            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

                    ArrayList<ITrajectory> trajectories = new ArrayList<ITrajectory>();
                    switch (config.getType()) {

                        case SCAN_1D:
                            IConfig1D config1d = (IConfig1D) config;
                            IDimension1D dimensionX = config1d.getDimensionX();
                            List<IActuator> listActuator = dimensionX.getActuatorsList();
                            List<IRange1D> range1d = dimensionX.getRangesXList();

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

            Element actuators = document.createElement("actuators");
            switch (config.getType()) {

                case SCAN_1D:
                    IConfig1D config1d = (IConfig1D) config;
                    IDimension1D dimensionX = config1d.getDimensionX();
                    List<IActuator> listActuator = dimensionX.getActuatorsList();
                    ArrayList<ITrajectory> trajectories = new ArrayList<ITrajectory>();
                    List<IRange1D> range1d = dimensionX.getRangesXList();

                    for (int i = 0; i < range1d.size(); i++) {
                        List<ITrajectory> listTrajectory = range1d.get(i).getTrajectoriesList();
                        for (int j = 0; j < listTrajectory.size(); j++) {
                            TrajectoryImpl trajectory = new TrajectoryImpl();
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.