Package fr.soleil.salsa.entity.scan1d

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


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

        // 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
                    && ObjectUtils.sameObject(result.getDirectory().getId(), root.getId())) {
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

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

        // 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

                    ((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.getDimensionX();
                    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

                    ((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.getDimensionX();
                    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

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

                // Actuators
                if (config instanceof IConfig1D) {
                    IConfig1D config1d = (IConfig1D) config;
                    IDimension dimension = config1d.getDimensionX();
                    if (dimension != null) {
                        List<IActuator> actuators = dimension.getActuatorsList();
                        view.clearActuators();
                        if (actuators != null) {
                            for (int i = 0; i < actuators.size(); i++) {
View Full Code Here

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

        // 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

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.