Post Demo Bugfix

This commit is contained in:
Aadi Desai 2022-03-26 17:52:47 +00:00
parent 84c8da773f
commit 1bd5020d22
No known key found for this signature in database
GPG key ID: CFFFE425830EF4D9
2 changed files with 80 additions and 45 deletions

View file

@ -1 +1,12 @@
yhp19 - Fixing the Rightangle (2-4 Segment) case for the Autorouting algorithms. Equidistance is attempted whenever is possible (more explanation in the code analysis) # Post Demo Bugfixes
- yhp19
- Fixing the Rightangle (2-4 Segment) case for the Autorouting algorithms. Equidistance is attempted whenever is possible (more explanation in the code analysis)
- ad3919
- with help of yhp19 in understanding routing code
- Dragging does not work correctly in some instances
- Opposite Side, (standard Issie) works as expected
- Same Side, forces wire between two ports (as if it was opposite side) instead of only away from ports
- Right Angle, prevents movement as both ports are preventing movement perpendicular to their direction
- Position of auto-routed wires has been fixed for some orientations
- multiple 4 segment right-angle cases

View file

@ -430,37 +430,49 @@ let initialWireVerticesFromPorts
if (endX - startX >= Wire.stickLength) if (endX - startX >= Wire.stickLength)
&& (endY - startY >= Wire.stickLength) then && (endY - startY >= Wire.stickLength) then
[ [
{X = startX; Y = startY}; {X = startX; Y = startY}
{X = startX + Wire.stickLength; Y = startY}; {X = startX + Wire.stickLength; Y = startY}
{X = startX + Wire.stickLength; Y = startY}; {X = startX + Wire.stickLength; Y = startY}
{X = endX; Y = startY}; {X = endX; Y = startY}
{X = endX; Y = startY}; {X = endX; Y = endY - Wire.stickLength}
{X = endX ; Y = endY - Wire.stickLength} {X = endX; Y = endY - Wire.stickLength}
{X = endX ; Y = endY - Wire.stickLength} {X = endX; Y = endY - Wire.stickLength}
{X = endX; Y = endY} {X = endX; Y = endY}
], ],
true // Left-to-right true // Left-to-right
//fix issue by wrapping wire input port and not through for 1st quadrant //fix issue by wrapping wire input port and not through for 1st quadrant
else if (((startX + endX) / 2.0)>(startX+Wire.stickLength)) then else if (((startX + endX) / 2.0)>(startX+Wire.stickLength)) then
[ [
{X = startX; Y = startY}; {X = startX; Y = startY}
{X = startX + Wire.stickLength; Y = startY}; {X = startX + Wire.stickLength; Y = startY}
{X = startX + Wire.stickLength; Y = startY}; {X = startX + Wire.stickLength; Y = startY}
{X = (startX + endX) / 2.0; Y = startY}; {X = (startX + endX) / 2.0; Y = startY}
{X = (startX + endX) / 2.0; Y = endY-Wire.stickLength}; {X = (startX + endX) / 2.0; Y = endY - Wire.stickLength}
{X = endX; Y = endY-Wire.stickLength}; {X = endX; Y = endY - Wire.stickLength}
{X = endX; Y = endY-Wire.stickLength}; {X = endX; Y = endY - Wire.stickLength}
{X = endX; Y = endY} {X = endX; Y = endY}
], false ], false
else if (((startY + endY) / 2.0)>(startY+Wire.stickLength)) then
[
{X = startX; Y = startY}
{X = startX + Wire.stickLength; Y = startY}
{X = startX + Wire.stickLength; Y = startY}
{X = startX + Wire.stickLength; Y = startY}
{X = startX + Wire.stickLength; Y = ((startY + endY) - Wire.stickLength) / 2.0}
{X = endX; Y = ((startY + endY) - Wire.stickLength) / 2.0}
{X = endX; Y = endY - Wire.stickLength}
{X = endX; Y = endY}
],
false
else else
[ [
{X = startX; Y = startY}; {X = startX; Y = startY}
{X = startX + Wire.stickLength; Y = startY}; {X = startX + Wire.stickLength; Y = startY}
{X = startX + Wire.stickLength; Y = startY}; {X = startX + Wire.stickLength; Y = startY}
{X = startX + Wire.stickLength; Y = startY}; {X = startX + Wire.stickLength; Y = startY}
{X = startX + Wire.stickLength; Y = endY - Wire.stickLength}; {X = startX + Wire.stickLength; Y = endY - Wire.stickLength}
{X = endX; Y = endY - Wire.stickLength}; {X = endX; Y = endY - Wire.stickLength}
{X = endX; Y = endY - Wire.stickLength}; {X = endX; Y = endY - Wire.stickLength}
{X = endX; Y = endY} {X = endX; Y = endY}
], ],
false false
@ -479,11 +491,11 @@ let initialWireVerticesFromPorts
if abs (endX - startX) >= Wire.stickLength * 2.0 if abs (endX - startX) >= Wire.stickLength * 2.0
&& endY >= startY then && endY >= startY then
[ [
{X = startX; Y = startY}; {X = startX; Y = startY}
{X = startX ; Y = startY - Wire.stickLength}; {X = startX ; Y = startY - Wire.stickLength}
{X = startX ; Y = startY - Wire.stickLength}; {X = startX ; Y = startY - Wire.stickLength}
{X = endX; Y = startY - Wire.stickLength}; {X = startX ; Y = startY - Wire.stickLength}
{X = endX; Y = startY - Wire.stickLength}; {X = endX; Y = startY - Wire.stickLength}
{X = endX ; Y = endY - Wire.stickLength} {X = endX ; Y = endY - Wire.stickLength}
{X = endX ; Y = endY - Wire.stickLength} {X = endX ; Y = endY - Wire.stickLength}
{X = endX; Y = endY} {X = endX; Y = endY}
@ -499,13 +511,13 @@ let initialWireVerticesFromPorts
// + - + + - + // + - + + - +
elif abs (endX - startX) >= Wire.stickLength * 2.0 then elif abs (endX - startX) >= Wire.stickLength * 2.0 then
[ [
{X = startX; Y = startY}; {X = startX; Y = startY}
{X = startX ; Y = startY - Wire.stickLength}; {X = startX ; Y = startY - Wire.stickLength}
{X = startX ; Y = endY - Wire.stickLength}; {X = startX ; Y = startY - Wire.stickLength}
{X = endX; Y = endY - Wire.stickLength}; {X = startX ; Y = endY - Wire.stickLength}
{X = endX; Y = endY - Wire.stickLength}; {X = endX; Y = endY - Wire.stickLength}
{X = endX ; Y = endY - Wire.stickLength} {X = endX; Y = endY - Wire.stickLength}
{X = endX ; Y = endY - Wire.stickLength} {X = endX; Y = endY - Wire.stickLength}
{X = endX; Y = endY} {X = endX; Y = endY}
], ],
true // Left-to-right true // Left-to-right
@ -518,15 +530,27 @@ let initialWireVerticesFromPorts
// + - + E or S + - + // + - + E or S + - +
// | | | | // | | | |
// + - + + - + // + - + + - +
elif endY < startY then
[
{X = startX; Y = startY}
{X = startX; Y = startY - Wire.stickLength}
{X = startX; Y = startY - Wire.stickLength}
{X = startX; Y = ((startY + endY) / 2.0) - Wire.stickLength}
{X = endX + Wire.stickLength * 4.0; Y = ((startY + endY) / 2.0) - Wire.stickLength}
{X = endX + Wire.stickLength * 4.0; Y = endY - Wire.stickLength}
{X = endX; Y = endY - Wire.stickLength}
{X = endX; Y = endY}
],
false // Not left-to-right
else else
[ [
{X = startX; Y = startY}; {X = startX; Y = startY}
{X = startX ; Y = startY - Wire.stickLength}; {X = startX ; Y = startY - Wire.stickLength}
{X = startX ; Y = startY - Wire.stickLength}; {X = startX + Wire.stickLength * 4.0; Y = startY - Wire.stickLength}
{X = startX + Wire.stickLength * 4.5 ; Y = startY - Wire.stickLength}; {X = startX + Wire.stickLength * 4.0; Y = ((startY + endY) / 2.0) - Wire.stickLength}
{X = startX + Wire.stickLength * 4.5 ; Y = endY - Wire.stickLength}; {X = endX; Y = ((startY + endY) / 2.0) - Wire.stickLength}
{X = endX; Y = endY - Wire.stickLength}; {X = endX; Y = endY - Wire.stickLength}
{X = endX; Y = endY - Wire.stickLength}; {X = endX; Y = endY - Wire.stickLength}
{X = endX; Y = endY} {X = endX; Y = endY}
], ],
false // Not left-to-right false // Not left-to-right
@ -567,13 +591,13 @@ let convertVerticesToASegs connId (isLeftToRight: bool) routetype rotation (yref
| Sameside-> | Sameside->
match isLeftToRight with match isLeftToRight with
| true -> | true ->
[Vertical;Vertical;Horizontal;Horizontal;Vertical;Vertical;Vertical] [Vertical;Horizontal;Vertical;Horizontal;Vertical;Horizontal;Vertical]
| false -> | false ->
[Vertical;Vertical;Horizontal;Vertical;Horizontal;Vertical;Vertical] [Vertical;Horizontal;Vertical;Horizontal;Vertical;Horizontal;Vertical]
| Rightangle-> | Rightangle->
match isLeftToRight with match isLeftToRight with
| true -> | true ->
[Horizontal;Horizontal;Horizontal;Horizontal;Vertical;Vertical;Vertical] [Horizontal;Vertical;Horizontal;Vertical;Horizontal;Vertical;Vertical]
| false -> | false ->
[Horizontal;Vertical;Horizontal;Vertical;Horizontal;Vertical;Vertical] [Horizontal;Vertical;Horizontal;Vertical;Horizontal;Vertical;Vertical]