Header menu logo issie

RotateScale Module

Types

Type Description

PortInfo

Record containing all the information required to calculate the position of a port on the sheet.

SymConnDataT

For each edge of the symbol, store a count of how many connections it has to other symbols.

wireSymbols

Functions and values

Function or value Description

adjustPosForBlockFlip flip h w pos

Full Usage: adjustPosForBlockFlip flip h w pos

Parameters:
    flip : FlipType - Flipped horizontally or vertically
    h : float - Original height of symbol (Before flip)
    w : float - Original width of symbol (Before flip)
    pos : XYPos

Returns: XYPos New top left point of the symbol

HLP 23: AUTHOR Ismagilov - Get the new top left of a symbol after it has been flipped

flip : FlipType

Flipped horizontally or vertically

h : float

Original height of symbol (Before flip)

w : float

Original width of symbol (Before flip)

pos : XYPos
Returns: XYPos

New top left point of the symbol

adjustPosForBlockRotation rotation h w pos

Full Usage: adjustPosForBlockRotation rotation h w pos

Parameters:
    rotation : Rotation - Rotated CW or AntiCW
    h : float - Original height of symbol (Before rotation)
    w : float - Original width of symbol (Before rotation)
    pos : XYPos

Returns: XYPos New top left point of the symbol

HLP 23: AUTHOR Ismagilov - Get the new top left of a symbol after it has been rotated

rotation : Rotation

Rotated CW or AntiCW

h : float

Original height of symbol (Before rotation)

w : float

Original width of symbol (Before rotation)

pos : XYPos
Returns: XYPos

New top left point of the symbol

alignPortsOffset movePInfo otherPInfo

Full Usage: alignPortsOffset movePInfo otherPInfo

Parameters:
Returns: XYPos
movePInfo : PortInfo
otherPInfo : PortInfo
Returns: XYPos

alignSymbols wModel symbolToSize otherSymbol

Full Usage: alignSymbols wModel symbolToSize otherSymbol

Parameters:
Returns: Model
wModel : Model
symbolToSize : Symbol
otherSymbol : Symbol
Returns: Model

findSelectedSymbols compList model

Full Usage: findSelectedSymbols compList model

Parameters:
Returns: Symbol list
compList : ComponentId list
model : Model
Returns: Symbol list

flipBlock compList model flip

Full Usage: flipBlock compList model flip

Parameters:
    compList : ComponentId list - List of ComponentId's of selected components
    model : Model - Current symbol model
    flip : FlipType - Type of flip to do

Returns: Model New flipped symbol model

HLP 23: AUTHOR Ismagilov - Flips a block of symbols, returning the new symbol model

compList : ComponentId list

List of ComponentId's of selected components

model : Model

Current symbol model

flip : FlipType

Type of flip to do

Returns: Model

New flipped symbol model

flipPointAboutBlockCentre point center flip

Full Usage: flipPointAboutBlockCentre point center flip

Parameters:
    point : XYPos - Original XYPos
    center : XYPos - The center XYPos that the point is flipped about
    flip : FlipType - Horizontal or Vertical flip

Returns: XYPos New flipped point

HLP 23: AUTHOR Ismagilov - Takes a point Pos, a centre Pos, and a flip type and returns the point flipped about the centre

point : XYPos

Original XYPos

center : XYPos

The center XYPos that the point is flipped about

flip : FlipType

Horizontal or Vertical flip

Returns: XYPos

New flipped point

flipSymbolInBlock flip blockCentre sym

Full Usage: flipSymbolInBlock flip blockCentre sym

Parameters:
    flip : FlipType - Flip horizontally or vertically
    blockCentre : XYPos
    sym : Symbol - Symbol to be flipped

Returns: Symbol New symbol after flipped about block centre.

HLP 23: AUTHOR Ismagilov - Flip a symbol horizontally or vertically in its block.

flip : FlipType

Flip horizontally or vertically

blockCentre : XYPos
sym : Symbol

Symbol to be flipped

Returns: Symbol

New symbol after flipped about block centre.

getBlock symbols

Full Usage: getBlock symbols

