Header menu logo issie

BusWireUpdateHelpers Module

Types

Type Description

CircleT

PortInfo

Contains geometric information of a port

SegInfo

type used internally by modern wire circle calculation code For a horizontal segment (x1,y) -> (x2,y): P = y, Qmin = min y1 y2, Qmax = max y1 y2 For a vertical segment (x,y1) -> (x,y2) x & y are reversed, so P = x etc. TODO - replace Index by Segment.

Functions and values

Function or value Description

autoroute model wire

Full Usage: autoroute model wire

Parameters:
Returns: Wire

Returns a newly autorouted version of a wire for the given model

model : Model
wire : Wire
Returns: Wire

close a b

Full Usage: close a b

Parameters:
    a : float
    b : float

Returns: bool
Modifiers: inline
a : float
b : float
Returns: bool

closeBy d a b

Full Usage: closeBy d a b

Parameters:
    d : float
    a : float
    b : float

Returns: bool
Modifiers: inline
d : float
a : float
b : float
Returns: bool

coalesceInWire wId model

Full Usage: coalesceInWire wId model

Parameters:
Returns: Model

If as the result of a drag a zero length segment separates two other draggable segments the wire should be simplified by removing the zero-length segment and joining together the draggables.

wId : ConnectionId
model : Model
Returns: Model

deleteWiresWithPort delPorts model

Full Usage: deleteWiresWithPort delPorts model

Parameters:
Returns: Model
delPorts : Port option list
model : Model
Returns: Model

distanceBetweenPointAndSegment segStart segEnd point

Full Usage: distanceBetweenPointAndSegment segStart segEnd point

Parameters:
Returns: float option

