Package fr.soleil.salsa.entity.scank

Examples of fr.soleil.salsa.entity.scank.ITrajectoryK


     * @param trajectory the trajectory that was modified.
     * @return the updated config.
     */
    public static void computeE0Change(ITrajectoryK trajectory) {

        ITrajectoryK trajectoryImpl = AutoCopier.toImpl(trajectory, ITrajectoryK.class);
        ITrajectoryK result = (ITrajectoryK) ConfigKApi.computeE0Change(trajectoryImpl);

        swapTrajectory(trajectory, result);

    }
View Full Code Here


     *
     * @param trajectory the trajectory that was modified.
     * @return the updated config.
     */
    public static void computeE2Change(ITrajectoryK trajectory) {
        ITrajectoryK trajectoryImpl = AutoCopier.toImpl(trajectory, ITrajectoryK.class);
        ITrajectoryK result = (ITrajectoryK) ConfigKApi.computeE2Change(trajectoryImpl);
        swapTrajectory(trajectory, result);
    }
View Full Code Here

    private static String getTrajectoryToString(ITrajectory trajectory) {
        StringBuilder stringBuilder = new StringBuilder();
        if (trajectory != null) {
            stringBuilder.append(trajectory.getName());
            if (trajectory instanceof ITrajectoryK) {
                ITrajectoryK trajectoryK = (ITrajectoryK) trajectory;
                stringBuilder.append(" e0 ");
                stringBuilder.append(trajectoryK.getE0());
                stringBuilder.append(" e1 ");
                stringBuilder.append(trajectoryK.getE1());
                stringBuilder.append(" e2 ");
                stringBuilder.append(trajectoryK.getE2());
                stringBuilder.append(" edeltaedge ");
                stringBuilder.append(trajectoryK.getEDeltaEdge());
                stringBuilder.append(" edeltapreEdge ");
                stringBuilder.append(trajectoryK.getEDeltaPreEdge());
                stringBuilder.append(" emin ");
                stringBuilder.append(trajectoryK.getEMin());
                stringBuilder.append(" kdelta ");
                stringBuilder.append(trajectoryK.getKDelta());
                stringBuilder.append(" kmax ");
                stringBuilder.append(trajectoryK.getKMax());
                stringBuilder.append(" kmin ");
                stringBuilder.append(trajectoryK.getKMin());
                stringBuilder.append(" m ");
                stringBuilder.append(trajectoryK.getM());
                stringBuilder.append(" n ");
                stringBuilder.append(trajectoryK.getN());
            }
            else {
                stringBuilder.append(" from ");
                stringBuilder.append(trajectory.getBeginPosition());
                stringBuilder.append(" to ");
View Full Code Here

                setAttribute("actuators", actuatorsNamesArray);
               
                // Dimension
                // A scan K has a single dimension, a single range, a single trajectory.
               
                ITrajectoryK trajectoryK = config.getDimensionX().getRangeX().getTrajectory();
                double[] trajectoriesPositionsArray = TrajectoryCalculator.calculateKTrajectoriesPosition(trajectoryK);
                double[] integrationsTimesArray = TrajectoryCalculator.calculateIntegrationTimesK(trajectoryK);
                int pointNumber = trajectoriesPositionsArray.length;
                setAttribute("pointNumber", pointNumber);
                DeviceAttribute trajectoriesAttribute = new DeviceAttribute("trajectories");
View Full Code Here

                // The number of enabled actuators.
                int enabledActuatorsNumber = 0;

                if (dimension instanceof IDimensionK) {
                    enabledActuatorsNumber = 1;
                    ITrajectoryK trajectoryK = ((IDimensionK) dimension).getRangeX().getTrajectory();
                    allActuatorsPositionsArray = TrajectoryCalculator.calculateKTrajectoriesPosition(trajectoryK);
                    integrationsTimesArray = TrajectoryCalculator.calculateIntegrationTimesK(trajectoryK);
                    totalStepsNumber = allActuatorsPositionsArray.length;
                    speedList.add(trajectoryK.getSpeed());
                } else {
                    // 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);
View Full Code Here

    private void modifyTrajectory(ITrajectory source, ITrajectory dest) {
        if ((source != null) && (dest != null)) {
            dest.setRelative(false);
            if ((source instanceof ITrajectoryK) && (dest instanceof ITrajectoryK)) {
                ITrajectoryK trajectoryKdest = (ITrajectoryK) dest;
                ITrajectoryK trajectoryKsource = (ITrajectoryK) source;
                trajectoryKdest.setE0(trajectoryKsource.getE0());
                trajectoryKdest.setE1(trajectoryKsource.getE1());
                trajectoryKdest.setE2(trajectoryKsource.getE2());
                trajectoryKdest.setEDeltaEdge(trajectoryKsource.getEDeltaEdge());
                trajectoryKdest.setEDeltaPreEdge(trajectoryKsource.getEDeltaPreEdge());
                trajectoryKdest.setEMin(trajectoryKsource.getEMin());
                trajectoryKdest.setKDelta(trajectoryKsource.getKDelta());
                trajectoryKdest.setKMax(trajectoryKsource.getKMax());
                trajectoryKdest.setKMin(trajectoryKsource.getKMin());
                trajectoryKdest.setM(trajectoryKsource.getM());
                trajectoryKdest.setN(trajectoryKsource.getN());
            }
            else {
                dest.setBeginPosition(source.getBeginPosition());
                dest.setEndPosition(source.getEndPosition());
                dest.setDelta(source.getDelta());
View Full Code Here

        if (obj1 == null && obj2 == null) {
            equals = true;
        } else if (obj1 != null && obj2 != null) {
            boolean ktrajectoryEquals = true;
            if ((obj1 instanceof ITrajectoryK) && (obj2 instanceof ITrajectoryK)) {
                ITrajectoryK trajK1 = (ITrajectoryK) obj1;
                ITrajectoryK trajK2 = (ITrajectoryK) obj2;
                if (!ObjectUtils.sameObject(trajK1.getE0(), trajK2.getE0())
                        || !ObjectUtils.sameObject(trajK1.getE1(), trajK2.getE1())
                        || !ObjectUtils.sameObject(trajK1.getE2(), trajK2.getE2())
                        || (trajK1.getEDeltaEdge() != trajK2.getEDeltaEdge())
                        || !ObjectUtils.sameObject(trajK1.getEDeltaPreEdge(), trajK2.getEDeltaPreEdge())
                        || !ObjectUtils.sameObject(trajK1.getEMin(), trajK2.getEMin())
                        || !ObjectUtils.sameObject(trajK1.getKDelta(), trajK2.getKDelta())
                        || !ObjectUtils.sameObject(trajK1.getKMax(), trajK2.getKMax())
                        || !ObjectUtils.sameObject(trajK1.getKMin(), trajK2.getKMin())
                        || !ObjectUtils.sameObject(trajK1.getM(), trajK2.getM())
                        || !ObjectUtils.sameObject(trajK1.getN(), trajK2.getN())
                        || !ObjectUtils.sameObject(trajK1.getTimeEdge(), trajK2.getTimeEdge())
                        || !ObjectUtils.sameObject(trajK1.getTimePostEdge(), trajK2.getTimePostEdge())
                        || !ObjectUtils.sameObject(trajK1.getTimePreEdge(), trajK2.getTimePreEdge())) {
                    ktrajectoryEquals = false;
                }
            }
            if (ktrajectoryEquals && ObjectUtils.sameObject(obj1.getBeginPosition(), obj2.getBeginPosition())
                    && ObjectUtils.sameObject(obj1.getBeginPosition(), obj2.getBeginPosition())
View Full Code Here

    /**
     *
     */
    public void setTrajectory(ITrajectoryK trajectory) {
        ITrajectoryK oldValue = this.baseBean.getTrajectory();
        this.baseBean.setTrajectory(trajectory);
        this.firePropertyChange("trajectories", oldValue, trajectory);
    }
View Full Code Here

                        ((ActuatorModel) actuator).addListener(listenerActuator);
                    }
                    IRangeK rangeK = dimensionKModel.getRangeX();
                    ((RangeKModel) rangeK).addListener(listenerRangeK);

                    ITrajectoryK trajectoryK = dimensionKModel.getTrajectory();
                    ((TrajectoryKModel) trajectoryK).addListener(listenerTrajectoryK);

                    break;
                default:
                    throw new RuntimeException("Type not supported");
View Full Code Here

                        ((ActuatorModel) actuator).removeListener(listenerActuator);
                    }
                    IRangeK rangeK = dimensionKModel.getRangeX();
                    ((RangeKModel) rangeK).removeListener(listenerRangeK);

                    ITrajectoryK trajectoryK = dimensionKModel.getTrajectory();
                    ((TrajectoryKModel) trajectoryK).removeListener(listenerTrajectoryK);
                    break;

                default:
                    throw new RuntimeException("Type not supported");
View Full Code Here

TOP

Related Classes of fr.soleil.salsa.entity.scank.ITrajectoryK

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.