Reset chaining context in MeasurementContainer.clear()
Closes #25 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -77,7 +77,7 @@ class ConfigManager {
|
||||
}
|
||||
},
|
||||
functionality: {
|
||||
softwareType: nodeName,
|
||||
softwareType: nodeName.toLowerCase(),
|
||||
positionVsParent: uiConfig.positionVsParent || 'atEquipment',
|
||||
distance: uiConfig.hasDistance ? uiConfig.distance : undefined
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
},
|
||||
"functionality": {
|
||||
"softwareType": {
|
||||
"default": "machineGroup",
|
||||
"default": "machinegroupcontrol",
|
||||
"rules": {
|
||||
"type": "string",
|
||||
"description": "Logical name identifying the software type."
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
},
|
||||
"functionality": {
|
||||
"softwareType": {
|
||||
"default": "machine",
|
||||
"default": "rotatingmachine",
|
||||
"rules": {
|
||||
"type": "string",
|
||||
"description": "Specified software type for this configuration."
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
},
|
||||
"functionality": {
|
||||
"softwareType": {
|
||||
"default": "valveGroupControl",
|
||||
"default": "valvegroupcontrol",
|
||||
"rules": {
|
||||
"type": "string",
|
||||
"description": "Specified software type for this configuration."
|
||||
|
||||
@@ -270,15 +270,29 @@ class ValidationUtils {
|
||||
this.logger.warn(`Dimension '${name}' key '${key}' has mismatched x and y lengths. Ignoring this key.`);
|
||||
return false;
|
||||
}
|
||||
// Validate that x values are in ascending order
|
||||
// Validate that x values are in ascending order — sort if not
|
||||
else if (!this.isSorted(value.x)) {
|
||||
this.logger.warn(`Dimension '${name}' key '${key}' has unsorted x values. Sorting...`);
|
||||
return false;
|
||||
const indices = value.x.map((v, i) => i);
|
||||
indices.sort((a, b) => value.x[a] - value.x[b]);
|
||||
value.x = indices.map(i => value.x[i]);
|
||||
value.y = indices.map(i => value.y[i]);
|
||||
}
|
||||
// Validate that x values are unique
|
||||
else if (!this.isUnique(value.x)) {
|
||||
// Validate that x values are unique — remove duplicates if not
|
||||
if (!this.isUnique(value.x)) {
|
||||
this.logger.warn(`Dimension '${name}' key '${key}' has duplicate x values. Removing duplicates...`);
|
||||
return false;
|
||||
const seen = new Set();
|
||||
const uniqueX = [];
|
||||
const uniqueY = [];
|
||||
for (let i = 0; i < value.x.length; i++) {
|
||||
if (!seen.has(value.x[i])) {
|
||||
seen.add(value.x[i]);
|
||||
uniqueX.push(value.x[i]);
|
||||
uniqueY.push(value.y[i]);
|
||||
}
|
||||
}
|
||||
value.x = uniqueX;
|
||||
value.y = uniqueY;
|
||||
}
|
||||
// Validate that y values are numbers
|
||||
else if (!this.areNumbers(value.y)) {
|
||||
|
||||
@@ -455,6 +455,8 @@ difference({ from = "downstream", to = "upstream", unit: requestedUnit } = {}) {
|
||||
this._currentType = null;
|
||||
this._currentVariant = null;
|
||||
this._currentPosition = null;
|
||||
this._currentDistance = null;
|
||||
this._unit = null;
|
||||
}
|
||||
|
||||
// Helper method for value conversion
|
||||
|
||||
Reference in New Issue
Block a user