33 lines
1.7 KiB
Markdown
33 lines
1.7 KiB
Markdown
|
|
# EVOLV - Claude Code Project Guide
|
||
|
|
|
||
|
|
## What This Is
|
||
|
|
Node-RED custom nodes package for wastewater treatment plant automation. Developed by Waterschap Brabantse Delta R&D team. Follows ISA-88 (S88) batch control standard.
|
||
|
|
|
||
|
|
## Architecture
|
||
|
|
Each node follows a three-layer pattern:
|
||
|
|
1. **Node-RED wrapper** (`<name>.js`) - registers the node type, sets up HTTP endpoints
|
||
|
|
2. **Node adapter** (`src/nodeClass.js`) - bridges Node-RED API with domain logic, handles config loading, tick loops, events
|
||
|
|
3. **Domain logic** (`src/specificClass.js`) - pure business logic, no Node-RED dependencies
|
||
|
|
|
||
|
|
## Key Shared Library: `nodes/generalFunctions/`
|
||
|
|
- `logger` - structured logging (use this, NOT console.log)
|
||
|
|
- `MeasurementContainer` - chainable measurement storage (type/variant/position)
|
||
|
|
- `configManager` - loads JSON configs from `src/configs/`
|
||
|
|
- `MenuManager` - dynamic UI dropdowns
|
||
|
|
- `outputUtils` - formats messages for InfluxDB and process outputs
|
||
|
|
- `childRegistrationUtils` - parent-child node relationships
|
||
|
|
- `coolprop` - thermodynamic property calculations
|
||
|
|
|
||
|
|
## Conventions
|
||
|
|
- Nodes register under category `'EVOLV'` in Node-RED
|
||
|
|
- S88 color scheme: Area=#0f52a5, ProcessCell=#0c99d9, Unit=#50a8d9, Equipment=#86bbdd, ControlModule=#a9daee
|
||
|
|
- Config JSON files in `generalFunctions/src/configs/` define defaults, types, enums per node
|
||
|
|
- Tick loop runs at 1000ms intervals for time-based updates
|
||
|
|
- Three outputs per node: [process, dbase, parent]
|
||
|
|
|
||
|
|
## Development Notes
|
||
|
|
- No build step required - pure Node.js
|
||
|
|
- Install: `npm install` in root
|
||
|
|
- Submodule URLs were rewritten from `gitea.centraal.wbd-rd.nl` to `gitea.wbd-rd.nl` for external access
|
||
|
|
- Dependencies: mathjs, generalFunctions (git submodule)
|