diff --git a/src/bin/BinCardV2.tsx b/src/bin/BinCardV2.tsx index 7026f8f..4bfcb4f 100644 --- a/src/bin/BinCardV2.tsx +++ b/src/bin/BinCardV2.tsx @@ -103,8 +103,10 @@ export default function BinCard(props: Props) { let filteredNodes = c.filteredNodes(true) allTemps.push(...filteredNodes.temps); - allHums.push(...filteredNodes.humids); - allMoistures.push(...filteredNodes.moistures); + if(avg(c.humidities) !== 0){ //if the average of the humidities is 0 that means that all the readings are 0 and it is a temp only cable + allHums.push(...filteredNodes.humids); + allMoistures.push(...filteredNodes.moistures); + } //set the hottest and coldest nodes if (coldestNode === undefined || Math.min(...filteredNodes.temps) < coldestNode.temp) { diff --git a/src/bin/BinVisualizerV2.tsx b/src/bin/BinVisualizerV2.tsx index 6a10ff4..7bfc8a1 100644 --- a/src/bin/BinVisualizerV2.tsx +++ b/src/bin/BinVisualizerV2.tsx @@ -414,14 +414,15 @@ export default function BinVisualizer(props: Props) { //if the lowest temp for this cable is less than the temp in the low node conditions or the low node conditions are not set //use this cables lowest node and trend data in the condition - if (!lowNodeConditions || Math.min(...temps) < lowNodeConditions.tempC) { + if (!lowNodeConditions || Math.min(...filteredNodes.temps) < lowNodeConditions.tempC) { //determine which node is the coldest so that the data displayed is for the same node let lowTempIndex = - temps.indexOf(Math.min(...temps)) === -1 ? 0 : temps.indexOf(Math.min(...temps)); + filteredNodes.temps.indexOf(Math.min(...filteredNodes.temps)) === -1 ? 0 : filteredNodes.temps.indexOf(Math.min(...filteredNodes.temps)); + console.log(lowTempIndex) lowNodeConditions = { - tempC: temps[lowTempIndex], - humidity: humids[lowTempIndex], - emc: emcs[lowTempIndex], + tempC: filteredNodes.temps[lowTempIndex], + humidity: filteredNodes.humids[lowTempIndex], + emc: filteredNodes.moistures[lowTempIndex], tempCTrend: cableTrendData.coldNodeTrend?.tempTrend ?? 0, humidityTrend: cableTrendData.coldNodeTrend?.humidityTrend ?? 0, emcTrend: cableTrendData.coldNodeTrend?.emcTrend ?? 0 @@ -429,13 +430,13 @@ export default function BinVisualizer(props: Props) { } //do the same for the high node - if (!highNodeConditions || cable.maxTemp() > highNodeConditions.tempC) { + if (!highNodeConditions || Math.max(...filteredNodes.temps) > highNodeConditions.tempC) { let highTempIndex = - temps.indexOf(Math.max(...temps)) === -1 ? 0 : temps.indexOf(Math.max(...temps)); + filteredNodes.temps.indexOf(Math.max(...filteredNodes.temps)) === -1 ? 0 : filteredNodes.temps.indexOf(Math.max(...filteredNodes.temps)); highNodeConditions = { - tempC: temps[highTempIndex], - humidity: humids[highTempIndex], - emc: emcs[highTempIndex], + tempC: filteredNodes.temps[highTempIndex], + humidity: filteredNodes.humids[highTempIndex], + emc: filteredNodes.humids[highTempIndex], tempCTrend: cableTrendData.hotNodeTrend?.tempTrend ?? 0, humidityTrend: cableTrendData.hotNodeTrend?.humidityTrend ?? 0, emcTrend: cableTrendData.hotNodeTrend?.emcTrend ?? 0