Fixed a bug in Am2900; created dlatch8/80; relayouted some components
[Mograsim.git] / net.mograsim.logic.model / src / net / mograsim / logic / model / model / components / atomic / ModelOrGate.java
1 package net.mograsim.logic.model.model.components.atomic;
2
3 import net.mograsim.logic.core.components.gates.CoreOrGate;
4 import net.mograsim.logic.model.model.LogicModelModifiable;
5 import net.mograsim.logic.model.modeladapter.LogicCoreAdapter;
6 import net.mograsim.logic.model.modeladapter.componentadapters.SimpleGateAdapter;
7 import net.mograsim.logic.model.serializing.IndirectModelComponentCreator;
8
9 public class ModelOrGate extends SimpleRectangularModelGate
10 {
11         public ModelOrGate(LogicModelModifiable model, int logicWidth)
12         {
13                 this(model, logicWidth, null);
14         }
15
16         public ModelOrGate(LogicModelModifiable model, int logicWidth, String name)
17         {
18                 super(model, "OrGate", "\u22651", false, logicWidth, name, false);// ">=1"
19                 setInputCount(2);
20                 init();
21         }
22
23         static
24         {
25                 LogicCoreAdapter.addComponentAdapter(new SimpleGateAdapter<>(ModelOrGate.class, CoreOrGate::new));
26                 IndirectModelComponentCreator.setComponentSupplier(ModelOrGate.class.getCanonicalName(),
27                                 (m, p, n) -> new ModelOrGate(m, p.getAsInt(), n));
28         }
29 }