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%2Fam2901%2FGUIAm2901.java;h=b589e67e98da68f8afba12d1d85372a5cde4a840;hb=74bced7a3a38f65c65f3395cc422eb98e34da0b8;hp=d08145d54515904e3d07c0ff4a431c417fad915f;hpb=05e36ce451a394259e3ed21ea21ac3a1fd7d4e40;p=Mograsim.git diff --git a/net.mograsim.logic.ui.am2900/src/net/mograsim/logic/ui/model/components/mi/nandbased/am2901/GUIAm2901.java b/net.mograsim.logic.ui.am2900/src/net/mograsim/logic/ui/model/components/mi/nandbased/am2901/GUIAm2901.java index d08145d5..b589e67e 100644 --- a/net.mograsim.logic.ui.am2900/src/net/mograsim/logic/ui/model/components/mi/nandbased/am2901/GUIAm2901.java +++ b/net.mograsim.logic.ui.am2900/src/net/mograsim/logic/ui/model/components/mi/nandbased/am2901/GUIAm2901.java @@ -16,6 +16,9 @@ import net.mograsim.logic.ui.model.wires.WireCrossPoint; public class GUIAm2901 extends SimpleRectangularSubmodelComponent { + private GUIram4 ram; + private GUIAm2901QReg qreg; + public GUIAm2901(ViewModelModifiable model) { super(model, 1, "GUIAm2901"); @@ -76,12 +79,12 @@ public class GUIAm2901 extends SimpleRectangularSubmodelComponent GUIAm2901ALUInclSourceDecodeInclFunctionDecode alu = new GUIAm2901ALUInclSourceDecodeInclFunctionDecode(submodelModifiable); GUIor4 Fneq0 = new GUIor4(submodelModifiable); GUINandGate notFneq0 = new GUINandGate(submodelModifiable, 1); - GUIram4 ram = new GUIram4(submodelModifiable); + ram = new GUIram4(submodelModifiable); GUIdlatch4 QAlatch = new GUIdlatch4(submodelModifiable); GUIdlatch4 QBlatch = new GUIdlatch4(submodelModifiable); GUIsel3_4 ramDsel = new GUIsel3_4(submodelModifiable); GUIsel3_4 qregDsel = new GUIsel3_4(submodelModifiable); - GUIAm2901QReg qreg = new GUIAm2901QReg(submodelModifiable); + qreg = new GUIAm2901QReg(submodelModifiable); WireCrossPoint cpC1 = new WireCrossPoint(submodelModifiable, 1); WireCrossPoint cpC2 = new WireCrossPoint(submodelModifiable, 1); @@ -340,4 +343,53 @@ 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]); } + + @Override + public void setHighLevelState(String stateID, Object newState) + { + switch (stateID) + { + default: + int indexOfDot = stateID.indexOf('.'); + if (indexOfDot != -1) + { + switch (stateID.substring(0, indexOfDot)) + { + case "regs": + ram.setHighLevelState(stateID.substring(indexOfDot + 1), newState); + break; + case "qreg": + qreg.setHighLevelState(stateID.substring(indexOfDot + 1), newState); + break; + default: + super.setHighLevelState(stateID, newState); + break; + } + } else + super.setHighLevelState(stateID, newState); + } + } + + @Override + public Object getHighLevelState(String stateID) + { + switch (stateID) + { + default: + int indexOfDot = stateID.indexOf('.'); + if (indexOfDot != -1) + { + switch (stateID.substring(0, indexOfDot)) + { + case "regs": + return ram.getHighLevelState(stateID.substring(indexOfDot + 1)); + case "qreg": + return qreg.getHighLevelState(stateID.substring(indexOfDot + 1)); + default: + return super.getHighLevelState(stateID); + } + } + return super.getHighLevelState(stateID); + } + } } \ No newline at end of file