Header menu logo issie

ParameterView Module

Types

Type Description

UpdateInfoSheetChoise

Updates the LCParameterSlots DefaultParams section.

Functions and values

Function or value Description

addParamComponent newCompSpec dispatch compId

Full Usage: addParamComponent newCompSpec dispatch compId

Parameters:
Returns: Unit

Add the parameter information from a newly created component to paramSlots

newCompSpec : NewParamCompSpec
dispatch : Msg -> Unit
compId : ComponentId
Returns: Unit

addParameterBox model dispatch

Full Usage: addParameterBox model dispatch

Parameters:

Creates a popup that allows a parameter integer value to be added.

model : Model
dispatch : Msg -> unit

compSlot_ compSlotName

Full Usage: compSlot_ compSlotName

Parameters:
Returns: Lens<Component, int>
compSlotName : CompSlotName
Returns: Lens<Component, int>

defaultBindingsOfModel_

Full Usage: defaultBindingsOfModel_

Returns: Prism<Model, ParamBindings>
Returns: Prism<Model, ParamBindings>

deleteParameterBox model parameterName dispatch

Full Usage: deleteParameterBox model parameterName dispatch

Parameters:
    model : Model
    parameterName : string
    dispatch : Msg -> unit

model : Model
parameterName : string
dispatch : Msg -> unit

editParameterBindingPopup model parameterName currValue comp custom dispatch

Full Usage: editParameterBindingPopup model parameterName currValue comp custom dispatch

Parameters:

create a popup to edit in the model a custom component parameter binding TODO - maybe comp should be a ComponentId with actual component looked up from model for safety?

model : Model
parameterName : string
currValue : int
comp : Component
custom : CustomComponentType
dispatch : Msg -> unit

editParameterBox model parameterName dispatch

Full Usage: editParameterBox model parameterName dispatch

Parameters:
    model : Model
    parameterName : string
    dispatch : Msg -> unit

Creates a popup that allows a parameter integer value to be edited. TODO: this should be a special cases of a more general popup for parameter expressions?

model : Model
parameterName : string
dispatch : Msg -> unit

evaluateConstraints paramBindings exprSpecs dispatch

Full Usage: evaluateConstraints paramBindings exprSpecs dispatch

Parameters:
Returns: Result<Unit, ParamConstraint list>

Evaluates a list of constraints got from slots against a set of parameter bindings to check what values of param are allowed. NB here 'PINT is not a polymorphic type but a type parameter that will be instantiated to int or bigint.

paramBindings : ParamBindings
exprSpecs : ConstrainedExpr list
dispatch : Msg -> unit
Returns: Result<Unit, ParamConstraint list>

evaluateParamExpression paramBindings paramExpr

Full Usage: evaluateParamExpression paramBindings paramExpr

Parameters:
Returns: Result<ParamInt, ParamError>

returns the value of a parameter expression given a set of parameter bindings. The simplified value will be either a constant or a linear combination of a constant and a parameter. NB here 'PINT is not a polymorphic type but a type parameter that will be instantiated to int or bigint.

paramBindings : ParamBindings
paramExpr : ParamExpression
Returns: Result<ParamInt, ParamError>

exprContainsParams expression

Full Usage: exprContainsParams expression

Parameters:
Returns: bool

Returns true if an expression contains parameters, and false if not

expression : ParamExpression
Returns: bool

getCurrentSheet model

Full Usage: getCurrentSheet model

Parameters:
Returns: LoadedComponent

Get LoadedComponent for currently open sheet This cannot fail, because LoadedComponent must be loaded for sheet to be open

model : Model
Returns: LoadedComponent

getDefaultParams loadedComponent

Full Usage: getDefaultParams loadedComponent

Parameters:
Returns: ParamBindings

Get default parameter bindings for LoadedComponent

loadedComponent : LoadedComponent
Returns: ParamBindings

getLCParamInfo model

Full Usage: getLCParamInfo model

Parameters:
Returns: ParameterDefs

Get current loaded component parameter info Returns empty maps for ParamSlots and DefaultBindings if None

model : Model
Returns: ParameterDefs

getParamSlots loadedComponent

Full Usage: getParamSlots loadedComponent

Parameters:
Returns: ComponentSlotExpr

Get default parameter slots for LoadedComponent

loadedComponent : LoadedComponent
Returns: ComponentSlotExpr

getParamsSlot currentSheet

Full Usage: getParamsSlot currentSheet

Parameters:
Returns: ComponentSlotExpr option
currentSheet : LoadedComponent
Returns: ComponentSlotExpr option

lcParameterInfoOfModel_

Full Usage: lcParameterInfoOfModel_

Returns: Prism<Model, ParameterDefs>
Returns: Prism<Model, ParameterDefs>

makeParamBindingEntryBoxes model comp custom dispatch

Full Usage: makeParamBindingEntryBoxes model comp custom dispatch

Parameters:
Returns: ReactElement

UI component for custom component definition of parameter bindings

model : Model
comp : Component
custom : CustomComponentType
dispatch : Msg -> unit
Returns: ReactElement

modelToSlot_ slot

Full Usage: modelToSlot_ slot

Parameters:
Returns: Lens<Model, int>

