Updated distance in measurement helper so its a settable compoment. See example.js file in measurement helper folder
This commit is contained in:
@@ -5,7 +5,7 @@ class ChildRegistrationUtils {
|
||||
this.registeredChildren = new Map();
|
||||
}
|
||||
|
||||
async registerChild(child, positionVsParent) {
|
||||
async registerChild(child, positionVsParent, distance) {
|
||||
const { softwareType } = child.config.functionality;
|
||||
const { name, id } = child.config.general;
|
||||
|
||||
@@ -13,7 +13,7 @@ class ChildRegistrationUtils {
|
||||
|
||||
// Enhanced child setup
|
||||
child.parent = this.mainClass;
|
||||
//child.positionVsParent = positionVsParent;
|
||||
child.positionVsParent = positionVsParent;
|
||||
|
||||
// Enhanced measurement container with rich context
|
||||
if (child.measurements) {
|
||||
@@ -33,10 +33,10 @@ class ChildRegistrationUtils {
|
||||
registeredAt: Date.now()
|
||||
});
|
||||
|
||||
this.logger.debug(`Child ${name} stored under type ${softwareType}`);
|
||||
this.logger.debug(`Spitting out mainclass: ${this.mainClass.child} `);
|
||||
|
||||
// IMPORTANT: Only call parent registration - no automatic handling and if parent has this function then try to register this child
|
||||
if (typeof this.mainClass.registerChild === 'function') {
|
||||
this.mainClass.registerChild(child, softwareType);
|
||||
}
|
||||
|
||||
this.logger.info(`✅ Child ${name} registered successfully`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user