Cleaned up initializing of ModelComponents (also improved HLSDebugShell)
[Mograsim.git] / net.mograsim.logic.model / src / net / mograsim / logic / model / model / components / atomic / ModelBitDisplay.java
index fbcaf64..1a01e14 100644 (file)
@@ -9,7 +9,7 @@ import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle;
 import net.mograsim.logic.core.LogicObserver;
 import net.mograsim.logic.core.components.CoreBitDisplay;
 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;
@@ -31,19 +31,21 @@ public class ModelBitDisplay extends ModelComponent
        private final LogicObserver logicObs;
        private CoreBitDisplay bitDisplay;
 
-       public ModelBitDisplay(ViewModelModifiable model, int logicWidth)
+       public ModelBitDisplay(LogicModelModifiable model, int logicWidth)
        {
                this(model, logicWidth, null);
        }
 
-       public ModelBitDisplay(ViewModelModifiable model, int logicWidth, String name)
+       public ModelBitDisplay(LogicModelModifiable model, int logicWidth, String name)
        {
-               super(model, name);
+               super(model, name, false);
                this.logicWidth = logicWidth;
                logicObs = (i) -> model.requestRedraw();
 
                setSize(width, height);
-               addPin(this.inputPin = new Pin(this, "", logicWidth, PinUsage.INPUT, 0, height / 2));
+               addPin(this.inputPin = new Pin(model, this, "", logicWidth, PinUsage.INPUT, 0, height / 2));
+
+               init();
        }
 
        @Override