From 41f3374982aa8ed5ae3e3666e07b826c69143888 Mon Sep 17 00:00:00 2001 From: csawatzky Date: Mon, 15 Dec 2025 09:57:31 -0600 Subject: [PATCH 1/9] hotfix - making high the default display for the grain temp for bins and binVisualizer --- src/bin/BinVisualizerV2.tsx | 2 +- src/pages/Bins.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bin/BinVisualizerV2.tsx b/src/bin/BinVisualizerV2.tsx index 7d99671..5b3dc62 100644 --- a/src/bin/BinVisualizerV2.tsx +++ b/src/bin/BinVisualizerV2.tsx @@ -258,7 +258,7 @@ export default function BinVisualizer(props: Props) { //const [highTempCable, setHighTempCable] = useState(); //const [lowTempCable, setLowTempCable] = useState(); //the switch value to determine what to display in the grain condition box - const [valueDisplay, setValueDisplay] = useState<"low" | "avg" | "high">("avg"); + const [valueDisplay, setValueDisplay] = useState<"low" | "avg" | "high">("high"); //the variables to be able to change the grain type through a unique dialog outside of the settings const [grainChangeDialog, setGrainChangeDialog] = useState(false); const grainOptions = GrainOptions(); diff --git a/src/pages/Bins.tsx b/src/pages/Bins.tsx index 9145a6a..bad16c9 100644 --- a/src/pages/Bins.tsx +++ b/src/pages/Bins.tsx @@ -196,7 +196,7 @@ export default function Bins(props: Props) { const { openSnack } = useSnackbar(); // const history = useHistory(); const navigate = useNavigate() - const [cardValDisplay, setCardValDisplay] = useState<"high" | "low" | "average">("average"); + const [cardValDisplay, setCardValDisplay] = useState<"high" | "low" | "average">("high"); const [teamsDialog, setTeamsDialog] = useState(false) From 846f314e166997a87d2f459c9695d1fa5e9657de Mon Sep 17 00:00:00 2001 From: csawatzky Date: Tue, 16 Dec 2025 14:33:04 -0600 Subject: [PATCH 2/9] hotfix for loading terminals as a team --- src/pages/Terminals.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/Terminals.tsx b/src/pages/Terminals.tsx index 916116c..dd90aac 100644 --- a/src/pages/Terminals.tsx +++ b/src/pages/Terminals.tsx @@ -181,7 +181,8 @@ export default function Terminals(props: Props) { const load = useCallback(() => { if(loading) return setLoading(true) - terminalAPI.listTerminals(200, 0, "asc", "name", as).then(resp => { + terminalAPI.listTerminals(200, 0, "asc", "name", undefined, as).then(resp => { + console.log(resp.data) if(resp.data.terminals){ setTerminals(resp.data.terminals.map(a => Terminal.any(a))); } From de855c6fdb3ea851d2d1cbf520b724c19e48d70e Mon Sep 17 00:00:00 2001 From: Carter Date: Wed, 17 Dec 2025 10:46:20 -0600 Subject: [PATCH 3/9] adding ? before accessing length to prevent white screen error --- src/user/UserMenu.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/user/UserMenu.tsx b/src/user/UserMenu.tsx index c22b622..a65b935 100644 --- a/src/user/UserMenu.tsx +++ b/src/user/UserMenu.tsx @@ -166,7 +166,7 @@ export default function UserMenu() { ); }; - if (user.id().length < 1) return unauthenticatedUserMenu() + if (user.id()?.length < 1) return unauthenticatedUserMenu() const hasAdmin = user.hasFeature ? user.hasFeature("admin") : false; @@ -182,7 +182,7 @@ export default function UserMenu() { - {picture && hasTeams && team.id().length > 0 ? ( + {picture && hasTeams && team.id()?.length > 0 ? (
{ - if (as.length > 1) { + if (as?.length > 1) { user.settings.useTeam = false; dispatch({ key: "as", value: "" }); userAPI.updateUser(user.id(), user.protobuf()).then(_resp => { @@ -252,13 +252,13 @@ export default function UserMenu() { }); } }} - disabled={user.settings.defaultTeam.length < 1} + disabled={user.settings.defaultTeam?.length < 1} aria-label="Open Team Menu" dense> 1} + disabled={user.settings.defaultTeam?.length < 1} + checked={as?.length > 1} style={{ margin: 0, padding: 0 }} /> From 8238c4df58729416d69c947f7f53f16259cbc36e Mon Sep 17 00:00:00 2001 From: Carter Date: Wed, 17 Dec 2025 21:31:41 -0600 Subject: [PATCH 4/9] adding ? before accessing length to prevent white screen error --- src/pages/Bins.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/Bins.tsx b/src/pages/Bins.tsx index bad16c9..085d382 100644 --- a/src/pages/Bins.tsx +++ b/src/pages/Bins.tsx @@ -261,7 +261,7 @@ export default function Bins(props: Props) { if (doneLoadingPage && grainBins.length < 1 && grainBags.length < 1) { teamAPI.listTeams(1, 0).then(resp => { // console.log(resp.data.teams) - if (resp.data.teams.length > 0) { + if (resp.data?.teams?.length > 0) { // console.log("should?") setTeamsDialog(true) } From 128a06e0a0de736d325b461b34476ec7e4faa919 Mon Sep 17 00:00:00 2001 From: Carter Date: Mon, 22 Dec 2025 20:49:54 -0600 Subject: [PATCH 5/9] hotifx: added more snackbars and some details to help debug reon --- src/app/UserWrapper.tsx | 8 ++++++-- src/pages/Bins.tsx | 3 +++ src/pages/Device.tsx | 6 +++--- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/app/UserWrapper.tsx b/src/app/UserWrapper.tsx index cb4cdf8..110439c 100644 --- a/src/app/UserWrapper.tsx +++ b/src/app/UserWrapper.tsx @@ -12,6 +12,7 @@ import { makeStyles } from '@mui/styles' import { CssBaseline, Theme } from '@mui/material' import { AppThemeProvider } from 'theme/AppThemeProvider' import HTTPProvider from 'providers/http' +import { useSnackbar } from 'hooks' // import FirmwareLoader from './FirmwareLoader' const reducer = (state: GlobalState, action: GlobalStateAction): GlobalState => { @@ -64,6 +65,7 @@ export default function UserWrapper(props: Props) { const useAuth = useAuth0(); const hasFetched = useRef(false); const [global, setGlobal] = useState(undefined) + const snackbar = useSnackbar() const user_id = or(useAuth.user?.sub, "") @@ -81,7 +83,8 @@ export default function UserWrapper(props: Props) { backgroundTasksComplete: false, firmware: new Map() }) - }).catch(() => { + }).catch((err) => { + snackbar.error("get user and team: "+err) userAPI.getUser(user_id).then(user => { setGlobal({ user: user ? user : User.create(), @@ -92,7 +95,8 @@ export default function UserWrapper(props: Props) { backgroundTasksComplete: false, firmware: new Map() }) - }).catch(() => { + }).catch((err) => { + snackbar.error("get user: "+err) setGlobal(globalDefault) }) diff --git a/src/pages/Bins.tsx b/src/pages/Bins.tsx index 085d382..f17125e 100644 --- a/src/pages/Bins.tsx +++ b/src/pages/Bins.tsx @@ -199,6 +199,7 @@ export default function Bins(props: Props) { const [cardValDisplay, setCardValDisplay] = useState<"high" | "low" | "average">("high"); const [teamsDialog, setTeamsDialog] = useState(false) + const snackbar = useSnackbar() // const [scrollTranslations, setScrollTranslations] = useState({ // bins: 0, @@ -265,6 +266,8 @@ export default function Bins(props: Props) { // console.log("should?") setTeamsDialog(true) } + }).catch(err => { + snackbar.error("error listing teams: "+err) }) } }, [doneLoadingPage, grainBins, grainBags]) diff --git a/src/pages/Device.tsx b/src/pages/Device.tsx index 5acc7aa..9195c3d 100644 --- a/src/pages/Device.tsx +++ b/src/pages/Device.tsx @@ -158,9 +158,9 @@ export default function DevicePage() { if (length > 0) { warningString = warningString + " through " + getContextTypes()[length - 1]; } - snackbar.warning(warningString); + snackbar.warning("page data warning: "+warningString); } else { - snackbar.error(err); + snackbar.error("page data error: "+err); } }) .finally(() => setLoading(false)); @@ -174,7 +174,7 @@ export default function DevicePage() { } }) .catch(err => { - console.log(err) + console.log("load port scan: "+err) }) } From 59aae7a8a18e5b3ceeca2bd00b3b0c1a57b7fc61 Mon Sep 17 00:00:00 2001 From: csawatzky Date: Tue, 30 Dec 2025 10:26:52 -0600 Subject: [PATCH 6/9] couple hotfixes: raised the idle flow constant (could be something entered by the user in the future when hitting the button to retrieve flow events) to be 3.5, also fixed the gate visual to be up at the topp rather than centered as that was causing it to move down the page when flipping to the sensor view --- src/gate/GateDevice.tsx | 54 +++----------------------------------- src/gate/GateFlowGraph.tsx | 6 ++--- 2 files changed, 6 insertions(+), 54 deletions(-) diff --git a/src/gate/GateDevice.tsx b/src/gate/GateDevice.tsx index cbf87e6..9f86191 100644 --- a/src/gate/GateDevice.tsx +++ b/src/gate/GateDevice.tsx @@ -56,55 +56,6 @@ export default function GateDevice(props: Props) { const [lastTemps, setLastTemps] = useState({ t1: 0, t2: 0 }); const [lastPressures, setLastPressures] = useState({ p1: 0, p2: 0 }); - // const StyledToggleButtonGroup = withStyles(theme => ({ - // grouped: { - // margin: theme.spacing(-0.5), - // border: "none", - // padding: theme.spacing(1), - // "&:not(:first-child):not(:last-child)": { - // borderRadius: 24, - // marginRight: theme.spacing(0.5), - // marginLeft: theme.spacing(0.5) - // }, - // "&:first-child": { - // borderRadius: 24, - // marginLeft: theme.spacing(0.25) - // }, - // "&:last-child": { - // borderRadius: 24, - // marginRight: theme.spacing(0.25) - // } - // }, - // root: { - // backgroundColor: darken( - // theme.palette.background.paper, - // getThemeType() === "light" ? 0.05 : 0.25 - // ), - // borderRadius: 24, - // content: "border-box" - // } - // }))(ToggleButtonGroup); - - // const StyledToggle = withStyles({ - // root: { - // backgroundColor: "transparent", - // overflow: "visible", - // content: "content-box", - // "&$selected": { - // backgroundColor: "gold", - // color: "black", - // borderRadius: 24, - // fontWeight: "bold" - // }, - // "&$selected:hover": { - // backgroundColor: "rgb(255, 255, 0)", - // color: "black", - // borderRadius: 24 - // } - // }, - // selected: {} - // })(ToggleButton); - useEffect(() => { if (comprehensiveDevice.device) { setDevice(Device.any(comprehensiveDevice.device)); @@ -340,7 +291,8 @@ export default function GateDevice(props: Props) { container direction={(isMobile) ? "column" : "row"} width="100%" - alignItems="center" + spacing={(isMobile) ? 7 : 0} + //alignItems="center" > - + ([]); const [eventsLoading, setEventsLoading] = useState(false); - const eventThreshold = 5; - const idleFlow = 2.44; + //these two constants could be entered by the user at time of retrieval + const eventThreshold = 5; //the threshold that if crossed from one measurement to the next during a flow event will end the current flow event and start a new one + const idleFlow = 3.5; //the mass air flow that must be crossed in order to start a flow event, anything below this will not start an event but must go below this to end an event useEffect(() => { if (loadingChartData) return; @@ -102,7 +103,6 @@ export default function GateFlowGraph(props: Props) { timestamp: time.valueOf(), value: val.airFlow ?? 0 }; - data.push(newPoint); if (!recent || recent.timestamp < newPoint.timestamp) { recent = newPoint; From 2dc633e6caa89daa60422e8f49c2363750bf55dc Mon Sep 17 00:00:00 2001 From: csawatzky Date: Tue, 30 Dec 2025 10:43:07 -0600 Subject: [PATCH 7/9] hotfix: adjusted the position of the check in so its not so close to the edge, and some minor style stuff --- src/gate/GateDevice.tsx | 5 ++--- src/gate/GateSVG.tsx | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/gate/GateDevice.tsx b/src/gate/GateDevice.tsx index 9f86191..9fb414f 100644 --- a/src/gate/GateDevice.tsx +++ b/src/gate/GateDevice.tsx @@ -289,12 +289,11 @@ export default function GateDevice(props: Props) { return ( - + { return ( - + Last Checked In: {moment(checkInTime).fromNow()} @@ -342,7 +342,7 @@ export default function GateSVG(props: Props) { return ( - + Date: Tue, 30 Dec 2025 13:19:40 -0600 Subject: [PATCH 8/9] hotfix: increase the pca fan state to 996 pascal (4iwg) from 250 pascal (1iwg), fixed the bug where the sensors tab woul 'convert' the measurment multiple times based on the number of times you went to the tab --- src/gate/GateDevice.tsx | 2 +- src/gate/GateGraphs.tsx | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/gate/GateDevice.tsx b/src/gate/GateDevice.tsx index 9fb414f..f7a8746 100644 --- a/src/gate/GateDevice.tsx +++ b/src/gate/GateDevice.tsx @@ -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: diff --git a/src/gate/GateGraphs.tsx b/src/gate/GateGraphs.tsx index 911d525..40c47d8 100644 --- a/src/gate/GateGraphs.tsx +++ b/src/gate/GateGraphs.tsx @@ -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 ( UnitMeasurement.create(um, user)) ?? [] - )} + reading={UnitMeasurement.convertLastMeasurement(umArray)} /> } /> From d9bcd07c8dbfda98946a2c0306374dd7470d1ed7 Mon Sep 17 00:00:00 2001 From: csawatzky Date: Mon, 5 Jan 2026 11:27:49 -0600 Subject: [PATCH 9/9] changing the humidity/moisture part of the bin card to only display the average and the high, low, average selector only changes the temp part --- src/bin/BinCardV2.tsx | 60 ++++++++++++++++++++++++------------------- 1 file changed, 34 insertions(+), 26 deletions(-) diff --git a/src/bin/BinCardV2.tsx b/src/bin/BinCardV2.tsx index a4afc33..776af57 100644 --- a/src/bin/BinCardV2.tsx +++ b/src/bin/BinCardV2.tsx @@ -261,32 +261,39 @@ export default function BinCard(props: Props) { let val; let useEMC = false; - 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; + //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; } + // 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); @@ -332,7 +339,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