From bc916c01653825f73ec497da97e8777be8c2cd61 Mon Sep 17 00:00:00 2001 From: Rene De ren Date: Fri, 3 Oct 2025 15:41:53 +0200 Subject: [PATCH] log updates --- src/specificClass.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/specificClass.js b/src/specificClass.js index 4422b3a..823f60c 100644 --- a/src/specificClass.js +++ b/src/specificClass.js @@ -20,7 +20,7 @@ * OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * - * Ownership of this code remains solely with the original author. Unauthorized + * Ownership of this code remainregisterChilds solely with the original author. Unauthorized * use of this Software is strictly prohibited. * * @summary A class to interact and manipulate machines with a non-euclidian curve @@ -120,18 +120,23 @@ class Machine { /*------------------- Register child events -------------------*/ registerChild(child, softwareType) { - this.logger.debug('Setting up child event listeners'); + this.logger.debug('Setting up child event for softwaretype ' + softwareType); if(softwareType === "measurement"){ const position = child.config.functionality.positionVsParent; + const distance = child.config.functionality.distanceVsParent || 0; const measurementType = child.config.asset.type; const key = `${measurementType}_${position}`; + //rebuild to measurementype.variant no position and then switch based on values not strings or names. const eventName = `${measurementType}.measured.${position}`; + this.logger.debug(`Setting up listener for ${eventName} from child ${child.config.general.name}`); // Register event listener for measurement updates child.measurements.emitter.on(eventName, (eventData) => { this.logger.debug(`🔄 ${position} ${measurementType} from ${eventData.childName}: ${eventData.value} ${eventData.unit}`); + + console.log(` Emitting... ${eventName} with data:`); // Store directly in parent's measurement container this.measurements .type(measurementType)