Examples of IDimension2DY


Examples of fr.soleil.salsa.entity.scan2D.IDimension2DY

        else if (this instanceof IDimension2DX) {
            IDimension2DX dimension2DX = ((IDimension2DX) this);
            rangeList = dimension2DX.getRangesList();
        }
        else if (this instanceof IDimension2DY) {
            IDimension2DY dimension2DY = ((IDimension2DY) this);
            rangeList = dimension2DY.getRangesList();
        }
        else if (this instanceof IDimensionEnergy) {
            IDimensionEnergy dimensionEnergy = ((IDimensionEnergy) this);
            rangeList = dimensionEnergy.getRangesEnergyList();
        }
View Full Code Here

Examples of fr.soleil.salsa.entity.scan2D.IDimension2DY

            config2DModel.setDimensionX(dimensionModel);

        }

        if (dimensionY != null) {
            IDimension2DY dimensionModel = (IDimension2DY) dimensionY.toModel();
            List<IActuator> actuatorList = dimensionY.getActuatorsList();
            List<IActuator> actuatorListModel = convertActuatorListToModel(actuatorList);
            dimensionModel.setActuatorsList(actuatorListModel);

            List<IRange2DY> rangeList = dimensionY.getRangesList();
            List<IRange2DY> rangeModelList = new ArrayList<IRange2DY>();
            for (IRange2DY range : rangeList) {
                rangeModelList.add((IRange2DY) range.toModel());
View Full Code Here

Examples of fr.soleil.salsa.entity.scan2D.IDimension2DY

        else if (dimension instanceof IDimension2DX) {
            IDimension2DX dimension2DX = ((IDimension2DX) dimension);
            rangeList = dimension2DX.getRangesList();
        }
        else if (dimension instanceof IDimension2DY) {
            IDimension2DY dimension2DY = ((IDimension2DY) dimension);
            rangeList = dimension2DY.getRangesList();
        }
        else if (dimension instanceof IDimensionEnergy) {
            IDimensionEnergy dimensionEnergy = ((IDimensionEnergy) dimension);
            rangeList = dimensionEnergy.getRangesEnergyList();
        }
View Full Code Here

Examples of fr.soleil.salsa.entity.scan2D.IDimension2DY

                                    for (int rangeid = 0; rangeid < range2DXList.size(); rangeid++) {
                                        modifyTrajectory(range2DXList.get(rangeid), actuatorList,
                                                actuatorTrajectoryMap);
                                    }

                                    IDimension2DY dimension2DY = config2d.getDimensionY();
                                    actuatorList = dimension2DY.getActuatorsList();
                                    List<IRange2DY> range2DYList = dimension2DY.getRangesList();

                                    for (int rangeid = 0; rangeid < range2DYList.size(); rangeid++) {
                                        modifyTrajectory(range2DYList.get(rangeid), actuatorList,
                                                actuatorTrajectoryMap);
                                    }
View Full Code Here

Examples of fr.soleil.salsa.entity.scan2D.IDimension2DY

                                actuator.setAttribute("to", String.valueOf(to));
                                actuators.appendChild(actuator);
                            }
                            element.appendChild(actuators);
                        }
                        IDimension2DY dimension2DY = config2d.getDimensionY();
                        List<IActuator> listActuator2DY = dimension2DY.getActuatorsList();

                        ArrayList<ITrajectory> trajectories2DY = new ArrayList<ITrajectory>();
                        List<IRange2DY> range2DY = dimension2DY.getRangesList();

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

