X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.model%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fmodel%2Fmodel%2Fwires%2FPin.java;h=0c63d3893d3043be0930140a4e6ddb8c842124b9;hb=63b28c33e02beac79bf24a34f658038fdf12196d;hp=794914eb8d0badca468014b86223f7e9e33d2770;hpb=b5d8c2d71e27350ea7c9314e40df5bb0584271cd;p=Mograsim.git diff --git a/net.mograsim.logic.model/src/net/mograsim/logic/model/model/wires/Pin.java b/net.mograsim.logic.model/src/net/mograsim/logic/model/model/wires/Pin.java index 794914eb..0c63d389 100644 --- a/net.mograsim.logic.model/src/net/mograsim/logic/model/model/wires/Pin.java +++ b/net.mograsim.logic.model/src/net/mograsim/logic/model/model/wires/Pin.java @@ -2,6 +2,7 @@ package net.mograsim.logic.model.model.wires; import java.util.ArrayList; import java.util.List; +import java.util.Objects; import java.util.function.Consumer; import net.haspamelodica.swt.helper.swtobjectwrappers.Point; @@ -18,7 +19,7 @@ import net.mograsim.logic.model.model.components.GUIComponent; public class Pin { /** - * The {@link GUIComponent} this pin belongs to + * The {@link GUIComponent} this pin belongs to. */ public final GUIComponent component; /** @@ -29,6 +30,11 @@ public class Pin * The logical width of this pin. Denotes how many bits this pin consists of. */ public final int logicWidth; + /** + * How this pin is used by the component it belongs to.
+ * Note that this is only a hint. + */ + public final PinUsage usage; /** * The X position of this pin, relative to its component's location. @@ -49,11 +55,12 @@ public class Pin * * @author Daniel Kirschten */ - public Pin(GUIComponent component, String name, int logicWidth, double relX, double relY) + public Pin(GUIComponent component, String name, int logicWidth, PinUsage usage, double relX, double relY) { this.component = component; this.name = name; this.logicWidth = logicWidth; + this.usage = Objects.requireNonNull(usage); this.relX = relX; this.relY = relY;