BusWireUpdateHelpers Module
Types
| Type | Description |
Functions and values
| Function or value | Description |
|
Returns a newly autorouted version of a wire for the given model. The route is worked out between the points where the two nubs CROSS their symbols' bounding boxes, and the end nubs are then lengthened to reach the ports themselves. For nearly every port those are the same point and this does nothing. Where they are not - a Mux2's SEL sits nine units inside its box - it is what keeps every pass downstream honest. The alternative, routing from the port and asking routing and separation to understand that the first nine units of the wire are inside a symbol they are meant to avoid, was tried: the intersection test needed a multiplexer exemption, separation needed its own, and the two disagreed about which side of the box edge a segment sitting exactly ON it was - which is how a wire arriving at a SEL port came to be drawn through the multiplexer. In this frame the wire's end is ON the box, the room between the two boxes is what `roomForNub` measures, and a symbol's edge stops its own wires being pulled inside it like anyone else's.
|
Full Usage:
close a b
Parameters:
float
b : float
Returns: bool
Modifiers: inline |
|
Full Usage:
closeBy d a b
Parameters:
float
a : float
b : float
Returns: bool
Modifiers: inline |
|
|
|
|
|
|
|
|
|
Full Usage:
filterWiresByCompMoved model compIds
Parameters:
Model
compIds : ComponentId list
Returns: (type)
|
|
|
|
|
|
|
|
Full Usage:
getClickedSegment model wireId mouse
Parameters:
Model
wireId : ConnectionId
mouse : XYPos
Returns: ASegment list
|
|
Full Usage:
getConnectedWireIds model compIds
Parameters:
Model
compIds : ComponentId list
Returns: ConnectionId list
|
|
Full Usage:
getConnectedWires model compIds
Parameters:
Model
compIds : ComponentId list
Returns: Wire list
|
|
|
|
|
|
|
|
|
|
Full Usage:
getOrientationOfEdge edge
Parameters:
Edge
Returns: Orientation
Modifiers: inline |
|
|
|
Full Usage:
getSafeDistanceForMove segments index distance
Parameters:
Segment list
index : int
distance : float
Returns: float
|
|
|
|
|
|
Full Usage:
makeAllJumps wiresWithNoJumps model
Parameters:
ConnectionId list
model : Model
Returns: Model
|
|
|
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
|
|
|
|
|
|
|
Full Usage:
partitionSegments segs manualIdx
Parameters:
'a list
manualIdx : int
Returns: 'a list * 'a list * 'a list
|
|
|
How far a port lies INSIDE its own symbol's bounding box, measured along the direction a wire leaves it by. Zero for a port that sits ON the box, which is nearly all of them. A Mux2's Sel is what this is for. The symbol is drawn as a trapezium and the port is on the sloping side, so the bounding box - which is what BOTH routing and separation use as the obstacle - reaches nine units further out than the port does. This is the whole of what the rest of the draw block needs to know about that. Routing and separation both work in the space OUTSIDE the boxes, so a wire's end is taken to be where its nub crosses the box and the first `inset` of that nub is treated as part of the symbol rather than as wire. See `autoroute` below, where the two are converted, and `BusWireRoute` for what it saves: with the wire's end on the box, a symbol's own edge stops it being pulled inside, and no pass downstream needs a special case for a multiplexer.
|
|
|
|
|
|
|
|
|
|
|
|
|
Full Usage:
resetWireSegmentJumps wireList model
Parameters:
ConnectionId list
model : Model
Returns: Model
|
|
|
|
|
|
|
|
|
|
|
|
Full Usage:
rotateSegments90 initialOrientation
Parameters:
Orientation
Returns: Segment list -> Segment list
|
|
|
|
|
|
|
|
|
|
Full Usage:
updateSegmentJumpsOrIntersections targetSeg intersectOrJump wireMap
Parameters:
Segment
intersectOrJump : float list
wireMap : Map<ConnectionId, Wire>
Returns: Map<ConnectionId, Wire>
|
|
Full Usage:
updateWireSegmentJumps wireList model
Parameters:
ConnectionId list
model : Model
Returns: Model
|
|