Header menu logo issie

CommonTypes Module

Types and nested modules

Type/Module Description

Constants

JSONComponent

LegacyCanvas

BoundingBox

CCForm

Type to specify the origin of a custom component

CanvasState

F# data describing the contents of a single schematic sheet.

Component

JSComponent mapped to F# record. Id uniquely identifies the component within a sheet. Label is optional descriptor displayed on schematic.

ComponentId

SHA hash unique to a component - common between JS and F#

ComponentLabel

Human-readable name of component as displayed on sheet. For I/O/labelIO components a width indication eg (7:0) is also displayed, but NOT included here

ComponentType

Connection

JSConnection mapped to F# record. Id uniquely identifies connection globally and is used by library.

ConnectionId

SHA hash unique to a connection - common between JS and F#

ConnectionsWidth

Value set to None if the connection width could not be inferred.

CursorType

Keeps track of what cursor to show

CustomComponentType

Name identifies the LoadedComponent used. The labels define legends on symbol designating inputs or outputs: and are the names of the Input or Output components of the CC sheet. Label strings are unique per CustomComponent. Label position in list determines inputPortNumber or outputPortNumber of label. Multiple CustomComponent instances are differentiated by Component data.

Direction

Holds possible directions to sort ports. HLP23: AUTHOR dgs119

Edge

Represents the sides of a component

FComponentId

Unique identifier for a fast component. The list is the access path, a list of all the containing custom components from the top sheet of the simulation (root first)

GateComponentType

HighLightColor

Colors to highlight components Case name is used as HTML color name. See JSHelpers.getColorString lots of colors can be added, see https://www.w3schools.com/colors/colors_names.asp The Text() method converts it to the correct HTML string Where speed matters the color must be added as a case in the match statement

InitMemData

InputPortId

SHA hash unique to a component port - common between JS and F#. Connection ports and connected component ports have the same port Id InputPortId and OutputPortID wrap the hash to distinguish component inputs and outputs some times (e.g. in simulation)

InputPortNumber

Port numbers are sequential unique with port lists. Inputs and Outputs are both numberd from 0 up.

JSDiagramMsg

Messages sent from draw block

LoadedComponent

Static data describing a schematic sheet loaded as a custom component. Every sheet is always identified with a file from which it is loaded/saved. Name is human readable (and is the filename - without extension) and identifies sheet. File path is the sheet directory and name (with extension). InputLabels, OutputLabels are the I/O connections. The I/O connection integers are bus widths. The I/O connection strings are human readable. The strings are guaranteed to be unique in the I/O connection list. I.e. An input label may be the same as an output label, but two input (or output) labels cannot be the same. The position in the I/O connections list is important as it implicitly indicates the port number. For example, the first element in the InputLabels list is related to the Component's Port with PortNumber 0. Two instances of a loaded component have the same LoadedComponent data.

Memory

Note that any memory addresses which have not been explicitly set when printing out memory data.

Memory1

NBitsArithmetic

 Option of this qualifies NBitsXOr to allow many different components
 None => Xor
 TODO to reduce technical debt: 
     Rename NbitsXor as NBitsCustom, put all the Nbits ops into this D.U.
     Change catalog entries for all NBits ops to use NBitsCustom, alter load to remain compatibility.

NumberBase

OutputPortId

SHA hash unique to a component port - common between JS and F#. Connection ports and connected component ports have the same port Id InputPortId and OutputPortID wrap the hash to distinguish component inputs and outputs some times (e.g. in simulation)

OutputPortNumber

Port numbers are sequential unique with port lists. Inputs and Outputs are both numberd from 0 up.

Port

A component I/O. Id (like any other Id) is a string generated with 32 random hex charactes, so it is (practically) globally unique. These Ids are used to uniquely refer to ports and components. They are generated via uuid(). PortNumber is used to identify which port is which on a component, contiguous from 0 separately for inputs and outputs. See comments above type definition for details HostId is the unique Id of the component where the port is. For example, all three ports on the same And component will have the same HostId.

PortId

PortType