Parameters:
Returns: BoundingBox Bounding Box

HLP 23: AUTHOR Ismagilov - Get the bounding box of multiple selected symbols

symbols : List<Symbol>

Selected symbols list

Returns: BoundingBox

Bounding Box

getOppEdgePortInfo wModel symbolToSize otherSymbol

Full Usage: getOppEdgePortInfo wModel symbolToSize otherSymbol

Parameters:
Returns: (PortInfo * PortInfo) option

Try to get two ports that are on opposite edges.

wModel : Model
symbolToSize : Symbol
otherSymbol : Symbol
Returns: (PortInfo * PortInfo) option

getPortAB wModel wireSyms

Full Usage: getPortAB wModel wireSyms

Parameters:
Returns: Port * Port
wModel : Model
wireSyms : wireSymbols
Returns: Port * Port

getScalingFactorAndOffsetCentre min matchMin max matchMax

Full Usage: getScalingFactorAndOffsetCentre min matchMin max matchMax

Parameters:
    min : float
    matchMin : float
    max : float
    matchMax : float

Returns: float * float
min : float
matchMin : float
max : float
matchMax : float
Returns: float * float

getScalingFactorAndOffsetCentreGroup matchBBMin matchBBMax selectedSymbols

Full Usage: getScalingFactorAndOffsetCentreGroup matchBBMin matchBBMax selectedSymbols

Parameters:
Returns: (float * float) * (float * float)
matchBBMin : XYPos
matchBBMax : XYPos
selectedSymbols : Symbol list
Returns: (float * float) * (float * float)

groupNewSelectedSymsModel compList model selectedSymbols modifySymbolFunc

Full Usage: groupNewSelectedSymsModel compList model selectedSymbols modifySymbolFunc

Parameters:
Returns: Model
compList : ComponentId list
model : Model
selectedSymbols : Symbol list
modifySymbolFunc : Symbol -> Symbol
Returns: Model

makePortInfo sym port

Full Usage: makePortInfo sym port

Parameters:
Returns: PortInfo

TODO: this is mostly copy pasted code from Symbol.getPortPos, perhaps abstract out the existing code there to use makePortInfo. Could not simply use getPortPos because more data (side, topBottomGap, etc.) is needed to caclulate the new dimensions of the resized symbol.

sym : Symbol
port : Port
Returns: PortInfo

noSymbolOverlap boxesIntersect boundingBoxes sym

Full Usage: noSymbolOverlap boxesIntersect boundingBoxes sym

Parameters:
Returns: bool
boxesIntersect : BoundingBox -> BoundingBox -> bool
boundingBoxes : Map<ComponentId, BoundingBox>
sym : Symbol
Returns: bool

oneCompBoundsBothEdges selectedSymbols

Full Usage: oneCompBoundsBothEdges selectedSymbols

Parameters:
    selectedSymbols : Symbol list

Returns: bool
selectedSymbols : Symbol list
Returns: bool

optimiseSymbol wModel symbol boundingBoxes

Full Usage: optimiseSymbol wModel symbol boundingBoxes

Parameters:
Returns: Model

Finds the optimal size and position for the selected symbol w.r.t. to its surrounding symbols.

wModel : Model
symbol : Symbol
boundingBoxes : Map<ComponentId, BoundingBox>
Returns: Model

postUpdateScalingBox (model, cmd)

Full Usage: postUpdateScalingBox (model, cmd)

Parameters:
Returns: Model * Cmd<Msg>
model : Model
cmd : Cmd<Msg>
Returns: Model * Cmd<Msg>

reSizeSymbol wModel symbolToSize otherSymbol

Full Usage: reSizeSymbol wModel symbolToSize otherSymbol

Parameters:
Returns: Symbol

HLP23: To test this, it must be given two symbols interconnected by wires. It then resizes symbolToSize so that the connecting wires are exactly straight HLP23: It should work out the interconnecting wires (wires) from the two symbols, wModel.Wires and sModel.Ports It will do nothing if symbolToOrder is not a Custom component (which has adjustable size).

