X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.ui.am2900%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fui%2Fmodel%2Fcomponents%2Fmi%2Fnandbased%2FGUIdlatch.java;h=009e6f058b3f6827a60a3d3e8e4e891e3fc822e5;hb=74bced7a3a38f65c65f3395cc422eb98e34da0b8;hp=f6246a44fe738b4c089842c8874806f0b944737d;hpb=05e36ce451a394259e3ed21ea21ac3a1fd7d4e40;p=Mograsim.git diff --git a/net.mograsim.logic.ui.am2900/src/net/mograsim/logic/ui/model/components/mi/nandbased/GUIdlatch.java b/net.mograsim.logic.ui.am2900/src/net/mograsim/logic/ui/model/components/mi/nandbased/GUIdlatch.java index f6246a44..009e6f05 100644 --- a/net.mograsim.logic.ui.am2900/src/net/mograsim/logic/ui/model/components/mi/nandbased/GUIdlatch.java +++ b/net.mograsim.logic.ui.am2900/src/net/mograsim/logic/ui/model/components/mi/nandbased/GUIdlatch.java @@ -10,6 +10,8 @@ import net.mograsim.logic.ui.model.wires.WireCrossPoint; public class GUIdlatch extends SimpleRectangularSubmodelComponent { + private GUI_rsLatch _rsLatch; + public GUIdlatch(ViewModelModifiable model) { super(model, 1, "GUIdlatch"); @@ -29,7 +31,7 @@ public class GUIdlatch extends SimpleRectangularSubmodelComponent GUINandGate nand1 = new GUINandGate(submodelModifiable, 1); GUINandGate nand2 = new GUINandGate(submodelModifiable, 1); - GUI_rsLatch _rsLatch = new GUI_rsLatch(submodelModifiable); + _rsLatch = new GUI_rsLatch(submodelModifiable); WireCrossPoint cp1 = new WireCrossPoint(submodelModifiable, 1); WireCrossPoint cp2 = new WireCrossPoint(submodelModifiable, 1); @@ -51,4 +53,30 @@ public class GUIdlatch extends SimpleRectangularSubmodelComponent new GUIWire(submodelModifiable, _rsLatch.getPin("Q"), Q, new Point[0]); new GUIWire(submodelModifiable, _rsLatch.getPin("_Q"), _Q); } + + @Override + public void setHighLevelState(String stateID, Object newState) + { + switch (stateID) + { + case "q": + _rsLatch.setHighLevelState("q", newState); + break; + default: + super.setHighLevelState(stateID, newState); + break; + } + } + + @Override + public Object getHighLevelState(String stateID) + { + switch (stateID) + { + case "q": + return _rsLatch.getHighLevelState("q"); + default: + return super.getHighLevelState(stateID); + } + } } \ No newline at end of file