Package fr.soleil.salsa.entity

Examples of fr.soleil.salsa.entity.Behaviour


                    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) {
        Behaviour b = Behaviour.valueOf(Behaviour.class, code);
        if (config.getScanAddOn().getPostScanBehaviour() == null) {
            config.getScanAddOn().setPostScanBehaviour(new PostScanBehaviourModel());
        }
        config.getScanAddOn().getPostScanBehaviour().setBehaviour(b);
    }
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

    public ScanFunctionsController() {
        view = new ScanFunctionsView(this);
       
        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());
        }
        view.setFunctionsArray(behavioursArray);
       
        updater = new ScanFunctionsUpdater();
        PeriodicRefreshUpdater.getInstance().add(updater);
View Full Code Here

                boolean enableScanSpeed = config.isEnableScanSpeed();
                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

    }

    @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

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.