Returns Some distance between a point and a segment defined by a start and end XYPos, and None if the segment is of 0 length (can't be clicked)

segStart : XYPos
segEnd : XYPos
point : XYPos
Returns: float option

filterWiresByCompMoved model compIds

Full Usage: filterWiresByCompMoved model compIds

Parameters:
Returns: (type)

Given a model and a list of component Ids, returns an anonymous record containing the id of wires connected to input ports, output ports or both

model : Model
compIds : ComponentId list
Returns: (type)

findJumpIntersects segStart segEnd state seg

Full Usage: findJumpIntersects segStart segEnd state seg

Parameters:
Returns: (type)
Modifiers: inline

Used as a folder in foldOverSegs. Finds all jump offsets in a wire for the segment defined in the state

segStart : XYPos
segEnd : XYPos
state : (type)
seg : Segment
Returns: (type)

genPortInfo edge position

Full Usage: genPortInfo edge position

Parameters:
Returns: PortInfo
Modifiers: inline

Returns a PortInfo object given a port edge and position

edge : Edge
position : XYPos
Returns: PortInfo

getAbsoluteSegmentPos wire target

Full Usage: getAbsoluteSegmentPos wire target

Parameters:
    wire : Wire
    target : int

Returns: XYPos * XYPos

Returns the tuple (startPos, endPos) of the segment at the target index in the given wire. Throws an error if the target index isn't found.

wire : Wire
target : int
Returns: XYPos * XYPos

getClickedSegment model wireId mouse

Full Usage: getClickedSegment model wireId mouse

Parameters:
Returns: ASegment list

Finds the closest non-zero-length segment in a wire to a mouse click using euclidean distance. Return it and all overlapping same-direction same-net segments

model : Model
wireId : ConnectionId
mouse : XYPos
Returns: ASegment list

getConnectedWireIds model compIds

Full Usage: getConnectedWireIds model compIds

Parameters:
Returns: ConnectionId list

Returns the IDs of the wires in the model connected to a list of components given by compIds

model : Model
compIds : ComponentId list
Returns: ConnectionId list

getConnectedWires model compIds

Full Usage: getConnectedWires model compIds

Parameters:
Returns: Wire list

Returns the IDs of the wires in the model connected to a list of components given by compIds

model : Model
compIds : ComponentId list
Returns: Wire list

getFilteredIdList condition wireLst

Full Usage: getFilteredIdList condition wireLst

Parameters:
    condition : Wire -> bool
    wireLst : Wire list

Returns: ConnectionId list

Returns a list of wire IDs that meet the given condition

condition : Wire -> bool
wireLst : Wire list
Returns: ConnectionId list

getHVSegs wire

Full Usage: getHVSegs wire

Parameters:
Returns: SegInfo list * SegInfo list

get segments on wire partitioned horizontal and vertical. small length segments are not included, since this is to determine modern circle placement

wire : Wire
Returns: SegInfo list * SegInfo list

getLengthDiff difference startPos endPos

Full Usage: getLengthDiff difference startPos endPos

Parameters:
Returns: float

Returns the length to change a segment represented by startPos -> endPos in the appropriate dimension of the difference vector.

difference : XYPos
startPos : XYPos
endPos : XYPos
Returns: float

getManualIndex segList

Full Usage: getManualIndex segList

Parameters:
Returns: int option

Given a segment list, returns the first manual segment index

segList : Segment list
Returns: int option

getOrientationOfEdge edge

Full Usage: getOrientationOfEdge edge

Parameters:
Returns: Orientation
Modifiers: inline

Gets a wire orientation given a port edge

edge : Edge
Returns: Orientation

getPartialRouteStart wire manualIndex

Full Usage: getPartialRouteStart wire manualIndex

Parameters:
    wire : Wire
    manualIndex : int

Returns: XYPos

Gets the start position for partial routing.

wire : Wire
manualIndex : int
Returns: XYPos

getSafeDistanceForMove segments index distance

Full Usage: getSafeDistanceForMove segments index distance

Parameters:
    segments : Segment list
    index : int
    distance : float

Returns: float

Returns a distance for a wire move that has been reduced if needed to enforce minimum first/last segment lengths. These prevent the first non-zero segment perpendicular to the nubs to be dragged closer than Constants.nubLength TODO - this can maybe be simplified given we now coalesce segments

segments : Segment list
index : int
distance : float
Returns: float

getWireList model

Full Usage: getWireList model

Parameters:
Returns: Wire list

Returns a list of all the wires in the given model

model : Model
Returns: Wire list

makeAllJumps wiresWithNoJumps model

Full Usage: makeAllJumps wiresWithNoJumps model

Parameters:
Returns: Model

Returns a model with all the jumps updated

wiresWithNoJumps : ConnectionId list
model : Model
Returns: Model

makeEndsDraggable segments

Full Usage: makeEndsDraggable segments

Parameters:
Returns: Segment list

After coalescing a wire the wire ends may no longer be draggable. This function checks this and adds two segments to correct the problem if necessary. The added segments will not alter wire appearance. The transformation is: BEFORE: 1st seg length x. AFTER: 1st segment length nubLength -> zero-length seg -> segment length x - nubLength

segments : Segment list
Returns: Segment list

moveSegment model seg distance

Full Usage: moveSegment model seg distance

Parameters:
Returns: Wire

Returns a wwireOf_aining the updated list of segments after a segment is moved by a specified distance. The moved segment is tagged as manual so that it is no longer auto-routed. Throws an error if the index of the segment being moved is not a valid movable segment index.

model : Model
seg : Segment
distance : float
Returns: Wire

partialAutoroute model wire newPortPos reversed

Full Usage: partialAutoroute model wire newPortPos reversed

Parameters:
Returns: Wire option

Returns None if full autoroute is required or applies partial autorouting from the start of the wire at newPortPos to the first manually routed segment and returns Some wire with the new segments.

model : Model
wire : Wire
newPortPos : XYPos
reversed : bool
Returns: Wire option

partitionSegments segs manualIdx

Full Usage: partitionSegments segs manualIdx

Parameters:
    segs : 'a list
    manualIdx : int

Returns: 'a list * 'a list * 'a list

Partitions a segment list into sections 3 sections for partial autorouting

segs : 'a list
manualIdx : int
Returns: 'a list * 'a list * 'a list

relativePosition origin pos

Full Usage: relativePosition origin pos

Parameters:
Returns: (type)

Returns an anonymous record indicating the position of pos relative to origin. The isAbove field indicates whether pos is above (true) or below (false) origin. The isLeft field indicates whether pos is to the left (true) or to the right (false) of origin.

origin : XYPos
pos : XYPos
Returns: (type)

removeZeroSegment segs indexToRemove

Full Usage: removeZeroSegment segs indexToRemove

Parameters:
    segs : Segment list
    indexToRemove : int

Returns: Segment list

Used when two segments can be coalesced by removing a zero segment separating them

segs : Segment list
indexToRemove : int
Returns: Segment list

resetJumps model

Full Usage: resetJumps model

Parameters:
Returns: Model
model : Model
Returns: Model

resetJumpsOrIntersections wire

Full Usage: resetJumpsOrIntersections wire

Parameters:
Returns: Wire
wire : Wire
Returns: Wire

resetModelJumpsOrIntersections model

Full Usage: resetModelJumpsOrIntersections model

Parameters:
Returns: Model
model : Model
Returns: Model

resetWireJumpsOrIntersections wire

Full Usage: resetWireJumpsOrIntersections wire

Parameters:
Returns: Wire
wire : Wire
Returns: Wire

resetWireSegmentJumps wireList model

Full Usage: resetWireSegmentJumps wireList model

Parameters:
Returns: Model

This function updates the wire model by removing from the stored lists of intersections all those generated by wireList wires. intersetcions are stored in maps on the model and on the horizontal segments containing the jumps

wireList : ConnectionId list
model : Model
Returns: Model

resetWireToAutoKeepingPositionOpt wire

Full Usage: resetWireToAutoKeepingPositionOpt wire

Parameters:
Returns: Wire option

If wire contains one or more manally routed segments return Some wire' where wire' has all manual segments chnaged to auto. Return None if no change is required (the normal case).

wire : Wire
Returns: Wire option

reverseWire wire

Full Usage: reverseWire wire

Parameters:
Returns: Wire

Reverses a wire so that it may be processed in the opposite direction. This function is self-inverse.

wire : Wire
Returns: Wire

rotate90Edge edge

Full Usage: rotate90Edge edge

Parameters:
Returns: Edge
Modifiers: inline

Returns an edge rotated 90 degrees anticlockwise

edge : Edge
Returns: Edge

rotate90Port port

Full Usage: rotate90Port port

Parameters:
Returns: PortInfo
Modifiers: inline

Returns a port rotated 90 degrees anticlockwise about the origin

port : PortInfo
Returns: PortInfo

rotateSegments target wire

Full Usage: rotateSegments target wire

Parameters:
    target : Edge
    wire : (type)

Returns: (type)

Returns an anonymous record containing the starting symbol edge of a wire and its segment list that has been rotated to a target symbol edge.

target : Edge
wire : (type)
Returns: (type)

rotateSegments90 initialOrientation

Full Usage: rotateSegments90 initialOrientation

Parameters:
Returns: Segment list -> Segment list

Returns a function to rotate a segment list 90 degrees about the origin, depending on its initial orientation

initialOrientation : Orientation
Returns: Segment list -> Segment list

rotateStartDest target (arg2, arg3)

Full Usage: rotateStartDest target (arg2, arg3)

Parameters:
Returns: PortInfo * PortInfo

Returns a version of the start and destination ports rotated until the start edge matches the target edge.

target : Edge
arg1 : PortInfo
arg2 : PortInfo
Returns: PortInfo * PortInfo

samePos pos1 pos2

Full Usage: samePos pos1 pos2

Parameters:
Returns: bool
Modifiers: inline
pos1 : XYPos
pos2 : XYPos
Returns: bool

updateCirclesOnAllNets model

Full Usage: updateCirclesOnAllNets model

Parameters:
Returns: Model

Update all the modern routing circles in the model

model : Model
Returns: Model

updateCirclesOnNet model wiresInNet

Full Usage: updateCirclesOnNet model wiresInNet

Parameters:
Returns: Model

Update all the modern routing circles on the net of wires: wiresInNet

model : Model
wiresInNet : Wire list
Returns: Model

updateCirclesOnSegments wiresToUpdate circles model

Full Usage: updateCirclesOnSegments wiresToUpdate circles model

Parameters:
Returns: Model
wiresToUpdate : Wire list
circles : CircleT list
model : Model
Returns: Model

updateSegmentJumpsOrIntersections targetSeg intersectOrJump wireMap

Full Usage: updateSegmentJumpsOrIntersections targetSeg intersectOrJump wireMap

Parameters:
Returns: Map<ConnectionId, Wire>

Returns an updated wireMap with the IntersectOrJumpList of targetSeg replaced by jumps or modern intersections.

targetSeg : Segment
intersectOrJump : float list
wireMap : Map<ConnectionId, Wire>
Returns: Map<ConnectionId, Wire>

updateWireSegmentJumps wireList model

Full Usage: updateWireSegmentJumps wireList model

Parameters:
Returns: Model
wireList : ConnectionId list
model : Model
Returns: Model

Type something to start searching.