The line dash of singlebit wires changes according to their value
[Mograsim.git] / plugins / net.mograsim.logic.model.am2900 / src / net / mograsim / logic / model / examples / ModelComponentTestbench.java
index d9cd6aa..46fc1db 100644 (file)
@@ -6,14 +6,15 @@ import java.util.List;
 
 import net.mograsim.logic.model.SimpleLogicUIStandalone;
 import net.mograsim.logic.model.am2900.Am2900Loader;
+import net.mograsim.logic.model.am2900.machine.Am2900ExpertMachineDefinition;
 import net.mograsim.logic.model.model.LogicModelModifiable;
 import net.mograsim.logic.model.model.components.ModelComponent;
 import net.mograsim.logic.model.model.components.atomic.ModelBitDisplay;
 import net.mograsim.logic.model.model.components.atomic.ModelManualSwitch;
+import net.mograsim.logic.model.model.components.atomic.ModelTextComponent;
 import net.mograsim.logic.model.model.wires.ModelWire;
 import net.mograsim.logic.model.model.wires.Pin;
 import net.mograsim.logic.model.model.wires.PinUsage;
-import net.mograsim.logic.model.serializing.IndirectModelComponentCreator;
 
 public class ModelComponentTestbench
 {
@@ -26,8 +27,8 @@ public class ModelComponentTestbench
        public static void createTestbench(LogicModelModifiable model)
        {
                Am2900Loader.setup();
-//             ModelComponent comp = new StrictAm2900MachineDefinition().createNew(model).getAm2900();
-               ModelComponent comp = IndirectModelComponentCreator.createComponent(model, "dec12");
+               ModelComponent comp = new Am2900ExpertMachineDefinition().createNew(model).getAm2900();
+//             ModelComponent comp = IndirectModelComponentCreator.createComponent(model, "ram5_12");
 
                List<String> inputPinNames = new ArrayList<>();
                List<String> outputPinNames = new ArrayList<>();
@@ -47,6 +48,7 @@ public class ModelComponentTestbench
                        String pinName = inputPinNames.get(i);
                        ModelManualSwitch sw = new ModelManualSwitch(model, comp.getPin(pinName).logicWidth, pinName);
                        sw.moveTo(0, 20 * i);
+                       new ModelTextComponent(model, pinName).moveTo(20, 20 * i);
                        new ModelWire(model, comp.getPin(pinName), sw.getOutputPin());
                }
                for (int i = 0; i < outputPinNames.size(); i++)
@@ -54,6 +56,7 @@ public class ModelComponentTestbench
                        String pinName = outputPinNames.get(i);
                        ModelBitDisplay bd = new ModelBitDisplay(model, comp.getPin(pinName).logicWidth, pinName);
                        bd.moveTo(200, 20 * i);
+                       new ModelTextComponent(model, pinName).moveTo(220, 20 * i);
                        new ModelWire(model, comp.getPin(pinName), bd.getInputPin());
                }
        }