Header menu logo issie

BusWireRoute Module

Types

Type Description

VertDistFromBoundingBox

Functions and values

Function or value Description

changeSegment segIndex newLength segments

Full Usage: changeSegment segIndex newLength segments

Parameters:
    segIndex : int
    newLength : float
    segments : Segment list

Returns: Segment list

update the length of a segment in a list of segments

segIndex : int
newLength : float
segments : Segment list
Returns: Segment list

copySegments wire refWire numOfSegsToCopy

Full Usage: copySegments wire refWire numOfSegsToCopy

Parameters:
    wire : Wire
    refWire : Wire
    numOfSegsToCopy : int

Returns: Segment list
wire : Wire
refWire : Wire
numOfSegsToCopy : int
Returns: Segment list

ensureBothNubs

Full Usage: ensureBothNubs

Returns: Wire -> Wire
Returns: Wire -> Wire

ensureStartingNub wire

Full Usage: ensureStartingNub wire

Parameters:
Returns: Wire

add a nub and zero length segment to the start of the wire if needed

wire : Wire
Returns: Wire

findWireSymbolIntersections model wire

Full Usage: findWireSymbolIntersections model wire

Parameters:
Returns: BoundingBox list

Bounding boxes of symbols intersected by wire, however many of its segments hit them.

model : Model
wire : Wire
Returns: BoundingBox list

findWireSymbolIntersectionsBySegment model wire

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.

model : Model
wire : Wire
Returns: (int * BoundingBox list) list

generateEndSegments startIndex numOfSegs wire

Full Usage: generateEndSegments startIndex numOfSegs wire

Parameters:
    startIndex : int
    numOfSegs : int
    wire : Wire

Returns: Segment list
startIndex : int
numOfSegs : int
wire : Wire
Returns: Segment list

getWireVertices wire

Full Usage: getWireVertices wire

Parameters:
Returns: XYPos list
wire : Wire
Returns: XYPos list

maxVertDistanceFromBox intersectedBoxes wireOrientation pos

Full Usage: maxVertDistanceFromBox intersectedBoxes wireOrientation pos

Parameters:
Returns: VertDistFromBoundingBox option

returns the maximum vertical distance of pos from intersectedBoxes as a VertDistFromBoundingBox or None if there are no intersections

intersectedBoxes : BoundingBox list
wireOrientation : Orientation
pos : XYPos
Returns: VertDistFromBoundingBox option

rerouteMovedWires translate compIdList model

Full Usage: rerouteMovedWires translate compIdList model

Parameters:
Returns: Model

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.

translate : Model -> Wire -> Wire
compIdList : ComponentId list
model : Model
Returns: Model

sameNetRoutes model wire

Full Usage: sameNetRoutes model wire

Parameters:
Returns: (float * Wire) list

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.

model : Model
wire : Wire
Returns: (float * Wire) list

smartAutoroute model wire

Full Usage: smartAutoroute model wire

Parameters:
Returns: Wire

top-level function which replaces autoupdate and implements a smarter version of same it is called every time a new wire is created, so is easily tested.

model : Model
wire : Wire
Returns: Wire

snapToNet model wireToRoute

Full Usage: snapToNet model wireToRoute

Parameters:
Returns: Wire

Finds the first reference wire in a net and keeps the same segment lengths as much as possible based on a heuristic. Snap to net only implemented for one orientation

model : Model
wireToRoute : Wire
Returns: Wire

tryMaxDistance distances

Full Usage: tryMaxDistance distances

Parameters:
Returns: VertDistFromBoundingBox option
distances : VertDistFromBoundingBox option list
Returns: VertDistFromBoundingBox option

tryShiftHorizontalSeg callsLeft model intersectedBoxes wire

Full Usage: tryShiftHorizontalSeg callsLeft model intersectedBoxes wire

Parameters:
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

callsLeft : int
model : Model
intersectedBoxes : BoundingBox list
wire : Wire
Returns: Wire option

tryShiftVerticalSeg model intersectedBoxes wire

Full Usage: tryShiftVerticalSeg model intersectedBoxes wire

Parameters:
Returns: Wire option

Try shifting vertical seg (index 3) to either - wireSeparationFromSymbol or + wireSeparationFromSymbol from the edge of all the intersectedBoundingBoxes symbols. Returns None if no route found.

model : Model
intersectedBoxes : BoundingBox list
wire : Wire
Returns: Wire option

updateWire model wire reverse

Full Usage: updateWire model wire reverse

Parameters:
Returns: Wire

Returns a single re-routed wire from the given model. First attempts partial autorouting, and defaults to full autorouting if this is not possible. Reverse indicates if the wire should be processed in reverse, used when an input port (end of wire) is moved.

model : Model
wire : Wire
reverse : bool
Returns: Wire

updateWires model compIdList diff

Full Usage: updateWires model compIdList diff

Parameters:
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

model : Model
compIdList : ComponentId list
diff : XYPos
Returns: Model

Type something to start searching.