Header menu logo issie

Simulator Module

Types

Type Description

SimCache

Functions and values

Function or value Description

cacheIsEqual cache ldcs

Full Usage: cacheIsEqual cache ldcs

Parameters:
Returns: bool
cache : SimCache
ldcs : LoadedComponent list
Returns: bool

cap sheet

Full Usage: cap sheet

Parameters:
    sheet : string

Returns: string
sheet : string
Returns: string

childrenOf ldcs sheet

Full Usage: childrenOf ldcs sheet

Parameters:
Returns: (string * string) list
ldcs : LoadedComponent list
sheet : string
Returns: (string * string) list

getCurrentSimulationState (arg1, arg2) project fs

Full Usage: getCurrentSimulationState (arg1, arg2) project fs

Parameters:
Returns: SimulationRunStatus

gets the status of the simulation given current canvasState and project

arg0 : Component list
arg1 : Connection list
project : Project option
fs : FastSimulation
Returns: SimulationRunStatus

getDirectDependencies (arg1, arg2)

Full Usage: getDirectDependencies (arg1, arg2)

Parameters:
Returns: (string * string) list
arg0 : Component list
arg1 : Connection list
Returns: (string * string) list

getFastSim ()

Full Usage: getFastSim ()

Parameters:
    () : unit

Returns: FastSimulation

Used in wave simulation to obtain the currently active FastSimulation. This should have previously been created, but if not it will contain a dummy

() : unit
Returns: FastSimulation

getLdcList ldcs openSheet

Full Usage: getLdcList ldcs openSheet

Parameters:
Returns: LoadedComponent

look up a sheet in a set of loaded components, return [] or a list of the matching LoadedComponent

ldcs : LoadedComponent list
openSheet : string
Returns: LoadedComponent

getSheet ldcs openSheet

Full Usage: getSheet ldcs openSheet

Parameters:
Returns: LoadedComponent

look up a sheet in a set of loaded components

ldcs : LoadedComponent list
openSheet : string
Returns: LoadedComponent

getUpdatedLoadedComponentState diagramName (arg2, arg3) projLdcs

Full Usage: getUpdatedLoadedComponentState diagramName (arg2, arg3) projLdcs

Parameters:
Returns: LoadedComponent list

canvasState: extracted canvasState from draw block. projLdcs: ldcs from project (current sheet ldc may be outofdate) diagramName: name of current open sheet. return updated list of all LDCs

diagramName : string
arg1 : Component list
arg2 : Connection list
projLdcs : LoadedComponent list
Returns: LoadedComponent list

makeDummySimulationError msg

Full Usage: makeDummySimulationError msg

Parameters:
    msg : string

Returns: SimulationError
msg : string
Returns: SimulationError

portSheetPort compsWithIds name port

Full Usage: portSheetPort compsWithIds name port

Parameters:
Returns: SheetPort option

Helper used convert port into SheetPort for use by wave simulator determining connectivity within a design sheet. name is the name of the containing sheet.

compsWithIds : Map<ComponentId, Component>
name : string
port : Port
Returns: SheetPort option

prepareSimulationMemoized isWaveSim simulationArraySize openFileName diagramName (arg5, arg6) loadedDependencies

Full Usage: prepareSimulationMemoized isWaveSim simulationArraySize openFileName diagramName (arg5, arg6) loadedDependencies

Parameters:
    isWaveSim : bool
    simulationArraySize : int
    openFileName : string
    diagramName : string
    arg4 : Component list
    arg5 : Connection list
    loadedDependencies : LoadedComponent list

Returns: Result<SimulationData, SimulationError> * CanvasState

Start up a simulation, doing all necessary checks and generating simulation errors if necesary. The code to do this is quite long so results are memoized.

isWaveSim : bool
simulationArraySize : int
openFileName : string
diagramName : string
arg4 : Component list
arg5 : Connection list
loadedDependencies : LoadedComponent list
Returns: Result<SimulationData, SimulationError> * CanvasState

