From 1d5e040af9392584b32632aa6b9f15db8786ae45 Mon Sep 17 00:00:00 2001 From: znetsixe Date: Mon, 11 May 2026 17:41:08 +0200 Subject: [PATCH] P11.5 + B2.1/B2.2: per-command units + description (where applicable) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds to scalar setters whose payloads are plain numbers OR {value, unit}. Skipped where payload is compound or mode-dependent (control-%, {F, C: [...]}, etc.) — documented inline. Every command gains a description field for wikiGen consumption. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/commands/index.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/commands/index.js b/src/commands/index.js index 307bd9e..40da98b 100644 --- a/src/commands/index.js +++ b/src/commands/index.js @@ -19,22 +19,26 @@ module.exports = [ topic: 'set.mode', aliases: ['setMode'], payloadSchema: { type: 'string' }, + description: 'Switch the machine between auto / manual control modes.', handler: handlers.setMode, }, { topic: 'cmd.startup', payloadSchema: { type: 'any' }, + description: 'Initiate the machine startup sequence.', handler: handlers.startup, }, { topic: 'cmd.shutdown', payloadSchema: { type: 'any' }, + description: 'Initiate the machine shutdown sequence.', handler: handlers.shutdown, }, { topic: 'cmd.estop', aliases: ['emergencystop'], payloadSchema: { type: 'any' }, + description: 'Trigger an emergency stop.', handler: handlers.estop, }, { @@ -43,6 +47,7 @@ module.exports = [ // one-time deprecation warning the first time it fires. topic: 'execSequence', payloadSchema: { type: 'object' }, + description: 'Legacy umbrella that demuxes payload.action to startup / shutdown.', handler: handlers.execSequenceAlias, _legacy: true, }, @@ -50,36 +55,44 @@ module.exports = [ topic: 'set.setpoint', aliases: ['execMovement'], payloadSchema: { type: 'object' }, + // Control-percent setpoint — no units field (no `percent` measure in convert). + description: 'Move the machine to a control-% setpoint via execMovement.', handler: handlers.setSetpoint, }, { topic: 'set.flow-setpoint', aliases: ['flowMovement'], payloadSchema: { type: 'object' }, + units: { measure: 'volumeFlowRate', default: 'm3/h' }, + description: 'Move the machine to a flow setpoint via flowMovement.', handler: handlers.setFlowSetpoint, }, { topic: 'data.simulate-measurement', aliases: ['simulateMeasurement'], payloadSchema: { type: 'object' }, + description: 'Inject a simulated sensor reading (pressure/flow/temperature/power).', handler: handlers.simulateMeasurement, }, { topic: 'query.curves', aliases: ['showWorkingCurves'], payloadSchema: { type: 'any' }, + description: 'Return the working curves for the machine on the reply port.', handler: handlers.queryCurves, }, { topic: 'query.cog', aliases: ['CoG'], payloadSchema: { type: 'any' }, + description: 'Return the centre-of-gravity (CoG) point on the reply port.', handler: handlers.queryCog, }, { topic: 'child.register', aliases: ['registerChild'], payloadSchema: { type: 'string' }, + description: 'Register a child measurement with this machine.', handler: handlers.registerChild, }, ];