- int ordi = params.orientation.ordinal();
- int isVerti = (ordi % 4) / 2;
- int isHori = 1 ^ isVerti;
- int isAlt = ordi / 4;
- int isInv = ordi % 2;
- int isStd = 1 ^ isInv;
-
- this.input = new Pin(this, "IN", params.logicWidth, PinUsage.INPUT, width * isInv * isHori + wHalf * isVerti,
- height * isVerti * isStd + hHalf * isHori);
- this.output = new Pin(this, "OUT", params.logicWidth, PinUsage.OUTPUT, width * isStd * isHori + wHalf * isVerti,
- height * isVerti * isInv + hHalf * isHori);
- this.enable = new Pin(this, "EN", 1, PinUsage.INPUT, wQuar * isVerti + wHalf * (isAlt | isHori),
- hQuar * isHori + hHalf * (isAlt | isVerti));
- this.path = new double[] { width * (isStd ^ isHori), height * (isStd ^ isHori), width * isInv, height * isStd,
- width * isStd * isHori + wHalf * isVerti, height * isVerti * isInv + hHalf * isHori };
-
- setSize(width, height);
+
+ 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.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) };
+
+ setSize(oc.width(), oc.height());