feat(rotatingMachine): resolve supplier+type from asset registry, drop denormalized fields
specificClass._setupCurves now calls assetResolver.resolveAssetMetadata to derive supplier/type/units from the model id, instead of trusting denormalized fields on the node config. If the model isn't in the registry, installs a null-predictor stub and logs a clear "pick a model from the asset menu" error rather than crashing. rotatingMachine.html: defaults block trimmed (supplier/category/assetType were stale copies of registry data). Tests: - New test/basic/assetMetadata.basic.test.js covers the registry-resolve path and the missing-model fallback. - nodeClass-config / error-paths / nodeClass-routing / factories / abort-deadlock fixtures updated to the trimmed asset shape. - 209/209 tests pass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -30,12 +30,11 @@
|
||||
processOutputFormat: { value: "process" },
|
||||
dbaseOutputFormat: { value: "influxdb" },
|
||||
|
||||
//define asset properties
|
||||
// Asset identifier surface. supplier/category/assetType are
|
||||
// derived at runtime via assetResolver.resolveAssetMetadata(model);
|
||||
// do NOT add them back here. See src/registry/README.md.
|
||||
uuid: { value: "" },
|
||||
assetTagNumber: { value: "" },
|
||||
supplier: { value: "" },
|
||||
category: { value: "" },
|
||||
assetType: { value: "" },
|
||||
model: { value: "" },
|
||||
unit: { value: "" },
|
||||
curvePressureUnit: { value: "mbar" },
|
||||
@@ -63,7 +62,10 @@
|
||||
icon: "font-awesome/fa-cog",
|
||||
|
||||
label: function () {
|
||||
return (this.positionIcon || "") + " " + (this.category || "Machine");
|
||||
// No more `this.category` on the node — fall back to model id, then a
|
||||
// generic name. supplier/category/type live in the registry now.
|
||||
const stem = this.model ? this.model : "Machine";
|
||||
return (this.positionIcon || "") + " " + stem;
|
||||
},
|
||||
|
||||
oneditprepare: function() {
|
||||
|
||||
Reference in New Issue
Block a user