Skip to content

0 Addie Code Overview

Tom Clarke edited this page Jul 22, 2023 · 2 revisions

The Addie application comprises F# modules under ./src/renderer which make the Electron renderer process. The Electron main process ./src/main/ is very rarely changed and performs startup and some low-level machine I/O functions.

Addie is an Elmish MVU (Model-View-Update) application.

  • For an introduction to Elmish see The Elmish Book.
  • For a rough overview of the Addie Elmish model record see The Issie Elmish Structure page. Addie is simpler than Issie and this page should be updated with an Addie-specific guide.

The sections below describe all of the Addie renderer modules by source directory. Source directories correspond to logically related modules.

Naming Conventions

Many UI and Drawblock logical modules are too large to be handled by a single source file. They are split into multiple F# modules, each in a separate file. These sets of modules form a module group. Module group naming is fairly standard, e.g. module group MyGrp can consist of modules MyGrpHelpers,MyGrpView,MyGrpUpdate. Where not needed these may be omitted, where code is too large for this split modules are further separated - with all modules for group MyGrp starting with MyGrp.

An F# submodule Constants may be inserted at the start of any of these modules to contain module-local constant parameters. See Issie Buswire.fs for an example. [<AutoOpen>] property is optional but good practice, it allows constants to be accessed without the submodule name prefix Constants.

Standard Naming Function F# compile order within group
GroupHelpers Helper functions for group 1
GroupView Elmish view function, and associated subfunctions, for group 2
GroupUpdate Elmish update function, and associated subfunctions, for group 3

Libraries

Directory File & Module Contents
./src/Common CommonTypes Issie types for connections, components, etc
./src/Common DrawHelpers Helper functions used for SVG and geometry in schematic editor and elsewhere
./src/Common EEEHelpers legacy helpers, should be refactored
./src/Common EEExtensions standard F# library extensions used by Issie and other apps - e.g. FP ways to use Regexes.
./src/Common ElectronAPI auto-generated interface used to get static typed access to the (javascript) electronAPI. Shows all the electron API calls - it can be linked to the electron API
./src/Common HashMap Not currently used - legacy
./src/Common Helpers Misc helper functions
./src/Common Optics standard functions for FP read and write of structures
./src/Common TimeHelpers Functions to instrument how long things take
./src/Interface FilesIO Low-level IO functions
./src/Interface JSHelpers Low-level javascript helpers (not serialise/deserialise)
./src/Interface Version Version number!

Missing content

This page should be updated similar to the corresponding Issie page.