Specify the type of a port in a Component.

Project

Type for an open project which represents a complete design. ProjectPath is directory containing project files. OpenFileName is name of file from which current schematic sheet is loaded/saved, without extension or path LoadedComponents contains the list of schematic sheets, each as a component, one per sheet.

ReducedCanvasState

reduced version of CanvasState for electrical comparison, all geometry removed, components ordered

Rotation

Represents the rotation of a symbol in degrees, Degree0 is the default symbol rotation. Angle is anticlockwise

STransform

Stores the rotation and the flip of the symbol, flipped false by default

SavedWaveInfo

Info saved by Wave Sim. This info is not necessarilu uptodate with deletions or additions in the Diagram. The wavesim code processing this will not fail if non-existent nets are referenced.

ScaleAdjustment

SegmentId

type to uniquely identify a segment

SheetInfo

Info regarding sheet saved in the .dgm file

ShiftComponentType

SymbolInfo

WSConfig

WaveIndexT

Uniquely identifies a wave by the component it comes from, and the port on which that wave is from. Two waves can be identical but have a different index (e.g. a wave with PortType Input must be driven by another wave of PortType Output).

Width

This width is for wire displaying, >8 buswires displayed with 8px thickness. Actual size stored in Port type

WidthInferError

Documents user circuit error found during connection width inference

WireWidth

unconfigured replaces Some -1, Error replaces None, Configured of int replaces Some (positive int)

XYPos

Position on SVG canvas Positions can be added, subtracted, scaled using overloaded +,-, * operators currently these custom operators are not used in Issie - they should be!

Functions and values

Function or value Description

canvasState_

Full Usage: canvasState_

Returns: Lens<LoadedComponent, CanvasState>
Returns: Lens<LoadedComponent, CanvasState>

componentIdDecoder

Full Usage: componentIdDecoder

Returns: Decoder<ComponentId>
Returns: Decoder<ComponentId>

componentIdEncoder cid

Full Usage: componentIdEncoder cid

Parameters:
Returns: JsonValue
cid : ComponentId
Returns: JsonValue

componentsState_

Full Usage: componentsState_

Returns: Lens<LoadedComponent, Component list>
Returns: Lens<LoadedComponent, Component list>

convertFromJSONComponent comp

Full Usage: convertFromJSONComponent comp

Parameters:
Returns: Component

Transforms JSON components (parsed from JSON) to current components Normally this means converting legacy JSON component types into new ones. However it could in principle be more radical. The default transform unboxes the value which works when there is no change in the JS value representation

comp : Component
Returns: Component

convertToJSONComponent comp

Full Usage: convertToJSONComponent comp

Parameters:
Returns: Component

Transforms normal Components into JSON Components which can be saved. This is always an identity transformation since the normal ComponentType muts be strict subset of teh JSON ComponentType. unboxing is ok here because we do not use equality in the conversion to JSON.

comp : Component
Returns: Component

euclideanDistance pos1 pos2

Full Usage: euclideanDistance pos1 pos2

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

formOpt_

Full Usage: formOpt_

Returns: Lens<LoadedComponent, CCForm option>
Returns: Lens<LoadedComponent, CCForm option>

getMemType cType

Full Usage: getMemType cType

Parameters:
Returns: Memory1 -> ComponentType

get memory component type constructor NB only works with new-style memory components

cType : ComponentType
Returns: Memory1 -> ComponentType

getSTransformWithDefault infoOpt

Full Usage: getSTransformWithDefault infoOpt

Parameters:
Returns: STransform
infoOpt : SymbolInfo option
Returns: STransform

h_

Full Usage: h_

Returns: Lens<Component, float>
Returns: Lens<Component, float>

inputPorts_

Full Usage: inputPorts_

Returns: Lens<Component, Port list>
Returns: Lens<Component, Port list>

isClocked visitedSheets ldcs comp

Full Usage: isClocked visitedSheets ldcs comp

Parameters:
Returns: bool

Returns true if a component is clocked

visitedSheets : string list
ldcs : LoadedComponent list
comp : Component
Returns: bool

