X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.model.am2900%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fmodel%2Fmodel%2Fcomponents%2Fmi%2Fnandbased%2Fam2901%2FGUIAm2901.java;h=34ae4d7d0d608a6dabd493901e97e4ecb6dad8ea;hb=8183e70989d1293764b045a8f8903b33fc2e8cb3;hp=aca03d9b9c05c56c187c9dbb0254ae5a6fa54ee8;hpb=b5d8c2d71e27350ea7c9314e40df5bb0584271cd;p=Mograsim.git diff --git a/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/model/components/mi/nandbased/am2901/GUIAm2901.java b/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/model/components/mi/nandbased/am2901/GUIAm2901.java index aca03d9b..34ae4d7d 100644 --- a/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/model/components/mi/nandbased/am2901/GUIAm2901.java +++ b/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/model/components/mi/nandbased/am2901/GUIAm2901.java @@ -14,9 +14,13 @@ import net.mograsim.logic.model.model.wires.GUIWire; import net.mograsim.logic.model.model.wires.Pin; import net.mograsim.logic.model.model.wires.WireCrossPoint; import net.mograsim.logic.model.serializing.IndirectGUIComponentCreator; +import net.mograsim.logic.model.snippets.highlevelstatehandlers.standard.StandardHighLevelStateHandler; +import net.mograsim.logic.model.snippets.highlevelstatehandlers.standard.subcomponent.DelegatingSubcomponentHighLevelStateHandler; public class GUIAm2901 extends SimpleRectangularSubmodelComponent { + private StandardHighLevelStateHandler highLevelStateHandler; + public GUIAm2901(ViewModelModifiable model) { this(model, null); @@ -346,8 +350,21 @@ public class GUIAm2901 extends SimpleRectangularSubmodelComponent new GUIWire(submodelModifiable, cpFneq0, notFneq0.getPin("B"), new Point(315, 455)); new GUIWire(submodelModifiable, notFneq0.getPin("Y"), Feq0, new Point[0]); - addHighLevelStateSubcomponentID("regs", ram); - addHighLevelStateSubcomponentID("qreg", qreg); + highLevelStateHandler = new StandardHighLevelStateHandler(this); + highLevelStateHandler.addSubcomponentHighLevelState("regs", DelegatingSubcomponentHighLevelStateHandler::new).set(ram, null); + highLevelStateHandler.addSubcomponentHighLevelState("qreg", DelegatingSubcomponentHighLevelStateHandler::new).set(qreg, null); + } + + @Override + public Object getHighLevelState(String stateID) + { + return highLevelStateHandler.getHighLevelState(stateID); + } + + @Override + public void setHighLevelState(String stateID, Object newState) + { + highLevelStateHandler.setHighLevelState(stateID, newState); } static