CanvasStateAnalyser Module
Types
Type | Description |
Functions and values
Function or value | Description |
Full Usage:
analyseState (arg1, arg2) ldComps
Parameters:
Component list
arg1 : Connection list
ldComps : LoadedComponent list
Returns: SimulationError option * ConnectionsWidth option
|
|
Full Usage:
checkAdderUnnecessaryNC (arg1, arg2)
Parameters:
Component list
arg1 : Connection list
Returns: SimulationError option
|
|
Full Usage:
checkComponentNamesAreOk (arg1, arg2)
Parameters:
Component list
arg1 : Connection list
Returns: SimulationError option
|
|
Full Usage:
checkCustomComponentForOkIOs c args sheets
Parameters:
Component
-
The custom component instance to check
args : CustomComponentType
-
The custom component type containing parameter bindings and expected I/O labels
sheets : LoadedComponent list
-
List of loaded component sheets to check against
Returns: Result<unit, (Component * CustomComponentError)>
Ok() if the component's I/Os match the sheet definition
Error with details if there's a mismatch or missing sheet
|
Parameter Resolution Process: 1. If the component has parameter bindings AND the sheet has parameter slots: - Iterate through all components in the sheet - For each component, check if it has a parameter slot definition - If it's an Input1 or Output component with a matching IO label slot: * Evaluate the parameter expression using a simple recursive evaluator * The evaluator only handles PInt (constants) and PParameter (lookups) * Update the component's width with the resolved value 2. Use the resolved components to extract the actual I/O labels 3. Compare against expected labels from the custom component instance This simplified parameter resolution is sufficient for validation purposes, as it only needs to resolve I/O port widths to determine port labels. PARAMETER RESOLUTION ARCHITECTURE: The codebase implements parameter resolution at three different levels: 1. Full Resolution (ParameterTypes.evaluateParamExpression): - Supports all arithmetic operations (+, -, *, /, %) - Returns Result with detailed error messages - Used in UI for user feedback when editing parameters 2. Graph Resolution (GraphMerger.resolveParametersInSimulationGraph): - Uses internal evalExpr that returns Option - Supports all arithmetic operations - Applies resolved values via applySlotValue - Used during simulation graph construction 3. Validation Resolution (this function): - Minimal evaluator supporting only PInt and PParameter - Only resolves I/O port widths for label extraction - Optimized for fast validation checks This three-tier approach ensures efficient processing while maintaining full parameter functionality where needed.
|
Full Usage:
checkCustomComponentsOk (arg1, arg2) sheets
Parameters:
Component list
arg1 : Connection list
sheets : LoadedComponent list
Returns: SimulationError option
|
|
Full Usage:
getOutErrType count port rmInfo
Parameters:
int
port : Port
rmInfo : PortRmInfo
Returns: SimulationErrorType
|
|
|
|
|
|
|
|
Full Usage:
portNames componentType
Parameters:
ComponentType
Returns: string list * string list
|