Compare commits

..

1 Commits

Author SHA1 Message Date
znetsixe
6c4db03aba feat(formatters): frost handoff formatter + config wiring
Adds src/helper/formatters/frostFormatter.js — structured-envelope formatter parallel to the InfluxDB one. Produces dbase messages that a CoreSync collector can forward to FROST/SensorThings without coupling producing nodes to FROST HTTP details. Registered in formatters/index.js.

Config additions in 4 node schemas (machineGroupControl, measurement, pumpingStation, rotatingMachine) expose the new dbase format option in the editor.

Part of the CoreSync FROST handoff initiative — see superproject CORESYNC_FROST_INTERVIEW_HANDOFF.md.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 15:06:39 +02:00
6 changed files with 33 additions and 1 deletions

View File

@@ -134,6 +134,7 @@
"type": "enum",
"values": [
{ "value": "influxdb", "description": "InfluxDB line-protocol payload (default)." },
{ "value": "frost", "description": "FROST/SensorThings CoreSync payload." },
{ "value": "json", "description": "Raw JSON payload." },
{ "value": "csv", "description": "CSV-formatted payload." }
],

View File

@@ -120,6 +120,7 @@
"type": "enum",
"values": [
{ "value": "influxdb", "description": "InfluxDB line-protocol payload (default)." },
{ "value": "frost", "description": "FROST/SensorThings CoreSync payload." },
{ "value": "json", "description": "Raw JSON payload." },
{ "value": "csv", "description": "CSV-formatted payload." }
],

View File

@@ -166,6 +166,10 @@
"value": "influxdb",
"description": "InfluxDB telemetry payload."
},
{
"value": "frost",
"description": "FROST/SensorThings CoreSync payload."
},
{
"value": "json",
"description": "JSON payload."

View File

@@ -134,6 +134,7 @@
"type": "enum",
"values": [
{ "value": "influxdb", "description": "InfluxDB line-protocol payload (default)." },
{ "value": "frost", "description": "FROST/SensorThings CoreSync payload." },
{ "value": "json", "description": "Raw JSON payload." },
{ "value": "csv", "description": "CSV-formatted payload." }
],

View File

@@ -0,0 +1,23 @@
/**
* FROST handoff formatter
* -----------------------
* Keeps the same structured envelope as the InfluxDB formatter so a shared
* CoreSync collector can accept existing EVOLV dbase messages without coupling
* producing nodes to FROST HTTP details.
*/
function format(measurement, metadata) {
const { fields, tags, config } = metadata;
return {
measurement,
fields,
tags: tags || {},
timestamp: new Date().toISOString(),
source: {
nodeId: config?.general?.id,
softwareType: config?.functionality?.softwareType,
unit: config?.general?.unit || config?.asset?.unit,
},
};
}
module.exports = { format };

View File

@@ -14,6 +14,7 @@ const influxdbFormatter = require('./influxdbFormatter');
const jsonFormatter = require('./jsonFormatter');
const csvFormatter = require('./csvFormatter');
const processFormatter = require('./processFormatter');
const frostFormatter = require('./frostFormatter');
// Built-in registry
const registry = {
@@ -21,6 +22,7 @@ const registry = {
json: jsonFormatter,
csv: csvFormatter,
process: processFormatter,
frost: frostFormatter,
};
/**