Header menu logo issie

ModelHelpers Module

Types and nested modules

Type/Module Description

Constants

CSSGridPos

type used for CSS grids in the UI to position an item on a grid

ModelLocations

Both input text and its parsed numeric value must be stored in the model. The two fields contain optics used to access these items in the model

ViewableJob

a long function to be executed in a message after the view function has run at least once

Functions and values

Function or value Description

asyncJobs

Full Usage: asyncJobs

Returns: ViewableJob list

list of jobs awaiting execution

Returns: ViewableJob list

drawBlockModelToUserData model userData

Full Usage: drawBlockModelToUserData model userData

Parameters:
Returns: UserData

This is needed because DrawBlock cannot directly access Issie Model. can be replaced when all Model is placed at start of compile order and DB model is refactored

model : Model
userData : UserData
Returns: UserData

execOneAsyncJobIfPossible (model, cmd)

Full Usage: execOneAsyncJobIfPossible (model, cmd)

Parameters:
Returns: Model * Cmd<Msg>

called from update function, it will execute outstanding async jobs. each job modifies model.

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

getComponentIds model

Full Usage: getComponentIds model

Parameters:
Returns: Set<ComponentId>
model : Model
Returns: Set<ComponentId>

getCurrFile model

Full Usage: getCurrFile model

Parameters:
Returns: string option

returns a string option representing the current file name if file is loaded, otherwise None

model : Model
Returns: string option

getCurrSheets model

Full Usage: getCurrSheets model

Parameters:
Returns: string list option
model : Model
Returns: string list option

getSavedWaveInfo wsModel

Full Usage: getSavedWaveInfo wsModel

Parameters:
Returns: SavedWaveInfo

Get saveable record of WaveSimModel

wsModel : WaveSimModel
Returns: SavedWaveInfo

getUpdatedLoadedComponents project model

Full Usage: getUpdatedLoadedComponents project model

Parameters:
Returns: Project

Return the project with with open file contents in loadedcomponents updated according to current Draw Block contents.

project : Project
model : Model
Returns: Project

getWSModel model

Full Usage: getWSModel model

Parameters:
Returns: WaveSimModel

Get the current WaveSimModel used by the Model (index the map using the current wavesim sheet). If no WaveSimModel for that sheet, return an empty wave sim model.

model : Model
Returns: WaveSimModel

initWSModel

Full Usage: initWSModel

Returns: WaveSimModel
Returns: WaveSimModel

inputBigint props placeholder locs isValid dispatch model

Full Usage: inputBigint props placeholder locs isValid dispatch model

Parameters:
Returns: ReactElement

Display an input box which is parsed as a bigint and written back to the Model using textOptic (the text) and valOptic (the value). isValid must return true for the value to be written back to the model

props : IHTMLProp list
placeholder : string
locs : ModelLocations
isValid : bigint -> Model -> bool
dispatch : Msg -> unit
model : Model
Returns: ReactElement

loadWSModelFromSavedWaveInfo swInfo

Full Usage: loadWSModelFromSavedWaveInfo swInfo

Parameters:
Returns: WaveSimModel

Setup current WaveSimModel from saved record NB: note that SavedWaveInfo can only be changed if code is added to make loading backwards compatible with old designs

swInfo : SavedWaveInfo
Returns: WaveSimModel

mapFst mapFn (model, cmd)

Full Usage: mapFst mapFn (model, cmd)

Parameters:
    mapFn : 'a -> 'b
    model : 'a
    cmd : 'c

Returns: 'b * 'c
mapFn : 'a -> 'b
model : 'a
cmd : 'c
Returns: 'b * 'c

mapOverProject defaultValue model transform

Full Usage: mapOverProject defaultValue model transform

Parameters:
Returns: 'a
defaultValue : 'a
model : Model
transform : Project -> 'a
Returns: 'a

pp model

Full Usage: pp model

Parameters:
model : Model

reduce this

Full Usage: reduce this

Parameters:
Returns: (type)
this : Model
Returns: (type)

reduceApprox this

Full Usage: reduceApprox this

Parameters:
Returns: (type)
this : Model
Returns: (type)

removeAllSimulationsFromModel model

Full Usage: removeAllSimulationsFromModel model

Parameters:
Returns: Model

For reasons of space efficiency, ensure that no non-empty unused FastSimulation records are kept FastSimulation records can be very large and at most one should exist, it must be for the sheet referenced by model.WaveSimSheet

model : Model
Returns: Model

resimulateWaveSimForErrors model

Full Usage: resimulateWaveSimForErrors model

Parameters:
Returns: Result<SimulationData, SimulationError>
model : Model
Returns: Result<SimulationData, SimulationError>

runAfterView jobName workFn

Full Usage: runAfterView jobName workFn

Parameters:
jobName : string
workFn : Model -> Model * Cmd<Msg>

setAsyncJobsRunnable dispatch

Full Usage: setAsyncJobsRunnable dispatch

Parameters:
    dispatch : Msg -> unit

dispatch : Msg -> unit

setModelInt (arg1, arg2) dispatch maxVal minVal intToSet

Full Usage: setModelInt (arg1, arg2) dispatch maxVal minVal intToSet

