Compare commits
4 Commits
87214788d2
...
dev-lzm
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
74951e7a23 | ||
|
|
167b1026f1 | ||
|
|
7acd6c2ce0 | ||
|
|
144460e6ba |
12
CONTRACT.md
12
CONTRACT.md
@@ -68,6 +68,18 @@ from the measurement container (e.g. `delta_predicted_pressure`,
|
|||||||
(`idle → starting → warmingup → operational → accelerating →
|
(`idle → starting → warmingup → operational → accelerating →
|
||||||
decelerating → stopping → coolingdown → idle`, plus `off`).
|
decelerating → stopping → coolingdown → idle`, plus `off`).
|
||||||
|
|
||||||
|
## Limitations vs `rotatingMachine`
|
||||||
|
|
||||||
|
- **No `maintenance` state machine.** The schema's `mode.current` enum
|
||||||
|
accepts `maintenance` (gates sources via `isValidSourceForMode`), but
|
||||||
|
the FSM has no `entermaintenance` / `exitmaintenance` states and the
|
||||||
|
`sequences` schema declares only `startup`, `shutdown`, `emergencystop`,
|
||||||
|
and `boot`. Configuring `maintenance` mode therefore disables external
|
||||||
|
command sources but does not put the valve through a maintenance
|
||||||
|
sequence. Aligns with valve's role as a passive flow-controlled
|
||||||
|
actuator; lift to RM-style FSM if/when site maintenance procedures
|
||||||
|
require explicit state transitions.
|
||||||
|
|
||||||
## Events emitted by `source.measurements.emitter`
|
## Events emitted by `source.measurements.emitter`
|
||||||
|
|
||||||
The `MeasurementContainer` fires `<type>.<variant>.<position>` whenever
|
The `MeasurementContainer` fires `<type>.<variant>.<position>` whenever
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ module.exports = [
|
|||||||
topic: 'set.mode',
|
topic: 'set.mode',
|
||||||
aliases: ['setMode'],
|
aliases: ['setMode'],
|
||||||
payloadSchema: { type: 'string' },
|
payloadSchema: { type: 'string' },
|
||||||
description: 'Switch the valve between auto / manual control modes.',
|
description: 'Switch the operating mode. Allowed: `auto`, `virtualControl`, `fysicalControl`, `maintenance` (schema-validated in `valve.json` → `mode.current`).',
|
||||||
handler: handlers.setMode,
|
handler: handlers.setMode,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
<script>
|
<script>
|
||||||
RED.nodes.registerType("valve", {
|
RED.nodes.registerType("valve", {
|
||||||
category: "EVOLV",
|
category: "EVOLV",
|
||||||
color: "#86bbdd", // color for the node based on the S88 schema
|
color: "#3CAEA3",
|
||||||
defaults: {
|
defaults: {
|
||||||
|
|
||||||
// Define default properties
|
// Define default properties
|
||||||
@@ -131,6 +131,7 @@
|
|||||||
<label for="node-input-dbaseOutputFormat"><i class="fa fa-database"></i> Database Output</label>
|
<label for="node-input-dbaseOutputFormat"><i class="fa fa-database"></i> Database Output</label>
|
||||||
<select id="node-input-dbaseOutputFormat" style="width:60%;">
|
<select id="node-input-dbaseOutputFormat" style="width:60%;">
|
||||||
<option value="influxdb">influxdb</option>
|
<option value="influxdb">influxdb</option>
|
||||||
|
<option value="frost">frost</option>
|
||||||
<option value="json">json</option>
|
<option value="json">json</option>
|
||||||
<option value="csv">csv</option>
|
<option value="csv">csv</option>
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@@ -13,21 +13,21 @@
|
|||||||
|
|
||||||
The registry lives in `src/commands/index.js`. Each descriptor maps a canonical `msg.topic` to its handler; aliases emit a one-time deprecation warning the first time they fire.
|
The registry lives in `src/commands/index.js`. Each descriptor maps a canonical `msg.topic` to its handler; aliases emit a one-time deprecation warning the first time they fire.
|
||||||
|
|
||||||
<!-- BEGIN AUTOGEN: topic-contract — populate via wiki-gen tool (TODO) -->
|
<!-- BEGIN AUTOGEN: topic-contract -->
|
||||||
|
|
||||||
| Canonical topic | Aliases | Payload | Unit | Effect |
|
| Canonical topic | Aliases | Payload | Unit | Effect |
|
||||||
|:---|:---|:---|:---|:---|
|
|---|---|---|---|---|
|
||||||
| `set.mode` | `setMode` | `string` (`auto` / `virtualControl` / `fysicalControl` / `maintenance`) | — | Calls `source.setMode(payload)`. Invalid mode logs `warn` and is dropped. |
|
| `set.mode` | `setMode` | `string` | — | Switch the operating mode. Allowed: `auto`, `virtualControl`, `fysicalControl`, `maintenance` (schema-validated in `valve.json` → `mode.current`). |
|
||||||
| `cmd.startup` | — | `{ source?: string }` | — | `source.handleInput(payload.source ?? 'parent', 'execSequence', 'startup')` — runs the configured `startup` sequence (default `[starting, warmingup, operational]`). |
|
| `cmd.startup` | — | any | — | Initiate the valve startup sequence. |
|
||||||
| `cmd.shutdown` | — | `{ source?: string }` | — | `source.handleInput(..., 'execSequence', 'shutdown')`. Pre-shutdown the valve ramps to position 0 if currently `operational`. |
|
| `cmd.shutdown` | — | any | — | Initiate the valve shutdown sequence. |
|
||||||
| `cmd.estop` | `emergencystop`, `emergencyStop` | `{ source?: string, action?: string }` | — | `source.handleInput(payload.source ?? 'parent', payload.action ?? 'emergencystop')` — runs the `emergencystop` sequence (default `[emergencystop, off]`). |
|
| `cmd.estop` | `emergencystop`, `emergencyStop` | any | — | Trigger an emergency stop on the valve. |
|
||||||
| `set.position` | `execMovement` | `{ source?: string, action?: string, setpoint: number }` | control % (no `units`; no `percent` measure in convert) | `source.handleInput(..., 'execMovement', Number(payload.setpoint))` — moves the valve to a position via `state.moveTo`. |
|
| `execSequence` | — | `object` | — | Legacy umbrella that demuxes payload.action to startup / shutdown / estop. |
|
||||||
| `data.flow` | `updateFlow` | `{ variant, value, position, unit? }` — `variant ∈ {'measured','predicted'}` | `volumeFlowRate` (default `m3/h`) | `source.updateFlow(...)` — pushes a flow value into MeasurementContainer at `<position>` and triggers a deltaP recompute. |
|
| `set.position` | `execMovement` | `object` | — | Move the valve to a control-% position via execMovement. |
|
||||||
| `query.curve` | `showcurve` | any | — | `source.showCurve()` — replies on **Port 0** with `{ topic: 'Showing curve', payload: <result> }` via `ctx.send`. |
|
| `data.flow` | `updateFlow` | `object` | — | Push a measured flow into the valve (variant + position + unit). |
|
||||||
| `child.register` | `registerChild` | `string` (child node id); `msg.positionVsParent` carries the position label | — | Resolves the child via `RED.nodes.getNode(payload)` and registers it through `childRegistrationUtils.registerChild(child.source, msg.positionVsParent)`. The valve's `registerChild` records the child for fluid-contract tracking. |
|
| `query.curve` | `showcurve` | any | — | Return the valve characteristic curve on the reply port. |
|
||||||
| `execSequence` | — (legacy umbrella, `_legacy: true`) | `{ source, action, parameter }` with `action ∈ {'startup','shutdown','emergencyStop','emergencystop'}` | — | Content-based router: forwards to canonical `cmd.startup` / `cmd.shutdown` / `cmd.estop` based on `payload.action`. Unknown action logs `warn`. Prefer the canonical `cmd.*` topics. |
|
| `child.register` | `registerChild` | `string` | — | Register a child measurement with this valve. |
|
||||||
|
|
||||||
<!-- END AUTOGEN -->
|
<!-- END AUTOGEN: topic-contract -->
|
||||||
|
|
||||||
### `execSequence` demux
|
### `execSequence` demux
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user