Compare commits
1 Commits
8aa5b5e23e
...
63b5f946e2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
63b5f946e2 |
@@ -7,14 +7,69 @@
|
|||||||
const handlers = require('./handlers');
|
const handlers = require('./handlers');
|
||||||
|
|
||||||
module.exports = [
|
module.exports = [
|
||||||
{ topic: 'set.mode', aliases: ['setMode'], payloadSchema: { type: 'string' }, handler: handlers.setMode },
|
{
|
||||||
{ topic: 'cmd.startup', payloadSchema: { type: 'any' }, handler: handlers.startup },
|
topic: 'set.mode',
|
||||||
{ topic: 'cmd.shutdown', payloadSchema: { type: 'any' }, handler: handlers.shutdown },
|
aliases: ['setMode'],
|
||||||
{ topic: 'cmd.estop', aliases: ['emergencystop', 'emergencyStop'], payloadSchema: { type: 'any' }, handler: handlers.estop },
|
payloadSchema: { type: 'string' },
|
||||||
|
description: 'Switch the valve between auto / manual control modes.',
|
||||||
|
handler: handlers.setMode,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
topic: 'cmd.startup',
|
||||||
|
payloadSchema: { type: 'any' },
|
||||||
|
description: 'Initiate the valve startup sequence.',
|
||||||
|
handler: handlers.startup,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
topic: 'cmd.shutdown',
|
||||||
|
payloadSchema: { type: 'any' },
|
||||||
|
description: 'Initiate the valve shutdown sequence.',
|
||||||
|
handler: handlers.shutdown,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
topic: 'cmd.estop',
|
||||||
|
aliases: ['emergencystop', 'emergencyStop'],
|
||||||
|
payloadSchema: { type: 'any' },
|
||||||
|
description: 'Trigger an emergency stop on the valve.',
|
||||||
|
handler: handlers.estop,
|
||||||
|
},
|
||||||
// Content-based demux; behaviour matches cmd.startup/cmd.shutdown exactly.
|
// Content-based demux; behaviour matches cmd.startup/cmd.shutdown exactly.
|
||||||
{ topic: 'execSequence', payloadSchema: { type: 'object' }, handler: handlers.execSequenceAlias, _legacy: true },
|
{
|
||||||
{ topic: 'set.position', aliases: ['execMovement'], payloadSchema: { type: 'object' }, handler: handlers.setPosition },
|
topic: 'execSequence',
|
||||||
{ topic: 'data.flow', aliases: ['updateFlow'], payloadSchema: { type: 'object' }, handler: handlers.dataFlow },
|
payloadSchema: { type: 'object' },
|
||||||
{ topic: 'query.curve', aliases: ['showcurve'], payloadSchema: { type: 'any' }, handler: handlers.queryCurve },
|
description: 'Legacy umbrella that demuxes payload.action to startup / shutdown / estop.',
|
||||||
{ topic: 'child.register', aliases: ['registerChild'], payloadSchema: { type: 'string' }, handler: handlers.registerChild },
|
handler: handlers.execSequenceAlias,
|
||||||
|
_legacy: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
topic: 'set.position',
|
||||||
|
aliases: ['execMovement'],
|
||||||
|
payloadSchema: { type: 'object' },
|
||||||
|
// Control-percent position — no units field (no `percent` measure in convert).
|
||||||
|
description: 'Move the valve to a control-% position via execMovement.',
|
||||||
|
handler: handlers.setPosition,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
topic: 'data.flow',
|
||||||
|
aliases: ['updateFlow'],
|
||||||
|
payloadSchema: { type: 'object' },
|
||||||
|
// Compound payload `{variant, value, position, unit}` — handler converts
|
||||||
|
// internally via unitPolicy; registry normalisation is skipped.
|
||||||
|
description: 'Push a measured flow into the valve (variant + position + unit).',
|
||||||
|
handler: handlers.dataFlow,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
topic: 'query.curve',
|
||||||
|
aliases: ['showcurve'],
|
||||||
|
payloadSchema: { type: 'any' },
|
||||||
|
description: 'Return the valve characteristic curve on the reply port.',
|
||||||
|
handler: handlers.queryCurve,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
topic: 'child.register',
|
||||||
|
aliases: ['registerChild'],
|
||||||
|
payloadSchema: { type: 'string' },
|
||||||
|
description: 'Register a child measurement with this valve.',
|
||||||
|
handler: handlers.registerChild,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user