updates for standaardisation

This commit is contained in:
znetsixe
2025-06-25 10:43:15 +02:00
parent 0f855a8d2f
commit 0feff2e0fe
3 changed files with 49 additions and 107 deletions

View File

@@ -48,17 +48,17 @@ class MeasurementNode {
this.config = {
general: {
name: uiConfig.name,
id: this.id,
unit: uiConfig.unit,
id: uiConfig.id, //need to add this later use node.uuid from a single project file thats unique per location + node-red environment + node
unit: uiConfig.unit, // add converter options later to convert to default units (need like a model that defines this which units we are going to use and then conver to those standards)
logging: {
enabled: uiConfig.enableLog,
logLevel: uiConfig.logLevel
}
},
asset: {
tagCode: uiConfig.assetTagCode,
tagCode: uiConfig.assetTagCode, //need to add this later to the asset model
supplier: uiConfig.supplier,
category: uiConfig.category,
category: uiConfig.category, //add later to define as the software type
type: uiConfig.assetType,
model: uiConfig.model,
unit: uiConfig.unit
@@ -77,7 +77,8 @@ class MeasurementNode {
},
simulation: {
enabled: uiConfig.simulator
}
},
positionVsParent: uiConfig.position || 'atEquipment', // default to 'atEquipment' if not set
};
// Utility for formatting outputs
@@ -92,7 +93,7 @@ class MeasurementNode {
}
/**
* Bind Measurement events to Node-RED status updates. Using internal emitter.
* Bind Measurement events to Node-RED status updates. Using internal emitter. --> REMOVE LATER WE NEED ONLY COMPLETE CHILDS AND THEN CHECK FOR UPDATES
*/
_bindEvents() {
this.source.emitter.on('mAbs', (val) => {
@@ -109,7 +110,7 @@ class MeasurementNode {
this.node.send([
null,
null,
{ topic: 'registerChild', payload: this.id, positionVsParent: 'upstream' }
{ topic: 'registerChild', payload: this.id, positionVsParent: this.config.functionality.positionVsParent }
]);
}, 100);
}