X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.model.am2900%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fmodel%2Fexamples%2FGUIComponentTestbench.java;h=66e321274103ff2c4e9d7d7aea4b5892e15191cf;hb=0dff0f06c05ad9b778c29d05b300b399937097e9;hp=4a16e534df1c045a6fe6cd04cb43f019f40ac72a;hpb=232023edec378bc816ba2418dfebc45e4781dbb3;p=Mograsim.git diff --git a/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/examples/GUIComponentTestbench.java b/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/examples/GUIComponentTestbench.java index 4a16e534..66e32127 100644 --- a/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/examples/GUIComponentTestbench.java +++ b/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/examples/GUIComponentTestbench.java @@ -9,11 +9,11 @@ import net.mograsim.logic.model.model.ViewModelModifiable; import net.mograsim.logic.model.model.components.GUIComponent; import net.mograsim.logic.model.model.components.atomic.GUIBitDisplay; import net.mograsim.logic.model.model.components.atomic.GUIManualSwitch; -import net.mograsim.logic.model.model.components.atomic.GUIMerger; import net.mograsim.logic.model.model.components.atomic.SimpleRectangularHardcodedGUIComponent; import net.mograsim.logic.model.model.components.atomic.SimpleRectangularHardcodedGUIComponent.Usage; import net.mograsim.logic.model.model.wires.GUIWire; import net.mograsim.logic.model.model.wires.Pin; +import net.mograsim.logic.model.serializing.IndirectGUIComponentCreator; public class GUIComponentTestbench { @@ -25,7 +25,7 @@ public class GUIComponentTestbench @SuppressWarnings("unused") // for GUIWires being created public static void createTestbench(ViewModelModifiable model) { - GUIComponent comp = new GUIMerger(model, 10, ""); + GUIComponent comp = IndirectGUIComponentCreator.createComponent(model, "file:components/am2904/GUIAm2904MSR.json"); // guess which pins are outputs and which are inputs // TODO this code exists four times... but it seems too "hacky" to put it in a helper class @@ -41,7 +41,7 @@ public class GUIComponentTestbench outputPinNames.add(p.name); } else for (Pin p : comp.getPins().values()) - if (p.getRelX() == 0) + if (p.getRelX() < comp.getWidth()) inputPinNames.add(p.name); else outputPinNames.add(p.name);