Package fr.soleil.salsa.entity

Examples of fr.soleil.salsa.entity.Behaviour


                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


                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

                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

                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

                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

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

                actionName = writeAttributeLog(CurrentScanDataModel.ENABLESCANSPEED, String.valueOf(enableScanSpeed));
                setAttribute(CurrentScanDataModel.ENABLESCANSPEED, enableScanSpeed, false);

                // Post scan behaviour.
                IPostScanBehaviour postScanBehaviour = config.getScanAddOn().getPostScanBehaviour();
                Behaviour behaviour = postScanBehaviour.getBehaviour();
                if (behaviour == null) {
                    behaviour = Behaviour.NOOP;
                }
                int behaviourType = behaviour.getType();
                actionName = writeAttributeLog(CurrentScanDataModel.AFTER_ACTION_TYPE, String.valueOf(behaviourType));
                setAttribute(CurrentScanDataModel.AFTER_ACTION_TYPE, behaviourType, false);

                if (behaviour.getArgumentCount() >= 1) {
                    int behaviourSensorIndex = postScanBehaviour.getSensor();
                    actionName = writeAttributeLog(CurrentScanDataModel.AFTER_ACTION_SENSOR,
                            String.valueOf(behaviourSensorIndex));
                    setAttribute(CurrentScanDataModel.AFTER_ACTION_SENSOR, behaviourSensorIndex, false);
                } else if (behaviour.getArgumentCount() >= 2) {
                    int behaviourActuatorIndex = postScanBehaviour.getActuator();
                    actionName = writeAttributeLog(CurrentScanDataModel.AFTER_ACTION_ACTUATOR,
                            String.valueOf(behaviourActuatorIndex));
                    setAttribute(CurrentScanDataModel.AFTER_ACTION_ACTUATOR, behaviourActuatorIndex, false);
                }
View Full Code Here

                actionName = writeAttributeLog(CurrentScanDataModel.ENABLESCANSPEED, String.valueOf(enableScanSpeed));
                setAttribute(CurrentScanDataModel.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 = writeAttributeLog(CurrentScanDataModel.AFTER_ACTION_TYPE, String.valueOf(behaviourType));
                setAttribute(CurrentScanDataModel.AFTER_ACTION_TYPE, behaviourType);

                if (behaviour.getArgumentCount() >= 1) {
                    int behaviourSensorIndex = postScanBehaviour.getSensor();
                    actionName = writeAttributeLog(CurrentScanDataModel.AFTER_ACTION_SENSOR,
                            String.valueOf(behaviourSensorIndex));
                    setAttribute(CurrentScanDataModel.AFTER_ACTION_SENSOR, behaviourSensorIndex);
                } else if (behaviour.getArgumentCount() >= 2) {
                    int behaviourActuatorIndex = postScanBehaviour.getActuator();
                    actionName = writeAttributeLog(CurrentScanDataModel.AFTER_ACTION_ACTUATOR,
                            String.valueOf(behaviourActuatorIndex));
                    setAttribute(CurrentScanDataModel.AFTER_ACTION_ACTUATOR, behaviourActuatorIndex);
                }
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.