Examples of fr.soleil.salsa.entity.scan2D.IDimension2DY

                // Actuators y
                List<IActuator> actuatorsYList;
                List<String> actuatorsNamesYList;
                String[] actuatorsNamesYArray;
                IDimension2DY dimensionY = config.getDimensionY();
                actuatorsYList = dimensionY.getActuatorsList();
                actuatorsNamesYList = new ArrayList<String>(actuatorsYList.size());
                for(IActuator actuator : actuatorsYList) {
                    if(actuator.isEnabled()) {
                        actuatorsNamesYList.add(actuator.getName());
                    }
                }
                actuatorsNamesYArray = actuatorsNamesYList.toArray(new String[actuatorsNamesYList
                        .size()]);
                setAttribute("actuators2", actuatorsNamesYArray);
               
                // Dimensions X
                // 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[] allActuatorsPositionsXArray;
                double initialValueX;
               
                // Contains the positions in order, range after range, of the trajectories of an
                // actuator.
                List<Double> actuatorPositionsXList;
                // Contains the positions in order, actuator after actuator, range after range, of
                // the trajectories of all the actuators.
                List<Double> allActuatorsPositionsXList;
                // The list of integrations times.
                List<Double> integrationsTimesXList;
                double[] integrationsTimesXArray;
                int integrationTimeIndexX;
                // The list of speeds.
                List<Double> speedXList = new ArrayList<Double>();
                double[] speedXArray;
                // The number of points, which is the total steps numbers + 1 per range.
                int totalStepsNumberX;
                // The actuators used for this dimension
                List<IActuator> dimensionActuatorsXList;
                // Tango API
                dimensionActuatorsXList = dimensionX.getActuatorsList();
                // The positions, sorted as Tango expect them.
                allActuatorsPositionsXList = new ArrayList<Double>();
                // The number of enabled actuators.
                int enabledActuatorsXNumber = 0;
                // The positions must be sorted by actuator, so we loop over the actuators.
                for(IActuator actuator : dimensionActuatorsXList) {
                    if(actuator.isEnabled()) {
                        initialValueX = ActuatorConnector.getData(actuator);
                        actuatorPositionsXList = new ArrayList<Double>();
                        // For each actuators, the positions must be sorted by range.
                        for (ITrajectory2DX trajectory : findActuatorTrajectories(dimensionX,
                                actuator)) {
                            actuatorPositionsXList
                                    .addAll(TrajectoryCalculator
                                            .calculateLinearTrajectoriesPosition(trajectory,
                                                    initialValueX));
                            // The speeds must be sorted in the same order, so we read them here.
                            speedXList.add(trajectory.getSpeed());
                        }
                        allActuatorsPositionsXList.addAll(actuatorPositionsXList);
                        ++enabledActuatorsXNumber;
                    }
                }
               
                // Integration Time and steps number.
                integrationsTimesXList = new ArrayList<Double>(dimensionX.getRangesList().size());
                int stepsNumberX;
                totalStepsNumberX = 0;
                for(IRange2DX range : dimensionX.getRangesList()) {
                    stepsNumberX = range.getStepsNumber();
                    for(integrationTimeIndexX = 0; integrationTimeIndexX < stepsNumberX + 1; ++integrationTimeIndexX) {
                        integrationsTimesXList.add(range.getIntegrationTime());
                    }
                    totalStepsNumberX += stepsNumberX + 1;
                }
                integrationsTimesXArray = toDoubleArray(integrationsTimesXList);
                setAttribute("integrationTimes", integrationsTimesXArray);
                setAttribute("pointNumber", totalStepsNumberX);
               
                // Trajectories
                // Builds the array from the list.
                allActuatorsPositionsXArray = toDoubleArray(allActuatorsPositionsXList);
                // Sends the array to Tango.
                DeviceAttribute trajectoriesXAttribute = new DeviceAttribute("trajectories");
                if(enabledActuatorsXNumber != 0) {
                    trajectoriesXAttribute.insert(allActuatorsPositionsXArray, totalStepsNumberX,
                            enabledActuatorsXNumber);
                }
                else {
                    trajectoriesXAttribute.insert(new double[] {}, 0 , 1);
                }
                scanServerProxy.write_attribute(trajectoriesXAttribute);
               
                // Speed.
                speedXArray = toDoubleArray(speedXList);
                setAttribute("scanSpeed", speedXArray);
               
                // Dimensions Y
                // 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[] allActuatorsPositionsYArray;
                double initialValueY;
               
                // Contains the positions in order, range after range, of the trajectories of an
                // actuator.
                List<Double> actuatorPositionsYList;
                // Contains the positions in order, actuator after actuator, range after range, of
                // the trajectories of all the actuators.
                List<Double> allActuatorsPositionsYList;
                // The number of points, which is the total steps numbers + 1 per range.
                int totalStepsNumberY;
                // The actuators used for this dimension
                List<IActuator> dimensionActuatorsYList;
                // Dimension
                dimensionActuatorsYList = dimensionY.getActuatorsList();
                // The positions, sorted as Tango expect them.
                allActuatorsPositionsYList = new ArrayList<Double>();
                // The number of enabled actuators.
                int enabledActuatorsYNumber = 0;
                // The positions must be sorted by actuator, so we loop over the actuators.
                for(IActuator actuator : dimensionActuatorsYList) {
                    initialValueY = ActuatorConnector.getData(actuator);
                    actuatorPositionsYList = new ArrayList<Double>();
                    // For each actuators, the positions must be sorted by range.
                    for(ITrajectory2DY trajectory : findActuatorTrajectories(dimensionY, actuator)) {
                        actuatorPositionsYList.addAll(TrajectoryCalculator
                                .calculateLinearTrajectoriesPosition(trajectory, initialValueY));
                    }
                    allActuatorsPositionsYList.addAll(actuatorPositionsYList);
                    ++enabledActuatorsYNumber;
                }
               
                // The number of points
                totalStepsNumberY = 0;
                for(IRange2DY range : dimensionY.getRangesList()) {
                    totalStepsNumberY += range.getStepsNumber() + 1;
                }
                setAttribute("pointNumber2", totalStepsNumberY);
               
                // Builds the array from the list.