Parameters:
    arg0 : Model -> int
    arg1 : int -> Model -> Model
    dispatch : Msg -> unit
    maxVal : int
    minVal : int
    intToSet : int

Set the part of model specified by optic_ to initToSet: bounded by maxVal, minVal. dispatch: the Elmihs dispatch function.

arg0 : Model -> int
arg1 : int -> Model -> Model
dispatch : Msg -> unit
maxVal : int
minVal : int
intToSet : int

setWSModel wsModel model

Full Usage: setWSModel wsModel model

Parameters:
Returns: Model

Set WaveSimModel of current sheet.

wsModel : WaveSimModel
model : Model
Returns: Model

simReset dispatch

Full Usage: simReset dispatch

Parameters:
    dispatch : Msg -> unit

dispatch : Msg -> unit

simulateModel isWaveSim simulatedSheet simulationArraySize (arg4, arg5) model

Full Usage: simulateModel isWaveSim simulatedSheet simulationArraySize (arg4, arg5) model

Parameters:
    isWaveSim : bool
    simulatedSheet : string option
    simulationArraySize : int
    arg3 : Component list
    arg4 : Connection list
    model : Model

Returns: Result<SimulationData, SimulationError> * CanvasState

Start simulating the current Diagram. Return SimulationData that can be used to extend the simulation as needed, or error if simulation fails. Note that simulation is only redone if current canvas changes.

isWaveSim : bool
simulatedSheet : string option
simulationArraySize : int
arg3 : Component list
arg4 : Connection list
model : Model
Returns: Result<SimulationData, SimulationError> * CanvasState

spCanvas model

Full Usage: spCanvas model

Parameters:
Returns: string
model : Model
Returns: string

spComp comp

Full Usage: spComp comp

Parameters:
Returns: string
comp : Component
Returns: string

spComps comps

Full Usage: spComps comps

Parameters:
Returns: string
comps : Component list
Returns: string

spConn conn

Full Usage: spConn conn

Parameters:
Returns: string
conn : Connection
Returns: string

spLdComp ldc

Full Usage: spLdComp ldc

Parameters:
Returns: string
ldc : LoadedComponent
Returns: string

spMess msg

Full Usage: spMess msg

Parameters:
    msg : 'a

Returns: string
msg : 'a
Returns: string

spOpt f thingOpt

Full Usage: spOpt f thingOpt

Parameters:
    f : 'a -> string
    thingOpt : 'a option

Returns: string
f : 'a -> string
thingOpt : 'a option
Returns: string

spProj p

Full Usage: spProj p

Parameters:
Returns: string
p : Project
Returns: string

spState (arg1, arg2)

Full Usage: spState (arg1, arg2)

Parameters:
Returns: string
arg0 : Component list
arg1 : Connection list
Returns: string

tryGetLoadedComponents model

Full Usage: tryGetLoadedComponents model

Parameters:
Returns: LoadedComponent list
model : Model
Returns: LoadedComponent list

updateLdComps name changeFun ldComps

Full Usage: updateLdComps name changeFun ldComps

Parameters:
Returns: LoadedComponent list
name : string
changeFun : LoadedComponent -> LoadedComponent
ldComps : LoadedComponent list
Returns: LoadedComponent list

updateLdCompsWithCompOpt newCompOpt ldComps

Full Usage: updateLdCompsWithCompOpt newCompOpt ldComps

Parameters:
Returns: LoadedComponent list
newCompOpt : LoadedComponent option
ldComps : LoadedComponent list
Returns: LoadedComponent list

updateWSModel updateFn model

Full Usage: updateWSModel updateFn model

Parameters:
Returns: Model

Update WaveSimModel of current sheet.

updateFn : WaveSimModel -> WaveSimModel
model : Model
Returns: Model

updateWSModelOfSheet sheet updateFn model

Full Usage: updateWSModelOfSheet sheet updateFn model

Parameters:
Returns: Model

Update WaveSimModel of given sheet - if it does not exist do nothing

sheet : string
updateFn : WaveSimModel -> WaveSimModel
model : Model
Returns: Model

userDataToDrawBlockModel model

Full Usage: userDataToDrawBlockModel model

Parameters:
Returns: Model

This is needed because DrawBlock cannot directly access Issie Model. can be replaced when all Model is placed at start of compile order and DB model is refactored

model : Model
Returns: Model

validateWaveModel simulatedSheet (arg2, arg3) model

Full Usage: validateWaveModel simulatedSheet (arg2, arg3) model

Parameters:
Returns: Result<SimulationGraph, SimulationError>

Return the waveform simulation graph, or an error if simulation would fail. This function does not create the simulation so is relatively fast.

simulatedSheet : string option
arg1 : Component list
arg2 : Connection list
model : Model
Returns: Result<SimulationGraph, SimulationError>

waveSimModel_

Full Usage: waveSimModel_

Returns: Lens<Model, WaveSimModel>

This will - given a project is open - never fail. The getter returns the default WaveSimModel record if none exists. The setter will add the WaveSimModel to the WaveSim map in the model.

Returns: Lens<Model, WaveSimModel>

Type something to start searching.