Package fr.soleil.salsa.entity

Examples of fr.soleil.salsa.entity.IActuator


                    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);
View Full Code Here


                        actuatorsXNamesArray[actuatorXIndex] = actuatorsXNamesArrayTmp[actuatorXIndex];
                    }

                    String[] actuatorsXValueKeysArray = scanServerProxy.read_attribute(
                            "actuatorsDataList").extractStringArray();
                    IActuator actuatorX;
                    String actuatorXValueKey;
                    double[] actuatorXValuesArray;
                    for (int actuatorXIndex = 0; actuatorXIndex < actuatorsXNamesArray.length
                            && actuatorXIndex < actuatorsXValueKeysArray.length; ++actuatorXIndex) {
                        actuatorXName = actuatorsXNamesArray[actuatorXIndex];
                        actuatorX = new ActuatorImpl();
                        actuatorX.setName(actuatorXName);
                        actuatorX.setEnabled(true);
                        scanResult.getActuatorsXList().add(actuatorX);

                        actuatorXValueKey = actuatorsXValueKeysArray[actuatorXIndex];

                        attribute = new TangoAttribute(scanServerName + "/" + actuatorXValueKey);
                        actuatorXValuesArray = (double[]) attribute.readArray(Double.TYPE);
                        actuatorX.setScanServerAttributeName(scanServerProxy.get_name() + "/"
                                + actuatorXValueKey);

                        pointIndex = 0;
                        for (double actuatorXValue : actuatorXValuesArray) {
                            // The reading can occur during the scan. Because of this, more values
View Full Code Here

                Map<ISensor, DataArray> dataSensorMap = new HashMap<ISensor, DataArray>();
                Map<IActuator, DataArray> dataActuatorMap = new HashMap<IActuator, DataArray>();
                DataArray dataTime = null;
                Object component;
                ISensor sensorComponent;
                IActuator actuatorComponent;
                for (String dataName : yAxisComponents) {
                    component = getComponent(scanResult, dataName);
                    if (component instanceof ISensor) {
                        sensorComponent = (ISensor) component;
                        DataArray dataArray = new DataArray();
                        dataArray.setId(sensorComponent.getName());
                        dataArray.setDisplayName(sensorComponent.getName());
                        dataArray.setFormat(getFormat());
                        dataArray.setReadOnly(true);
                        dataList.add(dataArray);
                        dataSensorMap.put(sensorComponent, dataArray);
                    }
                    else if (component instanceof IActuator) {
                        actuatorComponent = (IActuator) component;
                        DataArray dataArray = new DataArray();
                        dataArray.setId(actuatorComponent.getName());
                        dataArray.setDisplayName(actuatorComponent.getName());
                        dataArray.setFormat(getFormat());
                        dataArray.setReadOnly(true);
                        dataList.add(dataArray);
                        dataActuatorMap.put(actuatorComponent, dataArray);
                    }
                    else {
                        dataTime = new DataArray();
                        dataTime.setId(dataName);
                        dataTime.setDisplayName(dataName);
                        dataTime.setFormat(getFormat());
                        dataTime.setReadOnly(true);
                        dataList.add(dataTime);
                    }
                }

                Object xComponent = getComponent(scanResult, xAxisComponent);

                List<IScanPoint> scanPointList = scanResult.getScanPointsList();
                Double xx;
                DataArray dataArray;
                Point point;
                ISensor sensor;
                IActuator actuator;
                for (IScanPoint scanPoint : scanPointList) {
                    if (xComponent instanceof IActuator) {
                        xx = scanPoint.getValue((IActuator) xComponent);
                    }
                    else if (xComponent instanceof ISensor) {
View Full Code Here

                    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 (int index = 0; index < dimensionActuatorsXList.size(); index++) {
                        IActuator actuator = dimensionActuatorsXList.get(index);
                        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,
                                    index)) {
                                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 = 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 (int index = 0; index < dimensionActuatorsYList.size(); index++) {
                        IActuator actuator = dimensionActuatorsYList.get(index);
                        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,
                                    index)) {
View Full Code Here

    /**
     *
     */
    public void setActuator(IActuator actuator) {
        IActuator oldValue = this.baseBean.getActuator();
        this.baseBean.setActuator(actuator);
        this.firePropertyChange("actuator", oldValue, actuator);
    }
View Full Code Here

                    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);
View Full Code Here

        return this.baseBean.getRange();
    }

    @Override
    public void setActuator(IActuator actuator) {
        IActuator oldValue = this.baseBean.getActuator();
        this.baseBean.setActuator(actuator);
        this.firePropertyChange("actuator", oldValue, actuator);
    }
View Full Code Here

    /**
     *
     */
    public void setActuator(IActuator actuator) {
        IActuator oldValue = this.baseBean.getActuator();
        this.baseBean.setActuator(actuator);
        this.firePropertyChange("actuator", oldValue, actuator);
    }
View Full Code Here

                if (trajectoryList != null) {
                    List<ITrajectory> trajectoryModelList = new ArrayList<ITrajectory>();
                    for (ITrajectory trajectory : trajectoryList) {
                        ITrajectory trajectoryModel = trajectory.toModel();
                        if (trajectoryModel instanceof IActuatorTrajectory) {
                            IActuator actuator = ((IActuatorTrajectory) trajectory).getActuator();
                            ((IActuatorTrajectory) trajectoryModel)
                                    .setActuator((IActuator) actuator.toModel());
                        }
                        setRange(trajectory, this);
                        trajectoryModelList.add(trajectoryModel);
                    }
                    model.setTrajectoriesList(trajectoryModelList);
View Full Code Here

                    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 < dimensionActuatorsList.size(); index++) {
                        IActuator actuator = dimensionActuatorsList.get(index);
                        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, index)) {
                                actuatorPositionsList.addAll(TrajectoryCalculator
View Full Code Here

TOP

Related Classes of fr.soleil.salsa.entity.IActuator

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.