Package com.asakusafw.compiler.flow

Examples of com.asakusafw.compiler.flow.ExternalIoCommandProvider$Command


    public void fire() throws IllegalActionException {
        super.fire();

        // Check whether a command is ready
        if (_commandReady()) {
            Command sensedCommand = _getCommand();
            byte function = sensedCommand.getFunctionByte();
            byte functionOfInterest = Command.BRIGHT;
            String commandValue = command.stringValue();

            if (!commandValue.equals("BRIGHT")) {
                functionOfInterest = Command.DIM;
            }

            String sensedHouseCode = "" + sensedCommand.getHouseCode();
            int sensedUnitCode = sensedCommand.getUnitCode();

            String houseCodeValue = houseCode.stringValue();
            int unitCodeValue = ((IntToken) unitCode.getToken()).intValue();

            if (sensedHouseCode.equals(houseCodeValue)
                    && (sensedUnitCode == unitCodeValue)
                    && (function == functionOfInterest)) {
                level.send(0, new IntToken(sensedCommand.getLevel()));
            } else {
                level.send(0, _NO_COMMAND_TOKEN);
            }
        } else {
            level.send(0, _NO_COMMAND_TOKEN);
View Full Code Here


        boolean isOn = _hasTrueInput(on);
        boolean isOff = _hasTrueInput(off);

        if (isOn) {
            _transmit(new Command((_destination), x10.Command.ON));
        }

        if (isOff) {
            _transmit(new Command((_destination), x10.Command.OFF));
        }
    }
View Full Code Here

    public void fire() throws IllegalActionException {
        super.fire();

        // Check whether a command is ready
        if (_commandReady()) {
            Command sensedCommand = _getCommand();
            byte function = sensedCommand.getFunctionByte();
            byte functionOfInterest = Command.ON;
            String commandValue = command.stringValue();

            if (commandValue.equals("OFF")) {
                functionOfInterest = Command.OFF;
            } else if (commandValue.equals("ALL_LIGHTS_ON")) {
                functionOfInterest = Command.ALL_LIGHTS_ON;
            } else if (commandValue.equals("ALL_LIGHTS_OFF")) {
                functionOfInterest = Command.ALL_LIGHTS_OFF;
            } else if (commandValue.equals("ALL_UNITS_OFF")) {
                functionOfInterest = Command.ALL_UNITS_OFF;
            }

            String sensedHouseCode = "" + sensedCommand.getHouseCode();
            int sensedUnitCode = sensedCommand.getUnitCode();

            String houseCodeValue = houseCode.stringValue();
            int unitCodeValue = ((IntToken) unitCode.getToken()).intValue();

            if (sensedHouseCode.equals(houseCodeValue)
View Full Code Here

TOP

Related Classes of com.asakusafw.compiler.flow.ExternalIoCommandProvider$Command

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.