diff --git a/src/nodeClass.js b/src/nodeClass.js index 842c3a6..53f8dc0 100644 --- a/src/nodeClass.js +++ b/src/nodeClass.js @@ -41,31 +41,12 @@ class nodeClass { * @param {object} uiConfig - Raw config from Node-RED UI. */ _loadConfig(uiConfig,node) { + const cfgMgr = new configManager(); - // Merge UI config over defaults - this.config = { - general: { - id: node.id, // node.id is for the child registration process - 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: { - uuid: uiConfig.assetUuid, //need to add this later to the asset model - tagCode: uiConfig.assetTagCode, //need to add this later to the asset model - supplier: uiConfig.supplier, - category: uiConfig.category, //add later to define as the software type - type: uiConfig.assetType, - model: uiConfig.model, - unit: uiConfig.unit - }, - functionality: { - positionVsParent: uiConfig.positionVsParent - }, + // Build config: base sections + rotatingMachine-specific domain config + this.config = cfgMgr.buildConfig(this.name, uiConfig, node.id, { flowNumber: uiConfig.flowNumber - }; + }); // Utility for formatting outputs this._output = new outputUtils();