Package fr.soleil.salsa.entity

Examples of fr.soleil.salsa.entity.Behaviour


                    view.setDataRecorderConfig(currentConfig.getDataRecorderConfig());

                    // Behaviour
                    IPostScanBehaviour postScanBehaviour = getPostScanBehaviour(currentConfig);
                    if ((postScanBehaviour != null) && (postScanBehaviour.getBehaviour() != null)) {
                        Behaviour selectedBehaviour = postScanBehaviour.getBehaviour();
                        int selectedIndex = 0;
                        view.clearPostScanBehaviour();
                        Behaviour[] behaviours = Behaviour.values();
                        for (int i = 0; i < behaviours.length; i++) {
                            Behaviour b = behaviours[i];
                            view.addPostScanBehaviour(b.name(), b.getShortDescription());
                            if (selectedBehaviour == b) {
                                selectedIndex = i;
                                view.setDescription(b.getLongDescription());
                            }
                        }
                        view.setPostScanSelected(selectedIndex);

                        // We enable or not the sensor and actuator combo box.
View Full Code Here


                actionName = "write_attribute(\"enableScanSpeed\"," + enableScanSpeed + ")";
                setAttribute("enableScanSpeed", enableScanSpeed);

                // Post scan behaviour.
                IPostScanBehaviour postScanBehaviour = config.getScanAddOn().getPostScanBehaviour();
                Behaviour behaviour = postScanBehaviour.getBehaviour();
                if (behaviour == null) {
                    behaviour = Behaviour.NOOP;
                }
                int behaviourType = behaviour.getType();

                actionName = "write_attribute(\"afterRunActionType\"," + behaviourType + ")";
                setAttribute("afterRunActionType", behaviourType);

                if (behaviour.getArgumentCount() >= 1) {
                    int behaviourSensorIndex = postScanBehaviour.getSensor();
                    actionName = "write_attribute(\"afterRunActionSensor\"," + behaviourSensorIndex
                            + ")";
                    setAttribute("afterRunActionSensor", behaviourSensorIndex);
                }
                else if (behaviour.getArgumentCount() >= 2) {
                    int behaviourActuatorIndex = postScanBehaviour.getActuator();
                    actionName = "write_attribute(\"afterRunActionActuator\","
                            + behaviourActuatorIndex + ")";
                    setAttribute("afterRunActionActuator", behaviourActuatorIndex);
                }
View Full Code Here

                    setAttribute("enableScanSpeed", enableScanSpeed);

                    // Post scan behaviour.
                    IPostScanBehaviour postScanBehaviour = config.getScanAddOn()
                            .getPostScanBehaviour();
                    Behaviour behaviour = postScanBehaviour.getBehaviour();
                    if (behaviour == null) {
                        behaviour = Behaviour.NOOP;
                    }
                    int behaviourType = behaviour.getType();
                    setAttribute("afterRunActionType", behaviourType);
                    if (behaviour.getArgumentCount() >= 1) {
                        int behaviourSensorIndex = postScanBehaviour.getSensor();
                        setAttribute("afterRunActionSensor", behaviourSensorIndex);
                    }
                    else if (behaviour.getArgumentCount() >= 2) {
                        int behaviourActuatorIndex = postScanBehaviour.getActuator();
                        setAttribute("afterRunActionActuator", behaviourActuatorIndex);
                    }

                    // Error strategies.
View Full Code Here

                    setAttribute("enableScanSpeed", enableScanSpeed);

                    // Post scan behaviour.
                    IPostScanBehaviour postScanBehaviour = config.getScanAddOn()
                            .getPostScanBehaviour();
                    Behaviour behaviour = postScanBehaviour.getBehaviour();
                    if (behaviour == null) {
                        behaviour = Behaviour.NOOP;
                    }
                    int behaviourType = behaviour.getType();
                    setAttribute("afterRunActionType", behaviourType);
                    if (behaviour.getArgumentCount() >= 1) {
                        int behaviourSensorIndex = postScanBehaviour.getSensor();
                        setAttribute("afterRunActionSensor", behaviourSensorIndex);
                    }
                    else if (behaviour.getArgumentCount() >= 2) {
                        int behaviourActuatorIndex = postScanBehaviour.getActuator();
                        setAttribute("afterRunActionActuator", behaviourActuatorIndex);
                    }

                    // Error strategies.
View Full Code Here

                    setAttribute("enableScanSpeed", enableScanSpeed);

                    // Post scan behaviour.
                    IPostScanBehaviour postScanBehaviour = config.getScanAddOn()
                            .getPostScanBehaviour();
                    Behaviour behaviour = postScanBehaviour.getBehaviour();
                    if (behaviour == null) {
                        behaviour = Behaviour.NOOP;
                    }
                    int behaviourType = behaviour.getType();
                    setAttribute("afterRunActionType", behaviourType);
                    if (behaviour.getArgumentCount() >= 1) {
                        int behaviourSensorIndex = postScanBehaviour.getSensor();
                        setAttribute("afterRunActionSensor", behaviourSensorIndex);
                    }
                    else if (behaviour.getArgumentCount() >= 2) {
                        int behaviourActuatorIndex = postScanBehaviour.getActuator();
                        setAttribute("afterRunActionActuator", behaviourActuatorIndex);
                    }

                    // Error strategies.
View Full Code Here

                    setAttribute("enableScanSpeed", enableScanSpeed);

                    // Post scan behaviour.
                    IPostScanBehaviour postScanBehaviour = config.getScanAddOn()
                            .getPostScanBehaviour();
                    Behaviour behaviour = postScanBehaviour.getBehaviour();
                    if (behaviour == null) {
                        behaviour = Behaviour.NOOP;
                    }
                    int behaviourType = behaviour.getType();
                    setAttribute("afterRunActionType", behaviourType);
                    if (behaviour.getArgumentCount() >= 1) {
                        int behaviourSensorIndex = postScanBehaviour.getSensor();
                        setAttribute("afterRunActionSensor", behaviourSensorIndex);
                    }
                    else if (behaviour.getArgumentCount() >= 2) {
                        int behaviourActuatorIndex = postScanBehaviour.getActuator();
                        setAttribute("afterRunActionActuator", behaviourActuatorIndex);
                    }

                    // Error strategies.
View Full Code Here

                    setAttribute("enableScanSpeed", enableScanSpeed);

                    // Post scan behaviour.
                    IPostScanBehaviour postScanBehaviour = config.getScanAddOn()
                            .getPostScanBehaviour();
                    Behaviour behaviour = postScanBehaviour.getBehaviour();
                    if (behaviour == null) {
                        behaviour = Behaviour.NOOP;
                    }
                    int behaviourType = behaviour.getType();
                    setAttribute("afterRunActionType", behaviourType);
                    if (behaviour.getArgumentCount() >= 1) {
                        int behaviourSensorIndex = postScanBehaviour.getSensor();
                        setAttribute("afterRunActionSensor", behaviourSensorIndex);
                    }
                    else if (behaviour.getArgumentCount() >= 2) {
                        int behaviourActuatorIndex = postScanBehaviour.getActuator();
                        setAttribute("afterRunActionActuator", behaviourActuatorIndex);
                    }

                    // Error strategies.
View Full Code Here

                    setAttribute("enableScanSpeed", enableScanSpeed);

                    // Post scan behaviour.
                    IPostScanBehaviour postScanBehaviour = config.getScanAddOn()
                            .getPostScanBehaviour();
                    Behaviour behaviour = postScanBehaviour.getBehaviour();
                    if (behaviour == null) {
                        behaviour = Behaviour.NOOP;
                    }
                    int behaviourType = behaviour.getType();
                    setAttribute("afterRunActionType", behaviourType);
                    if (behaviour.getArgumentCount() >= 1) {
                        int behaviourSensorIndex = postScanBehaviour.getSensor();
                        setAttribute("afterRunActionSensor", behaviourSensorIndex);
                    }
                    else if (behaviour.getArgumentCount() >= 2) {
                        int behaviourActuatorIndex = postScanBehaviour.getActuator();
                        setAttribute("afterRunActionActuator", behaviourActuatorIndex);
                    }

                    // Error strategies.
View Full Code Here

    }

    @Override
    public void notifyPostScanBehaviour(String code) {
        if (config != null) {
            Behaviour b = Behaviour.valueOf(Behaviour.class, code);
            if (getPostScanBehaviour(config) != null) {
                getPostScanBehaviour(config).setBehaviour(b);
                if (view != null) {
                    int nbArgs = b.getArgumentCount();
                    // System.out.println("nbArgs=" + nbArgs);
                    view.setSensorsComboEnabled(nbArgs > 0);
                    view.setActuatorsComboEnabled(nbArgs == 2);
                }
                config.setModified(true);
View Full Code Here

                    view.setDataRecorderConfig(currentConfig.getDataRecorderConfig());

                    // Behaviour
                    IPostScanBehaviour postScanBehaviour = getPostScanBehaviour(currentConfig);
                    if (postScanBehaviour != null && postScanBehaviour.getBehaviour() != null) {
                        Behaviour selectedBehaviour = postScanBehaviour.getBehaviour();
                        int selectedIndex = 0;
                        view.clearPostScanBehaviour();
                        Behaviour[] behaviours = Behaviour.values();
                        for (int i = 0; i < behaviours.length; i++) {
                            Behaviour b = behaviours[i];
                            view.addPostScanBehaviour(b.name(), b.getShortDescription());
                            if (selectedBehaviour == b) {
                                selectedIndex = i;
                                view.setDescription(b.getLongDescription());
                            }
                        }
                        view.setPostScanSelected(selectedIndex);

                        // We enable or not the sensor and actuator combo box.
View Full Code Here

TOP

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

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.