Examples of toIntValue()


Examples of com.cburch.logisim.data.Value.toIntValue()

    if (layout.subLayouts.length == parent.getEnds().size() - 2) {
      int index = layout.subLayouts.length / 2 + 1;
      Object factory = parent.getFactory();
      if (factory instanceof AbstractGate) {
        Value val = ((AbstractGate) factory).getIdentity();
        Integer valInt = Integer.valueOf(val.toIntValue());
        Location loc = parent.getEnd(index).getLocation();
        AttributeSet attrs = Constant.FACTORY.createAttributeSet();
        attrs.setValue(Constant.ATTR_VALUE, valInt);
        result.add(Constant.FACTORY.createComponent(loc, attrs));
      }
View Full Code Here

Examples of com.cburch.logisim.data.Value.toIntValue()

                        newVal = ld ? max : 0;
                    } else if (onGoal == ON_GOAL_STAY) {
                        newVal = oldVal;
                    } else if (onGoal == ON_GOAL_LOAD) {
                        Value in = state.getPort(IN);
                        newVal = in.isFullyDefined() ? in.toIntValue() : 0;
                        if (newVal > max) {
                            newVal &= max;
                        }

                    } else if (onGoal == ON_GOAL_CONT) {
View Full Code Here

Examples of com.cburch.logisim.data.Value.toIntValue()

                    newVal = ld ? oldVal - 1 : oldVal + 1;
                }
            // trigger, enable = 0, load = 1: should load
            } else if (ld) {
                Value in = state.getPort(IN);
                newVal = in.isFullyDefined() ? in.toIntValue() : 0;
                if (newVal > max) {
                    newVal &= max;
                }

            // trigger, enable = 0, load = 0: no change
View Full Code Here

Examples of com.cburch.logisim.data.Value.toIntValue()

            myState.setCurrent(-1);
            state.setPort(DATA, Value.createUnknown(dataBits), DELAY);
            return;
        }

        int addr = addrValue.toIntValue();
        if (!addrValue.isFullyDefined() || addr < 0)
            return;
        if (addr != myState.getCurrent()) {
            myState.setCurrent(addr);
            myState.scrollToShow(addr);
View Full Code Here

Examples of com.cburch.logisim.data.Value.toIntValue()

        } else if (en == Value.ERROR && state.isPortConnected(outputs + 1)) {
            others = Value.createError(data);
        } else {
            Value sel = state.getPort(outputs);
            if (sel.isFullyDefined()) {
                outIndex = sel.toIntValue();
                out = state.getPort(outputs + (enable ? 2 : 1));
            } else if (sel.isErrorValue()) {
                others = Value.createError(data);
            } else {
                others = Value.createUnknown(data);
View Full Code Here

Examples of com.cburch.logisim.data.Value.toIntValue()

        } else if (en == Value.ERROR && state.isPortConnected(inputs + 1)) {
            out = Value.createError(data);
        } else {
            Value sel = state.getPort(inputs);
            if (sel.isFullyDefined()) {
                out = state.getPort(sel.toIntValue());
            } else if (sel.isErrorValue()) {
                out = Value.createError(data);
            } else {
                out = Value.createUnknown(data);
            }
View Full Code Here

Examples of com.cburch.logisim.data.Value.toIntValue()

        } else if (en == Value.ERROR && state.isPortConnected(outputs + 1)) {
            others = Value.createError(data);
        } else {
            Value sel = state.getPort(outputs);
            if (sel.isFullyDefined()) {
                outIndex = sel.toIntValue();
                out = Value.TRUE;
            } else if (sel.isErrorValue()) {
                others = Value.createError(data);
            } else {
                others = Value.createUnknown(data);
View Full Code Here

Examples of com.cburch.logisim.data.Value.toIntValue()

        if (state.getPort(CLR) == Value.TRUE) {
            data.value = 0;
        } else if (triggered && state.getPort(EN) != Value.FALSE) {
            Value in = state.getPort(IN);
            if (in.isFullyDefined()) {
                data.value = in.toIntValue();
            }

        }

        state.setPort(OUT, Value.createKnown(dataWidth, data.value), DELAY);
View Full Code Here

Examples of com.cburch.logisim.data.Value.toIntValue()

            myState.setCurrent(-1);
            state.setPort(DATA, Value.createUnknown(dataBits), DELAY);
            return;
        }

        int addr = addrValue.toIntValue();
        if (!addrValue.isFullyDefined() || addr < 0)
            return;
        if (addr != myState.getCurrent()) {
            myState.setCurrent(addr);
            myState.scrollToShow(addr);
View Full Code Here

Examples of com.cburch.logisim.data.Value.toIntValue()

            } else {
                shouldStore = !outputEnabled;
            }
            if (shouldStore) {
                Value dataValue = state.getPort(separate ? DIN : DATA);
                myState.getContents().set(addr, dataValue.toIntValue());
            }
        }

        if (outputEnabled) {
            int val = myState.getContents().get(addr);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.