merged in hotfixes and kept staging protobuf

This commit is contained in:
Carter 2026-01-19 10:53:24 -06:00
commit d7c9734c06
7 changed files with 47 additions and 43 deletions

View file

@ -263,32 +263,39 @@ export default function BinCard(props: Props) {
let val;
let useEMC = false;
switch (valDisplay) {
case "average":
//taking the switch cases out so that the node always displays the average for the moisture/humidity
if (average?.emc) {
useEMC = true;
val = average.emc;
} else {
val = average?.humid;
}
break;
case "low":
if (coldNode?.emc) {
useEMC = true;
val = coldNode.emc;
} else {
val = coldNode?.humid;
}
break;
case "high":
if (hotNode?.emc) {
useEMC = true;
val = hotNode.emc;
} else {
val = hotNode?.humid;
}
break;
}
// switch (valDisplay) {
// case "average":
// if (average?.emc) {
// useEMC = true;
// val = average.emc;
// } else {
// val = average?.humid;
// }
// break;
// case "low":
// if (coldNode?.emc) {
// useEMC = true;
// val = coldNode.emc;
// } else {
// val = coldNode?.humid;
// }
// break;
// case "high":
// if (hotNode?.emc) {
// useEMC = true;
// val = hotNode.emc;
// } else {
// val = hotNode?.humid;
// }
// break;
// }
if (val !== undefined && !isNaN(val)) {
display = val.toFixed(2);
@ -334,7 +341,8 @@ export default function BinCard(props: Props) {
color="textSecondary"
noWrap
style={{ fontSize: "0.5rem" }}>
{valDisplay === "high" ? "High" : valDisplay === "low" ? "Low" : "Average"}
{/* {valDisplay === "high" ? "High" : valDisplay === "low" ? "Low" : "Average"} */}
Average
</Typography>
</Box>
</Grid>

View file

@ -21,6 +21,7 @@ import { pond } from "protobuf-ts/pond";
import React, { useEffect, useState } from "react";
import { makeStyles } from "@mui/styles";
import { useGlobalState } from "providers";
import { getContextKeys, getContextTypes } from "pbHelpers/Context";
interface TabPanelProps {
children?: React.ReactNode;
@ -116,13 +117,7 @@ export default function DeviceLinkDrawer(props: Props) {
undefined,
undefined,
undefined,
true,
undefined,
undefined,
undefined,
undefined,
undefined,
as
true
)
.then(resp => {
let devMap = new Map<string, pond.ComprehensiveDevice>();

View file

@ -92,7 +92,7 @@ export default function GateDevice(props: Props) {
c.status.measurement[0].values[0] &&
c.status.measurement[0].values[0].values[1]
) {
setPCAFanOn(c.status.measurement[0].values[0].values[1] > 250); //apx 1 iwg
setPCAFanOn(c.status.measurement[0].values[0].values[1] > 996); //apx 4 iwg
}
break;
default:

View file

@ -27,6 +27,7 @@ import React, { useEffect, useState } from "react";
import { avg } from "utils";
import GateFlowGraph from "./GateFlowGraph";
import { makeStyles } from "@mui/styles";
import { cloneDeep } from "lodash";
interface Props {
gate: Gate;
@ -245,7 +246,9 @@ export default function GateGraphs(props: Props) {
const graphHeader = (comp: Component) => {
const componentIcon = GetComponentIcon(comp.settings.type, comp.settings.subtype, themeType);
console.log(comp)
let measurement = cloneDeep(comp.status.measurement)
let umArray = measurement.map(um => UnitMeasurement.create(um, user))
return (
<CardHeader
avatar={
@ -260,9 +263,7 @@ export default function GateGraphs(props: Props) {
subheader={
<UnitMeasurementSummary
component={comp}
reading={UnitMeasurement.convertLastMeasurement(
comp.status.measurement.map(um => UnitMeasurement.create(um, user)) ?? []
)}
reading={UnitMeasurement.convertLastMeasurement(umArray)}
/>
}
/>

View file

@ -109,7 +109,7 @@ export default function ObjectHeaterCard(props: Props) {
});
}
}
if (heaterData.devices[0]) {
if (heaterData.devices && heaterData.devices[0]) {
setConnectedDevice(Device.any(heaterData.devices[0].device));
heaterData.devices[0].components.forEach(c => {
//loop through the components and assign them accordingly
@ -171,7 +171,7 @@ export default function ObjectHeaterCard(props: Props) {
const goToHeater = () => {
//history.push("/objectHeaters/" + heater.key);
let path = "/objectHeaters/" + heater.key;
let path = "/heaters/" + heater.key;
navigate(path, { state: {heater: heater} });
};

View file

@ -131,7 +131,7 @@ export default function DevicePage() {
//flip operator and send negative comparitor to save
interaction.settings.conditions.forEach(condition => {
//coming back from the backend as a string for some reason
if (condition.comparison.toString() === "RELATIONAL_OPERATOR_GREATER_THAN") {
if (condition.comparison === quack.RelationalOperator.RELATIONAL_OPERATOR_GREATER_THAN) {
condition.comparison = quack.RelationalOperator.RELATIONAL_OPERATOR_LESS_THAN;
} else {
condition.comparison = quack.RelationalOperator.RELATIONAL_OPERATOR_GREATER_THAN;

View file

@ -56,8 +56,8 @@ export default function Site() {
siteAPI
.getSitePage(siteKey, as)
.then(resp => {
setSite(ISite.any(resp.data.site));
setHeaters(resp.data.heaterData);
if(resp.data.site) setSite(ISite.any(resp.data.site));
if(resp.data.heaterData) setHeaters(resp.data.heaterData);
setLoadingSite(false);
})
.catch(err => {