X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.model.am2900%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fmodel%2Fam2900%2Fcomponents%2FGUIdff12.java;h=8f836fabef36cd05dcac4902bcf04e5e353d74f4;hb=30b24889d4ae001113c6cac543fb8c29d15d0ff2;hp=9cf4d97e16c60903c84fb05a4d16e8421d401bdf;hpb=cc41296e1c42ce837e3e2e90e79fd40267e1936e;p=Mograsim.git diff --git a/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/components/GUIdff12.java b/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/components/GUIdff12.java index 9cf4d97e..8f836fab 100644 --- a/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/components/GUIdff12.java +++ b/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/components/GUIdff12.java @@ -13,6 +13,8 @@ import net.mograsim.logic.core.wires.Wire.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; +import net.mograsim.logic.model.model.wires.PinUsage; +import net.mograsim.logic.model.serializing.IndirectGUIComponentCreator; import net.mograsim.logic.model.snippets.symbolrenderers.PinNamesSymbolRenderer.PinNamesParams.Position; public class GUIdff12 extends SimpleRectangularHardcodedGUIComponent @@ -21,13 +23,13 @@ public class GUIdff12 extends SimpleRectangularHardcodedGUIComponent { super(model, name, "D flip flop\n12 bits"); setSize(40, 20); - addPin(new Pin(this, "D", 12, 20, 20), Usage.INPUT, Position.TOP); - addPin(new Pin(this, "C", 1, 0, 10), Usage.INPUT, Position.RIGHT); - addPin(new Pin(this, "Y", 12, 20, 0), Usage.OUTPUT, Position.BOTTOM); + addPin(new Pin(this, "D", 12, PinUsage.INPUT, 20, 20), Position.TOP); + addPin(new Pin(this, "C", 1, PinUsage.INPUT, 0, 10), Position.RIGHT); + addPin(new Pin(this, "Y", 12, PinUsage.OUTPUT, 20, 0), Position.BOTTOM); } @Override - protected Object recalculate(Object lastState, Map readEnds, Map readWriteEnds) + public Object recalculate(Object lastState, Map readEnds, Map readWriteEnds) { Bit[] QC = (Bit[]) lastState; if (QC == null) @@ -46,4 +48,9 @@ public class GUIdff12 extends SimpleRectangularHardcodedGUIComponent return QC; } + + static + { + IndirectGUIComponentCreator.setComponentSupplier(GUIdff12.class.getCanonicalName(), (m, p, n) -> new GUIdff12(m, n)); + } } \ No newline at end of file