From 2dde79970da30fe24635328cc9b122b628e9c566 Mon Sep 17 00:00:00 2001 From: csawatzky Date: Wed, 13 Aug 2025 15:46:07 -0600 Subject: [PATCH 1/8] hotfix to have the duplicate button available to users with the installer feature flag --- src/bin/BinCardV2.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/BinCardV2.tsx b/src/bin/BinCardV2.tsx index 35fcd12..683e598 100644 --- a/src/bin/BinCardV2.tsx +++ b/src/bin/BinCardV2.tsx @@ -490,7 +490,7 @@ export default function BinCard(props: Props) { return ( - {user.hasFeature("admin") && ( + {user.hasFeature("installer") && ( Date: Thu, 14 Aug 2025 09:18:09 -0600 Subject: [PATCH 2/8] hotfix - putting back the background colour for the resposive table sticky header --- src/common/ResponsiveTable.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/ResponsiveTable.tsx b/src/common/ResponsiveTable.tsx index 79238ea..ef99665 100644 --- a/src/common/ResponsiveTable.tsx +++ b/src/common/ResponsiveTable.tsx @@ -59,7 +59,7 @@ const useStyles = makeStyles((theme: Theme) => { }, stickyHeader: { position: "sticky", - // backgroundColor: getThemeType() === "light" ? "rgb(245, 245, 245)" : "rgb(40, 40, 40)", + backgroundColor: getThemeType() === "light" ? "rgb(245, 245, 245)" : "rgb(40, 40, 40)", top: 0, zIndex: 300 //giving a really high z-index to make sure nothing is in front of it } From eae0628e8be9e149a64f9cdbe7b757b5c5993677 Mon Sep 17 00:00:00 2001 From: csawatzky Date: Mon, 18 Aug 2025 14:59:32 -0600 Subject: [PATCH 3/8] hotfix for the plenum column on the devices page to be renamed and the bin page sensors graph headers reading going through multiple conversions --- src/bin/graphs/BinComponentGraph.tsx | 2 +- src/pages/Devices.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bin/graphs/BinComponentGraph.tsx b/src/bin/graphs/BinComponentGraph.tsx index 6b593a9..3c5a625 100644 --- a/src/bin/graphs/BinComponentGraph.tsx +++ b/src/bin/graphs/BinComponentGraph.tsx @@ -184,7 +184,7 @@ export default function BinComponentGraph(props: Props) { UnitMeasurement.create(m, user)) + lastMeasurement.map(m => UnitMeasurement.create(m, user)) )} /> } diff --git a/src/pages/Devices.tsx b/src/pages/Devices.tsx index 7721ec1..673f097 100644 --- a/src/pages/Devices.tsx +++ b/src/pages/Devices.tsx @@ -472,7 +472,7 @@ export default function Devices() { ] if (hasPlenums) { columns.push({ - title: "Plenum", + title: "Temp/Humidity", // sortKey: "hi", // disableSort: true, render: (device: Device) => { From 8a9d7af6ae3c1191a9a283d012be1dba43018348 Mon Sep 17 00:00:00 2001 From: csawatzky Date: Tue, 19 Aug 2025 15:34:47 -0600 Subject: [PATCH 4/8] adding temp oats to the grain describer to have a user test which is more accurate --- src/grain/GrainDescriber.ts | 38 +++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/src/grain/GrainDescriber.ts b/src/grain/GrainDescriber.ts index ce394b3..769826c 100644 --- a/src/grain/GrainDescriber.ts +++ b/src/grain/GrainDescriber.ts @@ -48,7 +48,7 @@ const defaultGrain: GrainExtension = { bushelsPerTonne: 0 }; -export const GrainExtensions: Map = new Map([ +export const GrainExtensions: Map = new Map([ [pond.Grain.GRAIN_INVALID, defaultGrain], [pond.Grain.GRAIN_NONE, defaultGrain], [ @@ -190,7 +190,7 @@ export const GrainExtensions: Map = new Map([ [ pond.Grain.GRAIN_OATS, { - name: "Oats", + name: "Oats a", group: "Oats", equation: Equation.henderson, a: 0.000085511, @@ -203,6 +203,40 @@ export const GrainExtensions: Map = new Map([ weightConversionKg: 15.4222988297197, bushelsPerTonne: 64.842 } + ], + [ + 29, + { + name: "Oats b", + group: "Oats", + equation: Equation.chungPfost, + a: 442.85, + b: 0.21228, + c: 35.803, + setTempC: 32.0, + targetMC: 13.6, + img: OatImg, + colour: "#79955a", + weightConversionKg: 15.4222988297197, + bushelsPerTonne: 64.842 + } + ], + [ + 30, + { + name: "Oats c", + group: "Oats", + equation: Equation.oswin, + a: 12.412, + b: -0.060707, + c: 2.9397, + setTempC: 32.0, + targetMC: 13.6, + img: OatImg, + colour: "#79955a", + weightConversionKg: 15.4222988297197, + bushelsPerTonne: 64.842 + } ], [ pond.Grain.GRAIN_PEANUTS, From e313fd10ae008d16322d8a1a904ccbb69151b6ba Mon Sep 17 00:00:00 2001 From: csawatzky Date: Tue, 19 Aug 2025 15:51:58 -0600 Subject: [PATCH 5/8] proto update for the test oats enum --- package-lock.json | 2 +- src/grain/GrainDescriber.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0e4f8f9..fe947bc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10911,7 +10911,7 @@ }, "node_modules/protobuf-ts": { "version": "1.0.0", - "resolved": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#0b7dd45fa720d6c3f20ac7bafac4a3f0bdbc7ab6", + "resolved": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#0cdf4d5e3038ef13318da0841886a7c9f0926f8d", "dependencies": { "protobufjs": "^6.8.8" } diff --git a/src/grain/GrainDescriber.ts b/src/grain/GrainDescriber.ts index 769826c..c140a85 100644 --- a/src/grain/GrainDescriber.ts +++ b/src/grain/GrainDescriber.ts @@ -48,7 +48,7 @@ const defaultGrain: GrainExtension = { bushelsPerTonne: 0 }; -export const GrainExtensions: Map = new Map([ +export const GrainExtensions: Map = new Map([ [pond.Grain.GRAIN_INVALID, defaultGrain], [pond.Grain.GRAIN_NONE, defaultGrain], [ @@ -205,7 +205,7 @@ export const GrainExtensions: Map = new Map } ], [ - 29, + pond.Grain.GRAIN_OATS_B, { name: "Oats b", group: "Oats", @@ -222,7 +222,7 @@ export const GrainExtensions: Map = new Map } ], [ - 30, + pond.Grain.GRAIN_OATS_C, { name: "Oats c", group: "Oats", From 27c69c3e553fc1acd8dc19fa680bc9affc16481a Mon Sep 17 00:00:00 2001 From: csawatzky Date: Fri, 22 Aug 2025 13:35:27 -0600 Subject: [PATCH 6/8] hotfix for the bin duplication in the bin actions of the bin page --- src/bin/BinActions.tsx | 6 ++-- src/bin/BinDuplication.tsx | 72 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+), 3 deletions(-) create mode 100644 src/bin/BinDuplication.tsx diff --git a/src/bin/BinActions.tsx b/src/bin/BinActions.tsx index 5f4d93a..a425ea6 100644 --- a/src/bin/BinActions.tsx +++ b/src/bin/BinActions.tsx @@ -24,7 +24,7 @@ import RemoveSelfFromObject from "user/RemoveSelfFromObject"; import ShareObject from "user/ShareObject"; import { isOffline } from "utils/environment"; import ObjectTeams from "teams/ObjectTeams"; -// import BinDuplication from "./BinDuplication"; +import BinDuplication from "./BinDuplication"; import BinsIcon from "products/Bindapt/BinsIcon"; import HelpIcon from "@mui/icons-material/Help"; import BinSensors from "./BinSensors"; @@ -269,14 +269,14 @@ export default function BinActions(props: Props) { closeDialogCallback={() => setOpenState({ ...openState, users: false })} refreshCallback={refreshCallback} /> - {/* { setOpenState({ ...openState, duplication: false }); }} bin={bin} refreshCallback={refreshCallback} - /> */} + /> void; + refreshCallback: () => void; +} + +export default function BinDuplication(props: Props) { + const { open, bin, closeDialog, refreshCallback } = props; + const [binDupName, setBinDupName] = useState("(copy of) " + bin.name()); + const binAPI = useBinAPI(); + const { openSnack } = useSnackbar(); + + useEffect(() => { + setBinDupName("(copy of) " + bin.name()); + }, [bin]); + + const duplicate = () => { + let settings = bin.settings; + settings.name = binDupName; + binAPI + .addBin(settings) + .then(resp => { + openSnack("Successfully duplicated bin"); + }) + .catch(err => { + openSnack("Failed to duplicate bin"); + }); + refreshCallback(); + closeDialog(); + }; + + return ( + + Create Duplicate Bin + + + This will create a new bin with the same settings as {bin.name()}. + + setBinDupName(e.target.value)} + /> + + + + + + + ); +} From f7df4d92d87f02dd231ff3d8bf33e79d63471c4b Mon Sep 17 00:00:00 2001 From: csawatzky Date: Fri, 29 Aug 2025 14:38:37 -0600 Subject: [PATCH 7/8] added new grain types, still need the equations --- package-lock.json | 4 +-- package.json | 2 +- src/grain/GrainDescriber.ts | 56 +++++++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index fe947bc..f2e6f62 100644 --- a/package-lock.json +++ b/package-lock.json @@ -42,7 +42,7 @@ "mui-tel-input": "^7.0.0", "notistack": "^3.0.1", "openweathermap-ts": "^1.2.10", - "protobuf-ts": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#master", + "protobuf-ts": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#rye_grain", "query-string": "^9.2.1", "react": "^18.3.1", "react-beautiful-dnd": "^13.1.1", @@ -10911,7 +10911,7 @@ }, "node_modules/protobuf-ts": { "version": "1.0.0", - "resolved": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#0cdf4d5e3038ef13318da0841886a7c9f0926f8d", + "resolved": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#12d326bad4609ab58cb59126527a7f2ccde0546d", "dependencies": { "protobufjs": "^6.8.8" } diff --git a/package.json b/package.json index ee0e9b7..320b8f2 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "mui-tel-input": "^7.0.0", "notistack": "^3.0.1", "openweathermap-ts": "^1.2.10", - "protobuf-ts": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#master", + "protobuf-ts": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#rye_grain", "query-string": "^9.2.1", "react": "^18.3.1", "react-beautiful-dnd": "^13.1.1", diff --git a/src/grain/GrainDescriber.ts b/src/grain/GrainDescriber.ts index c140a85..9138f50 100644 --- a/src/grain/GrainDescriber.ts +++ b/src/grain/GrainDescriber.ts @@ -539,6 +539,62 @@ export const GrainExtensions: Map = new Map([ colour: "grey", weightConversionKg: 27.2155, bushelsPerTonne: 36.744 + }, + pond.Grain.GRAIN_RYE_A, + { + name: "Rye a", + group: "Rye", + equation: , + a: 0.00006343, + b: 2.2060, + c: 13.1810, + setTempC: defaultSetTemp, + targetMC: 15.0, + colour: "grey", + weightConversionKg: 25.4, + bushelsPerTonne: 39.368 + }, + pond.Grain.GRAIN_RYE_B, + { + name: "Rye b", + group: "Rye", + equation: , + a: 461.0230, + b: 0.1840, + c: 36.7410, + setTempC: defaultSetTemp, + targetMC: 15.0, + colour: "grey", + weightConversionKg: 25.4, + bushelsPerTonne: 39.368 + }, + pond.Grain.GRAIN_RYE_C, + { + name: "Rye c", + group: "Rye", + equation: , + a: 4.2970, + b: 0.380, + c: 2.2710, + setTempC: defaultSetTemp, + targetMC: 15.0, + colour: "grey", + weightConversionKg: 25.4, + bushelsPerTonne: 39.368 + }, + pond.Grain.GRAIN_RYE_D, + { + name: "Rye d", + group: "Rye", + equation: , + a: 11.8870, + b: 0.0210, + c: 3.2620, + setTempC: defaultSetTemp, + targetMC: 15.0, + colour: "grey", + weightConversionKg: 25.4, + bushelsPerTonne: 39.368 } ] ]); From 8bcb2bf60c61afd5ff4f8270d57ebdfd63023585 Mon Sep 17 00:00:00 2001 From: csawatzky Date: Tue, 2 Sep 2025 09:22:16 -0600 Subject: [PATCH 8/8] added rye, one for each equation to determine the most accurate --- src/grain/GrainDescriber.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/grain/GrainDescriber.ts b/src/grain/GrainDescriber.ts index 9138f50..3c5bceb 100644 --- a/src/grain/GrainDescriber.ts +++ b/src/grain/GrainDescriber.ts @@ -539,12 +539,13 @@ export const GrainExtensions: Map = new Map([ colour: "grey", weightConversionKg: 27.2155, bushelsPerTonne: 36.744 - }, + } + ],[ pond.Grain.GRAIN_RYE_A, { name: "Rye a", group: "Rye", - equation: , + equation: Equation.henderson, a: 0.00006343, b: 2.2060, c: 13.1810, @@ -553,12 +554,13 @@ export const GrainExtensions: Map = new Map([ colour: "grey", weightConversionKg: 25.4, bushelsPerTonne: 39.368 - }, + } + ],[ pond.Grain.GRAIN_RYE_B, { name: "Rye b", group: "Rye", - equation: , + equation: Equation.chungPfost, a: 461.0230, b: 0.1840, c: 36.7410, @@ -568,11 +570,12 @@ export const GrainExtensions: Map = new Map([ weightConversionKg: 25.4, bushelsPerTonne: 39.368 }, + ],[ pond.Grain.GRAIN_RYE_C, { name: "Rye c", group: "Rye", - equation: , + equation: Equation.halsey, a: 4.2970, b: 0.380, c: 2.2710, @@ -582,11 +585,12 @@ export const GrainExtensions: Map = new Map([ weightConversionKg: 25.4, bushelsPerTonne: 39.368 }, + ],[ pond.Grain.GRAIN_RYE_D, { name: "Rye d", group: "Rye", - equation: , + equation: Equation.oswin, a: 11.8870, b: 0.0210, c: 3.2620,