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 / ModelFixedOutput.java
index b052ded..1d3bb1e 100644 (file)
@@ -10,11 +10,11 @@ import net.haspamelodica.swt.helper.swtobjectwrappers.Point;
 import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle;
 import net.mograsim.logic.core.types.BitVector;
 import net.mograsim.logic.core.types.BitVectorFormatter;
-import net.mograsim.logic.model.model.ViewModelModifiable;
+import net.mograsim.logic.model.model.LogicModelModifiable;
 import net.mograsim.logic.model.model.components.ModelComponent;
 import net.mograsim.logic.model.model.wires.Pin;
 import net.mograsim.logic.model.model.wires.PinUsage;
-import net.mograsim.logic.model.modeladapter.ViewLogicModelAdapter;
+import net.mograsim.logic.model.modeladapter.LogicCoreAdapter;
 import net.mograsim.logic.model.modeladapter.componentadapters.FixedOutputAdapter;
 import net.mograsim.logic.model.serializing.IdentifyParams;
 import net.mograsim.logic.model.serializing.IndirectModelComponentCreator;
@@ -29,12 +29,14 @@ public class ModelFixedOutput extends ModelComponent
 
        public final BitVector bits;
 
-       public ModelFixedOutput(ViewModelModifiable model, BitVector bits, String name)
+       public ModelFixedOutput(LogicModelModifiable model, BitVector bits, String name)
        {
-               super(model, name);
+               super(model, name, false);
                this.bits = bits;
                setSize(width, height);
-               addPin(new Pin(this, "out", bits.length(), PinUsage.OUTPUT, width, height / 2));
+               addPin(new Pin(model, this, "out", bits.length(), PinUsage.OUTPUT, width, height / 2));
+
+               init();
        }
 
        @Override
@@ -70,7 +72,7 @@ public class ModelFixedOutput extends ModelComponent
 
        static
        {
-               ViewLogicModelAdapter.addComponentAdapter(new FixedOutputAdapter());
+               LogicCoreAdapter.addComponentAdapter(new FixedOutputAdapter());
                IndirectModelComponentCreator.setComponentSupplier(ModelFixedOutput.class.getCanonicalName(),
                                (m, p, n) -> new ModelFixedOutput(m, Objects.requireNonNull(JsonHandler.fromJsonTree(p, BitVector.class)), n));
        }