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) <noreply@anthropic.com>
55 lines
1.7 KiB
JavaScript
55 lines
1.7 KiB
JavaScript
'use strict';
|
|
|
|
// Diffuser command registry. Consumed by BaseNodeAdapter via
|
|
// `static commands = require('./commands')`. Each descriptor maps a
|
|
// canonical msg.topic to its handler; legacy names live under `aliases`
|
|
// and emit a one-time deprecation warning at runtime.
|
|
|
|
const handlers = require('./handlers');
|
|
|
|
module.exports = [
|
|
{
|
|
topic: 'data.flow',
|
|
aliases: ['air_flow'],
|
|
payloadSchema: { type: 'number' },
|
|
units: { measure: 'volumeFlowRate', default: 'm3/h' },
|
|
description: 'Push the measured air flow into the diffuser model.',
|
|
handler: handlers.setFlow,
|
|
},
|
|
{
|
|
topic: 'set.density',
|
|
aliases: ['density'],
|
|
payloadSchema: { type: 'number' },
|
|
description: 'Update the air density used in OTR / SOTR calculations.',
|
|
handler: handlers.setDensity,
|
|
},
|
|
{
|
|
topic: 'set.water-height',
|
|
aliases: ['height_water'],
|
|
payloadSchema: { type: 'number' },
|
|
description: 'Update the water column height above the diffusers (m).',
|
|
handler: handlers.setWaterHeight,
|
|
},
|
|
{
|
|
topic: 'set.header-pressure',
|
|
aliases: ['header_pressure'],
|
|
payloadSchema: { type: 'number' },
|
|
description: 'Update the header (supply) pressure feeding the diffusers (mbar).',
|
|
handler: handlers.setHeaderPressure,
|
|
},
|
|
{
|
|
topic: 'set.elements',
|
|
aliases: ['elements'],
|
|
payloadSchema: { type: 'number' },
|
|
description: 'Update the count of active diffuser elements.',
|
|
handler: handlers.setElements,
|
|
},
|
|
{
|
|
topic: 'set.alfa-factor',
|
|
aliases: ['alfaFactor'],
|
|
payloadSchema: { type: 'number' },
|
|
description: 'Update the alfa factor used in oxygen-transfer correction.',
|
|
handler: handlers.setAlfaFactor,
|
|
},
|
|
];
|