Package fr.soleil.salsa.entity.scan1d

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


                    ((IEventSource<EntityPropertyChangedEvent<IActuator>>) actuatorListener
                            .getActuator()).removeListener(actuatorListener);
                }
                if (this.config instanceof IConfig1D) {

                    IConfig1D config1D = (IConfig1D) this.config;
                    IDimension dimension = config1D.getDimensionX();
                    if (dimension != null) {
                        ((IEventSource<EntityPropertyChangedEvent<? extends IDimension>>) dimensionListener
                                .getDimension()).removeListener(dimensionListener);
                    }

                }
                else if (this.config instanceof IConfig2D) {
                    IConfig2D config2D = (IConfig2D) this.config;
                    IDimension dimension;
                    if (this.yActuator) {
                        dimension = config2D.getDimensionY();
                    }
                    else {
                        dimension = config2D.getDimensionX();
                    }
                    if (dimension != null) {
                        ((IEventSource<EntityPropertyChangedEvent<? extends IDimension>>) dimensionListener
                                .getDimension()).removeListener(dimensionListener);
                    }
                }
                else if (this.config instanceof IConfigEnergy) {
                    IConfigEnergy configEnergy = (IConfigEnergy) this.config;
                    IDimension dimension = configEnergy.getDimensionEnergy();
                    if (dimension != null) {
                        ((IEventSource<EntityPropertyChangedEvent<? extends IDimension>>) dimensionListener
                                .getDimension()).removeListener(dimensionListener);
                    }
                }
            }
            this.config = config;
            actuatorListenersList.clear();
            if (config != null) {
                ((IEventSource<EntityPropertyChangedEvent<IConfig>>) this.config)
                        .addListener(configListener);

                if (config instanceof IConfig1D) {
                    IConfig1D config1D = (IConfig1D) config;
                    this.setViewVisible(true);
                    listActuator = config1D.getDimensionX().getActuatorsList();

                    IDimension dimension = config1D.getDimensionX();
                    if (dimension != null) {
                        dimensionListener = new DimensionListener(dimension);
                        ((IEventSource<EntityPropertyChangedEvent<? extends IDimension>>) dimension)
                                .addListener(dimensionListener);
                    }
View Full Code Here


                        if (!actuatorTrajectoryMap.isEmpty()) {
                            switch (config.getType()) {

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

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

                element.setAttribute("nexusFile", "");
                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++) {
View Full Code Here

    public static void showScan(IConfig<?> _c, int _d) {

        // IConfig1D _c1 = (IConfig1D) _c;

        ConfigDAO dao = new ConfigDAO();
        IConfig1D c1 = (IConfig1D) dao.getConfigById(_c.getId());

        indent("**" + c1.getName(), _d);
        indent("  id : " + c1.getId(), _d);
        indent("  scanNumber : " + c1.getScanNumber(), _d);

        IDimension1D X = c1.getDimensionX();
        if (X != null) {
            for (int i = 0; i < X.getActuatorsList().size(); i++) {
                IActuator actuator = X.getActuatorsList().get(i);
                indent("  actuator" + i + " : " + actuator.getName()
                        + (actuator.isEnabled() ? " (on)" : " (off)"), _d);
            }
        }

        for (int i = 0; i < c1.getSensorsList().size(); i++) {
            ISensor sensor = c1.getSensorsList().get(i);
            indent("  sensor" + i + " : " + sensor.getName()
                    + (sensor.isEnabled() ? " (on)" : " (off)"), _d);
        }
        indent("  timestamp : " + _c.getTimestamp(), _d);

View Full Code Here

    }*/

    private static boolean TestSaveConfig() {
        ConfigDAO dao = new ConfigDAO();
        IDirectory root = dao.getRootDirectory();
        IConfig1D dummy = createDummyConfig1D(3, 2, 4);
        dummy.setDirectory(root);

        try {
            IConfig<?> result = dao.saveConfig(dummy);
            if (result != null && result.getId() != null
                    && result.getDirectory().getId() == root.getId()) {
View Full Code Here

                view.addSensor(null, "Not defined");
            }

            // Actuators
            if (config instanceof IConfig1D) {
                IConfig1D config1d = (IConfig1D) config;
                List<IActuator> actuators = config1d.getDimensionX().getActuatorsList();
                view.clearActuators();
                for (int i = 0; i < actuators.size(); i++) {
                    IActuator a = (IActuator) actuators.get(i);
                    ActuatorModel eActuator = (ActuatorModel) a;
                    eActuator.addListener(actuatorListener);
View Full Code Here

                view.addSensor(null, "Not defined");
            }

            // Actuators
            if (config instanceof IConfig1D) {
                IConfig1D config1d = (IConfig1D) config;
                List<IActuator> actuators = config1d.getDimensionX().getActuatorsList();
                view.clearActuators();
                for (int i = 0; i < actuators.size(); i++) {
                    IActuator a = (IActuator) actuators.get(i);
                    ActuatorModel eActuator = (ActuatorModel) a;
                    eActuator.addListener(actuatorListener);
View Full Code Here

                            && (config != null)) {
                        Element actuators = document.createElement("actuators");
                        ArrayList<ITrajectory> trajectories = new ArrayList<ITrajectory>();
                        // System.out.println("config=" + config.getClass().getName());
                        if (config instanceof IConfig1D) {
                            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();
                            // System.out.println("range1d=" + range1d.size());
                            for (int rangeIndex = 0; rangeIndex < range1d.size(); rangeIndex++) {
View Full Code Here

                element.setAttribute("nexusFile", "");
                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++) {
View Full Code Here

                element.setAttribute("nexusFile", "");
                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++) {
View Full Code Here

TOP

Related Classes of fr.soleil.salsa.entity.scan1d.IConfig1D

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.