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 / ModelTriStateBuffer.java
index 733d4b6..93bff32 100644 (file)
@@ -6,7 +6,7 @@ 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;
@@ -32,14 +32,14 @@ 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);
+               super(model, name, false);
                this.params = params;
 
                oc = new OrientationCalculator(params.orientation, width, height);
@@ -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) };
 
@@ -58,6 +58,8 @@ public class ModelTriStateBuffer extends ModelComponent
                addPin(input);
                addPin(output);
                addPin(enable);
+
+               init();
        }
 
        public final Pin getInputPin()