View Full Code Here

Examples of fr.soleil.salsa.entity.scan2D.IDimension2DY

                // Actuators y
                List<IActuator> actuatorsYList;
                List<String> actuatorsNamesYList;
                String[] actuatorsNamesYArray;
                IDimension2DY dimensionY = config.getDimensionY();
                actuatorsYList = dimensionY.getActuatorsList();
                actuatorsNamesYList = new ArrayList<String>(actuatorsYList.size());
                for (IActuator actuator : actuatorsYList) {
                    if (actuator.isEnabled()) {
                        actuatorsNamesYList.add(actuator.getName());
                    }
                }
                actuatorsNamesYArray = actuatorsNamesYList.toArray(new String[actuatorsNamesYList
                        .size()]);
                setAttribute("actuators2", actuatorsNamesYArray);

                // Dimensions X
                // 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[] allActuatorsPositionsXArray;
                double initialValueX;

                // Contains the positions in order, range after range, of the trajectories of an
                // actuator.
                List<Double> actuatorPositionsXList;
                // Contains the positions in order, actuator after actuator, range after range, of
                // the trajectories of all the actuators.
                List<Double> allActuatorsPositionsXList;
                // The list of integrations times.
                List<Double> integrationsTimesXList;
                double[] integrationsTimesXArray;
                int integrationTimeIndexX;
                // The list of speeds.
                List<Double> speedXList = new ArrayList<Double>();
                double[] speedXArray;
                // The number of points, which is the total steps numbers + 1 per range.
                int totalStepsNumberX;
                // The actuators used for this dimension
                List<IActuator> dimensionActuatorsXList;
                // Tango API
                dimensionActuatorsXList = dimensionX.getActuatorsList();
                // The positions, sorted as Tango expect them.
                allActuatorsPositionsXList = new ArrayList<Double>();
                // The number of enabled actuators.
                int enabledActuatorsXNumber = 0;
                // The positions must be sorted by actuator, so we loop over the actuators.
                for (IActuator actuator : dimensionActuatorsXList) {
                    if (actuator.isEnabled()) {
                        initialValueX = ActuatorConnector.getData(actuator);
                        actuatorPositionsXList = new ArrayList<Double>();
                        // For each actuators, the positions must be sorted by range.
                        for (ITrajectory2DX trajectory : findActuatorTrajectories(dimensionX,
                                actuator)) {
                            actuatorPositionsXList
                                    .addAll(TrajectoryCalculator
                                            .calculateLinearTrajectoriesPosition(trajectory,
                                                    initialValueX));
                            // The speeds must be sorted in the same order, so we read them here.
                            speedXList.add(trajectory.getSpeed());
                        }
                        allActuatorsPositionsXList.addAll(actuatorPositionsXList);
                        ++enabledActuatorsXNumber;
                    }
                }

                // Integration Time and steps number.
                integrationsTimesXList = new ArrayList<Double>(dimensionX.getRangesList().size());
                int stepsNumberX;
                totalStepsNumberX = 0;
                for (IRange2DX range : dimensionX.getRangesList()) {
                    stepsNumberX = range.getStepsNumber();
                    for (integrationTimeIndexX = 0; integrationTimeIndexX < stepsNumberX + 1; ++integrationTimeIndexX) {
                        integrationsTimesXList.add(range.getIntegrationTime());
                    }
                    totalStepsNumberX += stepsNumberX + 1;
                }
                integrationsTimesXArray = toDoubleArray(integrationsTimesXList);
                setAttribute("integrationTimes", integrationsTimesXArray);
                setAttribute("pointNumber", totalStepsNumberX);

                // Trajectories
                // Builds the array from the list.
                allActuatorsPositionsXArray = toDoubleArray(allActuatorsPositionsXList);
                // Sends the array to Tango.
                DeviceAttribute trajectoriesXAttribute = new DeviceAttribute("trajectories");
                if (enabledActuatorsXNumber != 0) {
                    trajectoriesXAttribute.insert(allActuatorsPositionsXArray, totalStepsNumberX,
                            enabledActuatorsXNumber);
                }
                else {
                    trajectoriesXAttribute.insert(new double[] {}, 0, 1);
                }
                scanServerProxy.write_attribute(trajectoriesXAttribute);

                // Speed.
                speedXArray = toDoubleArray(speedXList);
                setAttribute("scanSpeed", speedXArray);

                // Dimensions Y
                // 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[] allActuatorsPositionsYArray;
                double initialValueY;

                // Contains the positions in order, range after range, of the trajectories of an
                // actuator.
                List<Double> actuatorPositionsYList;
                // Contains the positions in order, actuator after actuator, range after range, of
                // the trajectories of all the actuators.
                List<Double> allActuatorsPositionsYList;
                // The number of points, which is the total steps numbers + 1 per range.
                int totalStepsNumberY;
                // The actuators used for this dimension
                List<IActuator> dimensionActuatorsYList;
                // Dimension
                dimensionActuatorsYList = dimensionY.getActuatorsList();
                // The positions, sorted as Tango expect them.
                allActuatorsPositionsYList = new ArrayList<Double>();
                // The number of enabled actuators.
                int enabledActuatorsYNumber = 0;
                // The positions must be sorted by actuator, so we loop over the actuators.
                for (IActuator actuator : dimensionActuatorsYList) {
                    if (actuator.isEnabled()) {
                        initialValueY = ActuatorConnector.getData(actuator);
                        actuatorPositionsYList = new ArrayList<Double>();
                        // For each actuators, the positions must be sorted by range.
                        for (ITrajectory2DY trajectory : findActuatorTrajectories(dimensionY,
                                actuator)) {
                            actuatorPositionsYList
                                    .addAll(TrajectoryCalculator
                                            .calculateLinearTrajectoriesPosition(trajectory,
                                                    initialValueY));
                        }
                        allActuatorsPositionsYList.addAll(actuatorPositionsYList);
                        ++enabledActuatorsYNumber;
                    }
                }

                // The number of points
                totalStepsNumberY = 0;
                for (IRange2DY range : dimensionY.getRangesList()) {
                    totalStepsNumberY += range.getStepsNumber() + 1;
                }
                setAttribute("pointNumber2", totalStepsNumberY);

                // Builds the array from the list.