Return a Lens that can be used to read or update the value of a component slot integer in the component. The value is contained in the ComponentType part of a Component record. The Component record will be found in various places, depending on the context. For Properties changes, the Component record will be in the Model under SelectedComponent. For changes in a newly created component the component is created by CatalogueView.createComponent. A partial implementation of this function would be OK for MVP. NB - the Lens cannot be part of the slot record because the Lens type can change depending on 'PINT. Maybe this will be fixed by using a D.U. for the slot type: however for MVP we can simplify things by dealing only with int parameters.

slot : ParamSlot
Returns: Lens<Model, int>

modelToSymbols

Full Usage: modelToSymbols

Returns: Lens<Model, Map<ComponentId, Symbol>>
Returns: Lens<Model, Map<ComponentId, Symbol>>

modifyInfoSheet project choise dispatch

Full Usage: modifyInfoSheet project choise dispatch

Parameters:
Returns: 'a

This function can be used to update the DefaultParams or ParamSlots in the LCParameterSlots of a sheet based on the choise Use case will be either when we want to add, edit or delete the sheet parameter or when we want to add a new component to the sheet

project : Project
choise : UpdateInfoSheetChoise
dispatch : Msg -> 'a
Returns: 'a

paramInputField model prompt defaultValue currentValue constraints comp compSlotName dispatch

Full Usage: paramInputField model prompt defaultValue currentValue constraints comp compSlotName dispatch

Parameters:
Returns: ReactElement

Create a generic input field which accepts and parses parameter expressions Validity of inputs is checked by parser Specific constraints can be passed by callee

model : Model
prompt : string
defaultValue : int
currentValue : Option<int>
constraints : ParamConstraint list
comp : Component option
compSlotName : CompSlotName
dispatch : Msg -> unit
Returns: ReactElement

paramSlotsOfModel_

Full Usage: paramSlotsOfModel_

Returns: Prism<Model, ComponentSlotExpr>
Returns: Prism<Model, ComponentSlotExpr>

parseExpression text

Full Usage: parseExpression text

Parameters:
    text : string

Returns: Result<ParamExpression, ParamError>

Generates a ParameterExpression from input text Operators are left-associative (*), (/), and (%) have higher precedence than (+), (-) Brackets should have highest precedence

text : string
Returns: Result<ParamExpression, ParamError>

renderParamExpression expr precedence

Full Usage: renderParamExpression expr precedence

Parameters:
Returns: string
expr : ParamExpression
precedence : int
Returns: string

symbolToComponent_

Full Usage: symbolToComponent_

Returns: Lens<Symbol, Component>
Returns: Lens<Symbol, Component>

symbolsToSymbol_ componentId

Full Usage: symbolsToSymbol_ componentId

Parameters:
Returns: Lens<Map<ComponentId, Symbol>, Symbol>
componentId : ComponentId
Returns: Lens<Map<ComponentId, Symbol>, Symbol>

updateComponent dispatch model slot value

Full Usage: updateComponent dispatch model slot value

Parameters:

Use sheet component update functions to perform updates

dispatch : Msg -> unit
model : Model
slot : ParamSlot
value : int

updateComponents newBindings model dispatch

Full Usage: updateComponents newBindings model dispatch

Parameters:
Returns: Unit

Update the values of all parameterised components with a new set of bindings This can only be called after the validity and constraints of all expressions are checked

newBindings : ParamBindings
model : Model
dispatch : Msg -> Unit
Returns: Unit

updateCustomComponent labelToEval newBindings comp

Full Usage: updateCustomComponent labelToEval newBindings comp

Parameters:
Returns: Component

Update a custom component with new I/O component widths. Used when these chnage as result of parameter changes.

labelToEval : Map<string, int>
newBindings : ParamBindings
comp : Component
Returns: Component

updateInfoSheetDefaultParams currentSheetInfo paramName value delete

Full Usage: updateInfoSheetDefaultParams currentSheetInfo paramName value delete

Parameters:
    currentSheetInfo : ParameterDefs option
    paramName : string
    value : int
    delete : bool

Returns: ParameterDefs option
currentSheetInfo : ParameterDefs option
paramName : string
value : int
delete : bool
Returns: ParameterDefs option

updateInfoSheetParamSlots currentSheetInfo paramSlot expression constraints

Full Usage: updateInfoSheetParamSlots currentSheetInfo paramSlot expression constraints

Parameters:
Returns: ParameterDefs option
currentSheetInfo : ParameterDefs option
paramSlot : ParamSlot
expression : ParamExpression
constraints : ParamConstraint list
Returns: ParameterDefs option

updateParamSlot slot exprSpec model

Full Usage: updateParamSlot slot exprSpec model

Parameters:
Returns: Model

Adds or updates a parameter slot in loaded component param slots Removes the entry if the expression does not contain parameters

slot : ParamSlot
exprSpec : ConstrainedExpr
model : Model
Returns: Model

updateParameter project model

Full Usage: updateParameter project model

Parameters:
Returns: Model
project : Project
model : Model
Returns: Model

viewParameters model dispatch

Full Usage: viewParameters model dispatch

Parameters:
Returns: ReactElement

UI interface for viewing the parameter expressions of a component

model : Model
dispatch : Msg -> unit
Returns: ReactElement

Type something to start searching.