saveStateInSimulation (arg1, arg2) openFileName loadedComponents fs

Full Usage: saveStateInSimulation (arg1, arg2) openFileName loadedComponents fs

Parameters:
Returns: FastSimulation

canvasState: extracted canvasState from draw block. loadedComponents: from project diagramName: name of current open sheet. save all needed by simulation ldcs in the FastSimulation record. The top sheet name must be saved separately - since if a simulation is being refreshed it must not change

arg0 : Component list
arg1 : Connection list
openFileName : string
loadedComponents : LoadedComponent list
fs : FastSimulation
Returns: FastSimulation

sheetsNeeded ldcs sheet

Full Usage: sheetsNeeded ldcs sheet

Parameters:
Returns: string list

Sheets needed to simulate sheet with name sheet. Sheets form a dependency tree. ldcs is a list of loaded components which must include sheet

ldcs : LoadedComponent list
sheet : string
Returns: string list

simCache

Full Usage: simCache

Returns: SimCache

Used to store last canvas state and its simulation for Step & Truth Table simulation. This is memoized to avoid unnecessary recomputation, stored as a single global state to stop memory leaks caused by multiple simulations being stored.

Returns: SimCache

simCacheInit ()

Full Usage: simCacheInit ()

Parameters:
    () : unit

Returns: SimCache
() : unit
Returns: SimCache

simCacheWS

Full Usage: simCacheWS

Returns: SimCache

Used to store last canvas state and its simulation for waveform simulation. This is memoized to avoid unnecessary recomputation, stored as a single global state to stop memory leaks caused by multiple simulations being stored.

Returns: SimCache

startCircuitSimulation simulationArraySize diagramName (arg3, arg4) loadedDependencies

Full Usage: startCircuitSimulation simulationArraySize diagramName (arg3, arg4) loadedDependencies

Parameters:
Returns: Result<SimulationData, SimulationError>

Extract circuit data from inputs and return a checked SimulationData object or an error SimulationData has some technical debt, it wraps FastSimulation adding some redundant data

simulationArraySize : int
diagramName : string
arg2 : Component list
arg3 : Connection list
loadedDependencies : LoadedComponent list
Returns: Result<SimulationData, SimulationError>

startCircuitSimulationFData simulationArraySize diagramName (arg3, arg4) loadedDependencies

Full Usage: startCircuitSimulationFData simulationArraySize diagramName (arg3, arg4) loadedDependencies

Parameters:
Returns: Result<SimulationData, SimulationError>
simulationArraySize : int
diagramName : string
arg2 : Component list
arg3 : Connection list
loadedDependencies : LoadedComponent list
Returns: Result<SimulationData, SimulationError>

storedstateisEqual cache ldcs

Full Usage: storedstateisEqual cache ldcs

Parameters:
Returns: bool
cache : SimCache
ldcs : LoadedComponent list
Returns: bool

validateCircuitSimulation diagramName (arg2, arg3) loadedDependencies

Full Usage: validateCircuitSimulation diagramName (arg2, arg3) loadedDependencies

Parameters:
Returns: Result<SimulationGraph, SimulationError>

Extract circuit data from inputs and return a valid SimulationGraph or an error

diagramName : string
arg1 : Component list
arg2 : Connection list
loadedDependencies : LoadedComponent list
Returns: Result<SimulationGraph, SimulationError>

validateWaveSimulation openFileName diagramName (arg3, arg4) loadedDependencies

Full Usage: validateWaveSimulation openFileName diagramName (arg3, arg4) loadedDependencies

Parameters:
Returns: Result<SimulationGraph, SimulationError>

check a waveform simulation circuit for errors without actually creating the simulation

openFileName : string
diagramName : string
arg2 : Component list
arg3 : Connection list
loadedDependencies : LoadedComponent list
Returns: Result<SimulationGraph, SimulationError>

Type something to start searching.