View Full Code Here

Examples of fr.soleil.salsa.entity.scan2D.IDimension2DY

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

    @Override
    public void setDimensionY(IDimension2DY dimensionY) {
        IDimension2DY oldValue = baseBean.getDimensionY();
        baseBean.setDimensionY(dimensionY);
        this.firePropertyChange("dimensionY", oldValue, dimensionY);
    }
View Full Code Here

Examples of fr.soleil.salsa.entity.scan2D.IDimension2DY

                                        }
                                    }
                                }
                            }

                            IDimension2DY dimension2DY = config2d.getDimensionY();
                            List<IActuator> listActuator2DY = dimension2DY.getActuatorsList();
                            List<IRange2DY> range2DY = dimension2DY.getRangesList();

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

Examples of fr.soleil.salsa.entity.scan2D.IDimension2DY

                                actuator.setAttribute("to", String.valueOf(to));
                                actuators.appendChild(actuator);
                            }
                            element.appendChild(actuators);
                        }
                        IDimension2DY dimension2DY = config2d.getDimensionY();
                        List<IActuator> listActuator2DY = dimension2DY.getActuatorsList();

                        ArrayList<ITrajectory> trajectories2DY = new ArrayList<ITrajectory>();
                        List<IRange2DY> range2DY = dimension2DY.getRangesList();

                        for (int i = 0; i < range2DY.size(); i++) {
                            List<ITrajectory> listTrajectory = range2DY.get(i)
                                    .getTrajectoriesList();
                            for (int j = 0; j < listTrajectory.size(); j++) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.