BusWireRoute Module
Types
| Type | Description |
Functions and values
| Function or value | Description |
|
|
|
|
|
|
|
|
|
|
Full Usage:
findWireSymbolIntersectionsBySegment model wire
Parameters: Returns: (int * BoundingBox list) list
|
Checks if a wire intersects any symbol within +/- minWireSeparation. Returns, for each segment which intersects something, its index and the boxes it intersects. Which segment is in the way is what decides which segment is worth moving, so it is kept rather than flattened away: the shift code below used to choose a segment by the wire's segment count, which is a guess where this is the answer.
|
|
|
|
|
Full Usage:
maxVertDistanceFromBox intersectedBoxes wireOrientation pos
Parameters:
BoundingBox list
wireOrientation : Orientation
pos : XYPos
Returns: VertDistFromBoundingBox option
|
|
|
Re-route the wires which touch a symbol that has moved. A wire with both ends on moved symbols keeps its shape and is handed to `translate` - it moves with them. The routing comes off the wires that are going to be autorouted BEFORE any of them is routed, as `redrawWires` does and for the same reason: a wire may be routed as a branch off another wire of its own net, and a route which is about to be thrown away is not one to follow. `sameNetRoutes` passes over a wire with no segments, so what each wire can see is exactly the wires that are where they now belong - the ones already re-routed, and the ones that never moved. A wire the user has routed by hand keeps its segments: `partialAutoroute` holds the shape they dragged it into by working from the segments already there, and there is nothing to recover that from once they are gone. Those are re-routed before the autorouted ones, so that the rest of their net can follow them. Autorouted wires go shortest first, again as `redrawWires` does: a short wire has the least freedom in where it can go, so it is the one that should already be there when a longer wire of its net is looking for something to join.
|
|
Every way of routing `wire` as a branch off a wire of its own net which is already routed, each paired with how far its branch point is from the destination. A branch takes over the reference wire's start position, so every wire it may follow has to be one that is drawn from where the driver port is NOW. A wire with no segments is passed over, which is what makes taking the routing off a set of wires before routing any of them enough to guarantee it - see `rerouteMovedWires`. Follow a wire that has not been re-routed since its driver moved and this wire is drawn from where that port used to be, joined to nothing. That distance is the whole of the choice: take the first of these that is legal and the branch point is the nearest one to the destination that works, which is the one the wire can follow for longest. The ordinary route belongs in the same ordering - it is the branch at the driver port, where nothing is shared - so a branch is taken only when it starts nearer the destination than starting again from the port would.
|
|
|
|
|
Full Usage:
tryMaxDistance distances
Parameters:
VertDistFromBoundingBox option list
Returns: VertDistFromBoundingBox option
|
|
Full Usage:
tryShiftHorizontalSeg callsLeft model intersectedBoxes wire
Parameters:
int
model : Model
intersectedBoxes : BoundingBox list
wire : Wire
Returns: Wire option
|
Recursively shift horizontal seg up/down until no symbol intersections. Limit in recursion depth defined by argument callsLeft given to initial function call. Limit needed to prevent Issie from breaking when there are physically no possible routes that achieve 0 intersections. Returns None if no route found
|
Full Usage:
tryShiftVerticalSeg model intersectedBoxes wire
Parameters:
Model
intersectedBoxes : BoundingBox list
wire : Wire
Returns: Wire option
|
|
|
|
Full Usage:
updateWires model compIdList diff
Parameters:
Model
compIdList : ComponentId list
diff : XYPos
Returns: Model
|
Re-routes the wires in the model based on a list of components that have been altered. If the wire input and output ports are both in the list of moved components, it does not re-route wire but instead translates it. Keeps manual wires manual (up to a point). Otherwise it will auto-route wires connected to components that have moved
|