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;fp=net.mograsim.logic.ui.am2900%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fui%2Fmodel%2Fcomponents%2Fmi%2Fnandbased%2FGUIdlatch.java;h=95a3e3fc7ac52eb8dce2c7403cbf60805d175efa;hb=574918bb58faa3c617911ed4f629f90066668364;hp=009e6f058b3f6827a60a3d3e8e4e891e3fc822e5;hpb=bec6c3a711448475c7b8e43dd031efe7b89aba24;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 009e6f05..95a3e3fc 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 @@ -52,10 +52,12 @@ public class GUIdlatch extends SimpleRectangularSubmodelComponent new GUIWire(submodelModifiable, nand2.getPin("Y"), _rsLatch.getPin("_R"), new Point(40, 37.5), new Point(40, 22.5)); new GUIWire(submodelModifiable, _rsLatch.getPin("Q"), Q, new Point[0]); new GUIWire(submodelModifiable, _rsLatch.getPin("_Q"), _Q); + + addAtomicHighLevelStateID("q"); } @Override - public void setHighLevelState(String stateID, Object newState) + public void setAtomicHighLevelState(String stateID, Object newState) { switch (stateID) { @@ -63,20 +65,21 @@ public class GUIdlatch extends SimpleRectangularSubmodelComponent _rsLatch.setHighLevelState("q", newState); break; default: - super.setHighLevelState(stateID, newState); - break; + // should not happen because we tell SubmodelComponent to only allow these state IDs. + throw new IllegalStateException("Illegal atomic state ID: " + stateID); } } @Override - public Object getHighLevelState(String stateID) + public Object getAtomicHighLevelState(String stateID) { switch (stateID) { case "q": return _rsLatch.getHighLevelState("q"); default: - return super.getHighLevelState(stateID); + // should not happen because we tell SubmodelComponent to only allow these state IDs. + throw new IllegalStateException("Illegal atomic state ID: " + stateID); } } } \ No newline at end of file