wModel : Model
symbolToSize : Symbol
otherSymbol : Symbol
Returns: Symbol

reSizeSymbolTopLevel wModel symbolToSize otherSymbol

Full Usage: reSizeSymbolTopLevel wModel symbolToSize otherSymbol

Parameters:
Returns: Model

For UI to call ResizeSymbol.

wModel : Model
symbolToSize : Symbol
otherSymbol : Symbol
Returns: Model

rotateBlock compList model rotation

Full Usage: rotateBlock compList model rotation

Parameters:
    compList : ComponentId list - List of ComponentId's of selected components
    model : Model - Current symbol model
    rotation : Rotation - Type of rotation to do

Returns: Model New rotated symbol model

HLP 23: AUTHOR Ismagilov - Rotates a block of symbols, returning the new symbol model

compList : ComponentId list

List of ComponentId's of selected components

model : Model

Current symbol model

rotation : Rotation

Type of rotation to do

Returns: Model

New rotated symbol model

rotatePointAboutBlockCentre point centre rotation

Full Usage: rotatePointAboutBlockCentre point centre rotation

Parameters:
    point : XYPos - Original XYPos
    centre : XYPos
    rotation : Rotation - Clockwise or Anticlockwise

Returns: XYPos New flipped point

HLP 23: AUTHOR Ismagilov - Takes a point Pos, a centre Pos, and a rotation type and returns the point flipped about the centre

point : XYPos

Original XYPos

centre : XYPos
rotation : Rotation

Clockwise or Anticlockwise

Returns: XYPos

New flipped point

rotateSymbolByDegree degree sym

Full Usage: rotateSymbolByDegree degree sym

Parameters:
Returns: Symbol

HLP 23: AUTHOR Klapper - Rotates a symbol based on a degree, including: ports and component parameters.

degree : Rotation
sym : Symbol
Returns: Symbol

rotateSymbolInBlock rotation blockCentre sym

Full Usage: rotateSymbolInBlock rotation blockCentre sym

Parameters:
    rotation : Rotation - Clockwise or Anticlockwise rotation
    blockCentre : XYPos
    sym : Symbol - Symbol to be rotated

Returns: Symbol New symbol after rotated about block centre.

HLP 23: AUTHOR Ismagilov - Rotate a symbol in its block.

rotation : Rotation

Clockwise or Anticlockwise rotation

blockCentre : XYPos
sym : Symbol

Symbol to be rotated

Returns: Symbol

New symbol after rotated about block centre.

scaleSymbol (arg1, arg2) sym

Full Usage: scaleSymbol (arg1, arg2) sym

Parameters:
    arg0 : float * float
    arg1 : float * float
    sym : Symbol

Returns: Symbol
arg0 : float * float
arg1 : float * float
sym : Symbol
Returns: Symbol

scaleSymbolInBlock scaleType block sym

Full Usage: scaleSymbolInBlock scaleType block sym

Parameters:
    scaleType : ScaleType - Scale up or down. Scaling distance is constant
    block : BoundingBox - Bounding box of selected components
    sym : Symbol - Symbol to be rotated

Returns: Symbol New symbol after scaled about block centre.

HLP 23: AUTHOR Ismagilov - Scales selected symbol up or down.

scaleType : ScaleType

Scale up or down. Scaling distance is constant

block : BoundingBox

Bounding box of selected components

sym : Symbol

Symbol to be rotated

Returns: Symbol

New symbol after scaled about block centre.

tryWireSymOppEdge wModel wire sym otherSym

Full Usage: tryWireSymOppEdge wModel wire sym otherSym

Parameters:
Returns: Edge option

If a wire between a target symbol and another symbol connects opposite edges, return the edge that the wire is connected to on the target symbol

wModel : Model
wire : Wire
sym : Symbol
otherSym : Symbol
Returns: Edge option

updateOrInsert symConnData edge cid

Full Usage: updateOrInsert symConnData edge cid

Parameters:
Returns: SymConnDataT
symConnData : SymConnDataT
edge : Edge
cid : ComponentId
Returns: SymConnDataT

Type something to start searching.