Issie logo Issie

BusWire Module

Types and nested modules

Type/Module Description

Constants

WireRenderProps

Type passed to wire renderer functions. The data here is cached by React and if the same as last time the render function itself is not called.

WireRun

A maximal straight piece of a wire: all of it between two consecutive bends of the shape that is drawn. A wire's segment list is not that shape - it holds zero-length segments, and splits one straight piece over several segments - so radial rendering must work on runs and not on segments, or it rounds a corner where the wire is straight and squares one off where it bends.

Functions and values

Function or value Description

extractConnection wModel cId

Full Usage: extractConnection wModel cId

Parameters:
Returns: Connection

This function is given a ConnectionId and it converts the corresponding BusWire.Wire type to a Connection type, offering an interface between our implementation and Issie.

wModel : Model
cId : ConnectionId
Returns: Connection

extractConnections wModel

Full Usage: extractConnections wModel

Parameters:
Returns: Connection list

This function is given a list of ConnectionId and it converts the corresponding BusWire.Wire(s) to a list of Connections, offering an interface between our implementation and Issie.

wModel : Model
Returns: Connection list

getASegmentFromId model (arg2, arg3)

Full Usage: getASegmentFromId model (arg2, arg3)

Parameters:
Returns: ASegment
Modifiers: inline
model : Model
arg1 : int
arg2 : ConnectionId
Returns: ASegment

getFixedCoord aSeg

Full Usage: getFixedCoord aSeg

Parameters:
Returns: float
Modifiers: inline

Get the coordinate fixed in an ASegment. NB - ASegments can't be zero length

aSeg : ASegment
Returns: float

getSegmentFromId model (arg2, arg3)

Full Usage: getSegmentFromId model (arg2, arg3)

Parameters:
Returns: Segment
Modifiers: inline
model : Model
arg1 : int
arg2 : ConnectionId
Returns: Segment

getSegmentOrientation segStart segEnd

Full Usage: getSegmentOrientation segStart segEnd

Parameters:
Returns: Orientation
Modifiers: inline

Given a segment start and end position, finds the orientation of the segment. Fails if the segment is neither horizontal nor vertical

segStart : XYPos
segEnd : XYPos
Returns: Orientation

getSegmentOrientationOpt segStart segEnd

Full Usage: getSegmentOrientationOpt segStart segEnd

Parameters:
Returns: Orientation option
Modifiers: inline

Given a segment start and end position, finds the orientation of the segment. Returns None if the segment is 0 length

segStart : XYPos
segEnd : XYPos
Returns: Orientation option

getWireOutgoingEdge wire

Full Usage: getWireOutgoingEdge wire

Parameters:
Returns: Edge
Modifiers: inline

Given a segment start and end position, finds the symbol edge of the segment based on its segment direction if it starts an outgoing wire.

wire : Wire
Returns: Edge

issieVerticesToSegments connId verticesList

Full Usage: issieVerticesToSegments connId verticesList

Parameters:
    connId : ConnectionId
    verticesList : (float * float * bool) list

Returns: Segment list

Convert a (possibly legacy) issie Connection stored as a list of vertices to a list of segments

connId : ConnectionId
verticesList : (float * float * bool) list
Returns: Segment list

logSegmentId seg

Full Usage: logSegmentId seg

Parameters:
Returns: string

Identifies a segment as wire:index, short enough to read in a log line.

seg : Segment
Returns: string

makeInitialSegmentsList hostId startPos endPos portOrientation

Full Usage: makeInitialSegmentsList hostId startPos endPos portOrientation

Parameters:
Returns: Segment list

Given the coordinates of two port locations that correspond to the endpoints of a wire, as well as the orientation of the final port this function returns a list of Segment(s). The starting segment will always be from a Right Edge (and so in increasing X direction)

hostId : ConnectionId
startPos : XYPos
endPos : XYPos
portOrientation : Edge
Returns: Segment list

makeInitialWireVerticesList wireStartPos wireEndPos portOrientation

Full Usage: makeInitialWireVerticesList wireStartPos wireEndPos portOrientation

Parameters:
Returns: XYPos list

Given the coordinates of two port locations that correspond to the endpoints of a wire, as well as the final port orientation this function returns a list of wire vertices. The starting segment will always be from a Right Edge (and so in increasing X direction) The two positions are where the wire LEAVES each symbol's bounding box, which for nearly every port is the port itself. Where it is not - a Mux2's Sel sits nine units inside the box, because the symbol is drawn as a trapezium and the port is on the sloping side - the caller hands this the point on the box and lengthens the two end nubs afterwards, so that everything here works in the space a wire is actually free to use. See BusWireUpdateHelpers.autoroute.

wireStartPos : XYPos
wireEndPos : XYPos
portOrientation : Edge
Returns: XYPos list

renderJumpSegment a

Full Usage: renderJumpSegment a

Parameters:
Returns: string list
a : ASegment
Returns: string list

renderJumpWire props

Full Usage: renderJumpWire props

Parameters:
Returns: ReactElement

Function used to render a single wire if the display type is jump

props : WireRenderProps
Returns: ReactElement

renderModernWire props

Full Usage: renderModernWire props

Parameters:
Returns: ReactElement
props : WireRenderProps
Returns: ReactElement

renderRadialBend before after rad

Full Usage: renderRadialBend before after rad

Parameters:
Returns: string

The SVG commands drawing one bend of a radial wire: the line along `before` as far as where the corner starts to be rounded off, then the quarter circle of radius `rad` onto `after`.

before : WireRun
after : WireRun
rad : float
Returns: string

renderRadialWire props

Full Usage: renderRadialWire props

Parameters:
Returns: ReactElement

Function used to render a single wire if the display type is radial

props : WireRenderProps
Returns: ReactElement

renderWireWidthText props

Full Usage: renderWireWidthText props

Parameters:
Returns: ReactElement
props : WireRenderProps
Returns: ReactElement

segmentRuns absSegments

Full Usage: segmentRuns absSegments

Parameters:
Returns: WireRun list

Collapse a wire's absolute segments into the runs between its bends: drop the zero-length segments, which have no shape, and merge whatever is then adjacent and collinear.

absSegments : ASegment list
Returns: WireRun list

view model highlighted dispatch

Full Usage: view model highlighted dispatch

Parameters:
Returns: ReactElement

Function that will render all of the wires within the model, with the display type being set in Model.Type `highlighted` says what to show picked out for a reason the draw block cannot know - see DrawModelType.Highlighted. It is applied to the render props rather than to the model, so a wire whose highlight changes redraws and the rest are left to React's memoisation.

model : Model
highlighted : Highlighted
dispatch : Dispatch<Msg>
Returns: ReactElement

wireBends runs

Full Usage: wireBends runs

Parameters:
Returns: (WireRun * WireRun * float) list

The bends of a radial wire, each paired with the radius its corner is drawn with. A bend eats `rad` off the end of the run either side of it, so a run with a bend at both ends can give half of itself to each, and one at either end of the wire has a single bend and can give all of itself. The radius is therefore the standard one everywhere except where there is genuinely not the room for it: neighbouring bends never overlap, and a short run is the only thing that squares a corner off.

runs : WireRun list
Returns: (WireRun * WireRun * float) list

xyVerticesToSegments connId xyVerticesList

Full Usage: xyVerticesToSegments connId xyVerticesList

Parameters:
Returns: Segment list

Converts a list of vertices into a list of segments

connId : ConnectionId
xyVerticesList : XYPos list
Returns: Segment list

Type something to start searching.