From 40c8e010108f75b7df1ad3ca33b7e329b08035e1 Mon Sep 17 00:00:00 2001 From: csawatzky Date: Tue, 29 Apr 2025 12:09:28 -0600 Subject: [PATCH] modified the describer for measurments to change the label for auto detect to cable id and type --- src/pages/Device.tsx | 1 + src/pbHelpers/MeasurementDescriber.ts | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/src/pages/Device.tsx b/src/pages/Device.tsx index dd634f5..702285e 100644 --- a/src/pages/Device.tsx +++ b/src/pages/Device.tsx @@ -96,6 +96,7 @@ export default function DevicePage() { } } }); + setDiagnosticComponents(diagComponents) setComponents(rComponents) let interactions: Interaction[] = []; resp.data.interactions.forEach((interaction: pond.Interaction) => { diff --git a/src/pbHelpers/MeasurementDescriber.ts b/src/pbHelpers/MeasurementDescriber.ts index fd4716b..ee45c8f 100644 --- a/src/pbHelpers/MeasurementDescriber.ts +++ b/src/pbHelpers/MeasurementDescriber.ts @@ -110,6 +110,10 @@ export class MeasurementDescriber { } if (componentType === quack.ComponentType.COMPONENT_TYPE_GRAIN_CABLE) { this.details.graph = GraphType.AREA; + if(componentSubtype === quack.GrainCableSubtype.GRAIN_CABLE_SUBTYPE_OPI_DIAG){ + this.details.label = "Cable ID" + this.details.unit = "" + } } if (componentType === quack.ComponentType.COMPONENT_TYPE_VAPOUR_PRESSURE_DEFICIT) { this.details.path = "vpd.celciusTimes10"; @@ -194,6 +198,10 @@ export class MeasurementDescriber { if (componentType === quack.ComponentType.COMPONENT_TYPE_GRAIN_CABLE) { this.details.label = "Humidity"; this.details.graph = GraphType.AREA; + if(componentSubtype === quack.GrainCableSubtype.GRAIN_CABLE_SUBTYPE_OPI_DIAG){ + this.details.label = "Cable Type" + this.details.unit = "" + } // can be used for testing node splitting on a cable if you dont have a component that uses it // this.details.nodeDetails = { // colours: ["white", "black"],