isNegated gateType

Full Usage: isNegated gateType

Parameters:
Returns: bool
Modifiers: inline
gateType : GateComponentType
Returns: bool

lcParameterSlots_

Full Usage: lcParameterSlots_

Returns: Prism<LoadedComponent, ParameterDefs>
Returns: Prism<LoadedComponent, ParameterDefs>

legacyTypesConvert (lComps, lConns)

Full Usage: legacyTypesConvert (lComps, lConns)

Parameters:
Returns: Component list * Connection list
lComps : LegacyComponent list
lConns : LegacyConnection list
Returns: Component list * Connection list

loadedComponentIsOutOfDate_

Full Usage: loadedComponentIsOutOfDate_

Returns: Lens<LoadedComponent, bool>
Returns: Lens<LoadedComponent, bool>

loadedComponentOf_ name

Full Usage: loadedComponentOf_ name

Parameters:
    name : string

Returns: Lens<Project, LoadedComponent>
name : string
Returns: Lens<Project, LoadedComponent>

loadedComponents_

Full Usage: loadedComponents_

Returns: Lens<Project, LoadedComponent list>
Returns: Lens<Project, LoadedComponent list>

openFileName_

Full Usage: openFileName_

Returns: Lens<Project, string>
Returns: Lens<Project, string>

openLoadedComponent_

Full Usage: openLoadedComponent_

Returns: Lens<Project, LoadedComponent>
Returns: Lens<Project, LoadedComponent>

outputPorts_

Full Usage: outputPorts_

Returns: Lens<Component, Port list>
Returns: Lens<Component, Port list>

pXY arg1

Full Usage: pXY arg1

Parameters:
Returns: string

display XYPos as string nicely for debugging

arg0 : XYPos
Returns: string

portOrder_

Full Usage: portOrder_

Returns: Lens<SymbolInfo, Map<Edge, string list>>
Returns: Lens<SymbolInfo, Map<Edge, string list>>

portOrientation_

Full Usage: portOrientation_

Returns: Lens<SymbolInfo, Map<string, Edge>>
Returns: Lens<SymbolInfo, Map<string, Edge>>

slotInfo_

Full Usage: slotInfo_

Returns: Lens<Component, ComponentSlotExpr option>
Returns: Lens<Component, ComponentSlotExpr option>

topLeft_

Full Usage: topLeft_

Returns: Lens<BoundingBox, XYPos>
Returns: Lens<BoundingBox, XYPos>

type_

Full Usage: type_

Returns: Lens<Component, ComponentType>
Returns: Lens<Component, ComponentType>

unreduced arg1

Full Usage: unreduced arg1

Parameters:
Returns: Component list * Connection list
arg0 : ReducedCanvasState
Returns: Component list * Connection list

w_

Full Usage: w_

Returns: Lens<Component, float>
Returns: Lens<Component, float>

workingFileName_

Full Usage: workingFileName_

Returns: Lens<Project, string option>
Returns: Lens<Project, string option>

Active patterns

Active pattern Description

(|IsBinaryGate|NotBinaryGate|) cType

Full Usage: (|IsBinaryGate|NotBinaryGate|) cType

Parameters:
Returns: Choice<unit, unit>

Active pattern which matches 2-input gate component types. NB - NOT gates are not included here.

cType : ComponentType
Returns: Choice<unit, unit>

(|IsGate|NoGate|) cType

Full Usage: (|IsGate|NoGate|) cType

Parameters:
Returns: Choice<unit, unit>
cType : ComponentType
Returns: Choice<unit, unit>

(|MemoryAndType|_|) typ

Full Usage: (|MemoryAndType|_|) typ

Parameters:
Returns: ((Memory1 -> ComponentType) * Memory1) option
typ : ComponentType
Returns: ((Memory1 -> ComponentType) * Memory1) option

(|Memory|_|) typ

Full Usage: (|Memory|_|) typ

Parameters:
Returns: Memory1 option
typ : ComponentType
Returns: Memory1 option

Type something to start searching.