fixed the bin card on the bins page to not use temp only cables for the average humidity calc
This commit is contained in:
parent
d1e9066324
commit
5636b70fa7
2 changed files with 15 additions and 12 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue