Renamed core components to have the common prefix Core
[Mograsim.git] / net.mograsim.logic.model.am2900 / src / net / mograsim / logic / model / am2900 / components / GUIinc12.java
index 11f7f93..ca74076 100644 (file)
@@ -9,8 +9,8 @@ import java.util.Arrays;
 import java.util.Map;
 
 import net.mograsim.logic.core.types.Bit;
-import net.mograsim.logic.core.wires.Wire.ReadEnd;
-import net.mograsim.logic.core.wires.Wire.ReadWriteEnd;
+import net.mograsim.logic.core.wires.CoreWire.ReadEnd;
+import net.mograsim.logic.core.wires.CoreWire.ReadWriteEnd;
 import net.mograsim.logic.model.model.ViewModelModifiable;
 import net.mograsim.logic.model.model.components.atomic.SimpleRectangularHardcodedGUIComponent;
 import net.mograsim.logic.model.model.wires.Pin;
@@ -22,7 +22,7 @@ public class GUIinc12 extends SimpleRectangularHardcodedGUIComponent
 {
        public GUIinc12(ViewModelModifiable model, String name)
        {
-               super(model, name, "Incrementer");
+               super(model, "GUIinc12", name, "Incrementer");
                setSize(40, 20);
                addPin(new Pin(this, "A", 12, PinUsage.INPUT, 20, 20), Position.TOP);
                addPin(new Pin(this, "CI", 1, PinUsage.INPUT, 40, 10), Position.LEFT);
@@ -30,7 +30,7 @@ public class GUIinc12 extends SimpleRectangularHardcodedGUIComponent
        }
 
        @Override
-       protected Object recalculate(Object lastState, Map<String, ReadEnd> readEnds, Map<String, ReadWriteEnd> readWriteEnds)
+       public Object recalculate(Object lastState, Map<String, ReadEnd> readEnds, Map<String, ReadWriteEnd> readWriteEnds)
        {
                Bit[] ABits = readEnds.get("A").getValues().getBits();
                Bit CIVal = readEnds.get("CI").getValue();
@@ -47,7 +47,6 @@ public class GUIinc12 extends SimpleRectangularHardcodedGUIComponent
                {
                        Bit carry = Bit.ONE;
                        // TODO extract to helper. This code almost also exists in GUIAM2910RegCntr.
-                       // TODO maybe invert loop direction
                        for (int i = 11; i >= 0; i--)
                        {
                                Bit a = ABits[i];