X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.model%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fmodel%2Fmodel%2Fcomponents%2Fatomic%2FModelTriStateBuffer.java;h=6791aff8b0fe522e8f93ed95e61820556f6e7d9f;hb=1f645882d229fc3d4081e4c5060559d75dc2cc24;hp=04f7caeec4859f9d3d007ed5a3a98f58b8482f17;hpb=93b398d6271a538a2a4c9f4de07a3b4a8a2a7fd4;p=Mograsim.git diff --git a/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/atomic/ModelTriStateBuffer.java b/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/atomic/ModelTriStateBuffer.java index 04f7caee..6791aff8 100644 --- a/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/atomic/ModelTriStateBuffer.java +++ b/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/atomic/ModelTriStateBuffer.java @@ -6,13 +6,13 @@ import com.google.gson.JsonSyntaxException; import net.haspamelodica.swt.helper.gcs.GeneralGC; import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle; -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.components.Orientation; import net.mograsim.logic.model.model.components.OrientationCalculator; 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.TriStateBufferAdapter; import net.mograsim.logic.model.serializing.IdentifyParams; import net.mograsim.logic.model.serializing.IndirectModelComponentCreator; @@ -32,12 +32,12 @@ public class ModelTriStateBuffer extends ModelComponent private ModelTriStateBufferParams params; private OrientationCalculator oc; - public ModelTriStateBuffer(ViewModelModifiable model, ModelTriStateBufferParams params) + public ModelTriStateBuffer(LogicModelModifiable model, ModelTriStateBufferParams params) { this(model, params, null); } - public ModelTriStateBuffer(ViewModelModifiable model, ModelTriStateBufferParams params, String name) + public ModelTriStateBuffer(LogicModelModifiable model, ModelTriStateBufferParams params, String name) { super(model, name); this.params = params; @@ -48,9 +48,9 @@ public class ModelTriStateBuffer extends ModelComponent double hHalf = height / 2; double hQuar = height / 4; - this.input = new Pin(this, "IN", params.logicWidth, PinUsage.INPUT, oc.newX(0, hHalf), oc.newY(0, hHalf)); - this.output = new Pin(this, "OUT", params.logicWidth, PinUsage.OUTPUT, oc.newX(width, hHalf), oc.newY(width, hHalf)); - this.enable = new Pin(this, "EN", 1, PinUsage.INPUT, oc.newX(wHalf, hQuar), oc.newY(wHalf, hQuar)); + this.input = new Pin(model, this, "IN", params.logicWidth, PinUsage.INPUT, oc.newX(0, hHalf), oc.newY(0, hHalf)); + this.output = new Pin(model, this, "OUT", params.logicWidth, PinUsage.OUTPUT, oc.newX(width, hHalf), oc.newY(width, hHalf)); + this.enable = new Pin(model, this, "EN", 1, PinUsage.INPUT, oc.newX(wHalf, hQuar), oc.newY(wHalf, hQuar)); this.path = new double[] { oc.newX(0, 0), oc.newY(0, 0), oc.newX(width, hHalf), oc.newY(width, hHalf), oc.newX(0, height), oc.newY(0, height) }; @@ -100,7 +100,7 @@ public class ModelTriStateBuffer extends ModelComponent static { - ViewLogicModelAdapter.addComponentAdapter(new TriStateBufferAdapter()); + LogicCoreAdapter.addComponentAdapter(new TriStateBufferAdapter()); IndirectModelComponentCreator.setComponentSupplier(ModelTriStateBuffer.class.getName(), (m, p, n) -> { ModelTriStateBufferParams params = JsonHandler.fromJsonTree(p, ModelTriStateBufferParams.class);