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 = (ITrajectoryK) AutoCopier.toImpl(trajectory);
        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 = (ITrajectoryK) AutoCopier.toImpl(trajectory);
        ITrajectoryK result = (ITrajectoryK) ConfigKApi.computeE2Change(trajectoryImpl);
        swapTrajectory(trajectory, result);
    }
View Full Code Here

                int enabledActuatorsNumber = 0;

                if (dimension instanceof IDimensionK) {
                    enabledActuatorsNumber = 1;

                    ITrajectoryK trajectoryK = ((IDimensionK) dimension).getRangeX().getTrajectory();

                    allActuatorsPositionsArray = TrajectoryCalculator.calculateKTrajectoriesPosition(trajectoryK);
                    // System.out.println("K Trajectory="
                    // + Arrays.toString(trajectoriesPositionsArray));
                    // System.out.println("K Trajectory size=" +
                    // trajectoriesPositionsArray.length);
                    integrationsTimesArray = TrajectoryCalculator.calculateIntegrationTimesK(trajectoryK);
                    // System.out.println("K integration size=" +
                    // integrationsTimesArray.length);
                    // System.out.println("K integration=" +
                    // Arrays.toString(integrationsTimesArray));
                    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 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

     */
    public void setConfig(IConfig<?> config) {
        if (this.config != config) {
            if (config != null && config instanceof IConfigK) {
                this.setViewVisible(true);
                ITrajectoryK iTrajectoryK = ((IConfigK) config).getDimensionX().getTrajectory();
                IRangeK iRangeK = ((IConfigK) config).getDimensionX().getRangeX();
                if (iTrajectoryK != null) {
                    this.config = config;
                    this.trajectoryKModel = null;
                    this.trajectoryKModel = (TrajectoryKModel) iTrajectoryK;
View Full Code Here

    /**
     * Writes the trajectory data from the config into the view.
     */
    public void refresh() {
        if (this.trajectoryKModel != null) {
            ITrajectoryK trajectory = ((IConfigK) config).getDimensionX().getTrajectory();

            // Pre Edge Parameters
            this.view.setEMinField(trajectory.getEMin() + "");
            this.view.setEDeltaPreEdgeField(trajectory.getEDeltaPreEdge() + "");
            this.view.setTimePreEdgeField(trajectory.getTimePreEdge() + "");

            // Edge Parameters
            this.view.setE0Field(trajectory.getE0() + "");
            this.view.setE1Field(trajectory.getE1() + "");
            this.view.setE2Field(trajectory.getE2() + "");
            this.view.setEDeltaEdgeField(trajectory.getEDeltaEdge() + "");
            this.view.setTimeEdgeField(trajectory.getTimeEdge() + "");

            // Connexion Parameter
            this.view.setMField(trajectory.getM() + "");

            // Pre Edge Parameters
            this.view.setKMin(trajectory.getKMin() + "");
            this.view.setKMaxField(trajectory.getKMax() + "");
            this.view.setKDeltaField(trajectory.getKDelta() + "");
            this.view.setTimePostEdgeField(trajectory.getTimePostEdge() + "");
            this.view.setNField(trajectory.getN() + "");

        }
    }
View Full Code Here

    /**
     * Reads the trajectory data from the view and writes it in the config.
     */
    public void read() {
        if (this.config != null) {
            ITrajectoryK trajectory = ((IConfigK) config).getDimensionX().getTrajectory();

            // Pre Edge Parameters
            trajectory.setEMin(view.getEMin());
            trajectory.setEDeltaPreEdge(view.getEDeltaPreEdge());
            trajectory.setTimePreEdge(view.getTimePreEdge());

            // Edge Parameters
            trajectory.setE0(view.getE0());
            trajectory.setE1(view.getE1());
            trajectory.setE2(view.getE2());
            trajectory.setEDeltaEdge(view.getEDeltaEdge());
            trajectory.setTimeEdge(view.getTimeEdge());

            // Connexion Parameter
            trajectory.setM(view.getM());

            // Post Edge Parameters
            trajectory.setKMin(view.getKMin());
            trajectory.setKMax(view.getKMax());
            trajectory.setKDelta(view.getKDelta());
            trajectory.setTimePostEdge(view.getTimePostEdge());
            trajectory.setN(view.getN());

        }
    }
View Full Code Here

    /**
     * Writes config into model.
     */
    public void write() {
        if (this.config != null) {
            ITrajectoryK trajectory = ((IConfigK) config).getDimensionX().getTrajectory();
            if (this.trajectoryKModel == null) {
                trajectoryKModel = new TrajectoryKModel();
            }

            // Pre Edge Parameters
            trajectoryKModel.setEMin(trajectory.getEMin());
            trajectoryKModel.setEDeltaPreEdge(trajectory.getEDeltaPreEdge());
            trajectoryKModel.setTimePreEdge(trajectory.getTimePreEdge());

            // Edge Parameters
            trajectoryKModel.setE0(trajectory.getE0());
            trajectoryKModel.setE1(trajectory.getE1());
            trajectoryKModel.setE2(trajectory.getE2());
            trajectoryKModel.setEDeltaEdge(trajectory.getEDeltaEdge());
            trajectoryKModel.setTimeEdge(trajectory.getTimeEdge());

            // Connexion Parameter
            trajectoryKModel.setM(trajectory.getM());

            // Post Edge Parameters
            trajectoryKModel.setKMin(trajectory.getKMin());
            trajectoryKModel.setKMax(trajectory.getKMax());
            trajectoryKModel.setKDelta(trajectory.getKDelta());
            trajectoryKModel.setTimePostEdge(trajectory.getTimePostEdge());
            trajectoryKModel.setN(trajectory.getN());
            ConfigChangeListener.getInstance().startListening(config);
            ConfigChangeListener.getInstance().configChanged();
        }
    }
View Full Code Here

    @Override
    public void notifyEminFieldChange(Double value) {
        if (config == null)
            return;

        ITrajectoryK trajectory = ((IConfigK) config).getDimensionX().getTrajectory();
        if (trajectory != null) {
            trajectory.setEMin(value);
            write();
            refresh();
        }
    }
View Full Code Here

    @Override
    public void notifyEDeltaPreEdgeFieldChange(Double value) {
        if (config == null)
            return;

        ITrajectoryK trajectory = ((IConfigK) config).getDimensionX().getTrajectory();
        if (trajectory != null) {
            trajectory.setEDeltaPreEdge(value);
            write();
            refresh();
        }

    }
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.