Package fr.soleil.salsa.entity

Examples of fr.soleil.salsa.entity.Behaviour


                    view.setZigzag(currentConfig.isZigzag());
                    view.setOnTheFly(currentConfig.isOnTheFly());
                    view.setEnableActuatorSpeed(currentConfig.isEnableScanSpeed());

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


                    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

        ScanFunctionsView formerView = this.view;
        super.setView(view);
        if (this.view != null) {
            Behaviour[] behavioursValues = Behaviour.values();
            Option[] behavioursArray = new Option[behavioursValues.length];
            Behaviour behaviour;
            for (int behaviourIndex = 0; behaviourIndex < behavioursValues.length; ++behaviourIndex) {
                behaviour = behavioursValues[behaviourIndex];
                behavioursArray[behaviourIndex] = new Option(behaviour, behaviour
                        .getShortDescription());
            }
            this.view.setFunctionsArray(behavioursArray);
        }
        if (formerView != null) {
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

                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

    }

    @Override
    public void notifyPostScanBehaviour(String code) {
        if (config != null) {
            Behaviour b = Behaviour.valueOf(Behaviour.class, code);
            if (config.getScanAddOn().getPostScanBehaviour() == null) {
                config.getScanAddOn().setPostScanBehaviour(new PostScanBehaviourModel());
            }
            config.getScanAddOn().getPostScanBehaviour().setBehaviour(b);
            config.setModified(true);
View Full Code Here

                view.setZigzag(config.isZigzag());
                view.setOnTheFly(config.isOnTheFly());
                view.setEnableActuatorSpeed(config.isEnableScanSpeed());

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

    }

    @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();
                    view.setSensorsComboEnabled(nbArgs > 0);
                    view.setActuatorsComboEnabled(nbArgs == 2);
                }
                config.setModified(true);
            }
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.