From d2c5eeffe27c9b95eaf50b7ef597dae6c21dff11 Mon Sep 17 00:00:00 2001 From: csawatzky Date: Wed, 12 Nov 2025 11:41:16 -0600 Subject: [PATCH 1/4] added a way to set the distance between the the peak and the lidar to be able to adjust the height for the inventory calc --- package-lock.json | 4 ++-- package.json | 2 +- src/bin/BinSettings.tsx | 34 +++++++++++++++++++++++++++++++--- 3 files changed, 34 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index d11bc29..6adfcdf 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#staging", + "protobuf-ts": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#lidar_drop", "query-string": "^9.2.1", "react": "^18.3.1", "react-beautiful-dnd": "^13.1.1", @@ -10953,7 +10953,7 @@ }, "node_modules/protobuf-ts": { "version": "1.0.0", - "resolved": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#31866a5a4ebad3770b82f4687bec2fd4c3b8417e", + "resolved": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#da2221770fac37af65ec218c8417b59757e5bc97", "dependencies": { "protobufjs": "^6.8.8" } diff --git a/package.json b/package.json index ee0e9b7..cd87138 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#lidar_drop", "query-string": "^9.2.1", "react": "^18.3.1", "react-beautiful-dnd": "^13.1.1", diff --git a/src/bin/BinSettings.tsx b/src/bin/BinSettings.tsx index c65bd31..cc5d3bf 100644 --- a/src/bin/BinSettings.tsx +++ b/src/bin/BinSettings.tsx @@ -183,7 +183,8 @@ export default function BinSettings(props: Props) { const [inMoistureString, setInMoistureString] = useState("0"); const [tMoistureString, setTMoistureString] = useState("0"); const [moistureTargetDeviation, setMoistureTargetDeviation] = useState("0"); - const [autoFillThreshold, setAutoFillThreshold] = useState(0); + const [autoFillThreshold, setAutoFillThreshold] = useState(5); + const [lidarDropDistance, setLidarDropDistance] = useState(0); const [validInitial, setValidInitial] = useState(true); const [validTarget, setValidTarget] = useState(true); const [validDeviation, setValidDeviation] = useState(true); @@ -217,7 +218,7 @@ export default function BinSettings(props: Props) { : { ...{ specs: pond.BinSpecs.create({ shape: pond.BinShape.BIN_SHAPE_FLAT_BOTTOM }), - inventory: pond.BinInventory.create({ grainBushels: 0, targetTemperature: 15 }), + inventory: pond.BinInventory.create({ grainBushels: 0, targetTemperature: 15, autoThreshold: 5 }), highTemp: 20, lowTemp: 10 } @@ -315,7 +316,12 @@ export default function BinSettings(props: Props) { setInMoistureString(initForm.inventory?.initialMoisture.toString() ?? "0"); setTMoistureString(initForm.inventory?.targetMoisture.toString() ?? "0"); setMoistureTargetDeviation(initForm.inventory?.moistureTargetDeviation.toString() ?? "0"); - setAutoFillThreshold(initForm.inventory?.autoThreshold ?? 0) + setAutoFillThreshold(initForm.inventory?.autoThreshold ?? 5) + let dropDistance = initForm.inventory?.lidarDropCm ?? 0 + if(getDistanceUnit() === pond.DistanceUnit.DISTANCE_UNIT_FEET){ + dropDistance = Math.round((dropDistance/30.48)*100)/100 + } + setLidarDropDistance(dropDistance) setActiveStep(0); if (bin) { setAutoTopNode(bin.settings.autoGrainNode); @@ -437,6 +443,7 @@ export default function BinSettings(props: Props) { if (form.inventory) { form.inventory.inventoryControl = inventoryControl form.inventory.autoThreshold = autoFillThreshold + form.inventory.lidarDropCm = getDistanceUnit() === pond.DistanceUnit.DISTANCE_UNIT_FEET ? lidarDropDistance * 30.48 : lidarDropDistance } binAPI @@ -484,6 +491,8 @@ export default function BinSettings(props: Props) { if (form.inventory) { form.inventory.inventoryControl = inventoryControl form.inventory.autoThreshold = autoFillThreshold + //if the users preferences are in feet convert the distance to cm otherwise it was entered as cm so use that + form.inventory.lidarDropCm = getDistanceUnit() === pond.DistanceUnit.DISTANCE_UNIT_FEET ? lidarDropDistance * 30.48 : lidarDropDistance } console.log(form) binAPI @@ -947,6 +956,25 @@ export default function BinSettings(props: Props) { setAutoFillThreshold(+e.target.value) }} /> + + {getDistanceUnit() === pond.DistanceUnit.DISTANCE_UNIT_FEET ? "ft" : "cm"} + + ) + }} + value={lidarDropDistance} + onChange={e => { + setLidarDropDistance(+e.target.value) + }} + /> } {inventoryControl === pond.BinInventoryControl.BIN_INVENTORY_CONTROL_LIBRACART && From eb3617bfba0261319c6260ffe6f0023e139743cb Mon Sep 17 00:00:00 2001 From: csawatzky Date: Wed, 12 Nov 2025 12:10:58 -0600 Subject: [PATCH 2/4] proto update --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6adfcdf..5fda53a 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#lidar_drop", + "protobuf-ts": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#staging", "query-string": "^9.2.1", "react": "^18.3.1", "react-beautiful-dnd": "^13.1.1", @@ -10953,7 +10953,7 @@ }, "node_modules/protobuf-ts": { "version": "1.0.0", - "resolved": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#da2221770fac37af65ec218c8417b59757e5bc97", + "resolved": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#900cb83a502288a8e3115657c064520c3c9ab967", "dependencies": { "protobufjs": "^6.8.8" } diff --git a/package.json b/package.json index cd87138..fc7a1ac 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#lidar_drop", + "protobuf-ts": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#staging", "query-string": "^9.2.1", "react": "^18.3.1", "react-beautiful-dnd": "^13.1.1", From 37d87d062a199c873e5047f4a57a0141df53cf75 Mon Sep 17 00:00:00 2001 From: csawatzky Date: Mon, 17 Nov 2025 11:59:30 -0600 Subject: [PATCH 3/4] added the new corn types for the other equations, also renamed the other oats and rye to include the equation names --- package-lock.json | 2 +- package.json | 2 +- src/grain/GrainDescriber.ts | 50 +++++++++++++++++++++++++++++++------ 3 files changed, 44 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index d11bc29..7821ac8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10953,7 +10953,7 @@ }, "node_modules/protobuf-ts": { "version": "1.0.0", - "resolved": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#31866a5a4ebad3770b82f4687bec2fd4c3b8417e", + "resolved": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#da863c196ce4fc03beab6099752bbda67d203274", "dependencies": { "protobufjs": "^6.8.8" } diff --git a/package.json b/package.json index ee0e9b7..fc7a1ac 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#staging", "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 3c5bceb..5698cb7 100644 --- a/src/grain/GrainDescriber.ts +++ b/src/grain/GrainDescriber.ts @@ -139,7 +139,7 @@ export const GrainExtensions: Map = new Map([ [ pond.Grain.GRAIN_CORN, { - name: "Corn", + name: "Corn (Henderson)", group: "Corn", equation: Equation.henderson, a: 0.000066612, @@ -153,6 +153,40 @@ export const GrainExtensions: Map = new Map([ bushelsPerTonne: 39.368 } ], + [ + pond.Grain.GRAIN_CORN_B, + { + name: "Corn (Chung-Pfost)", + group: "Corn", + equation: Equation.chungPfost, + a: 374.34, + b: 0.18662, + c: 31.696, + setTempC: 38.0, + targetMC: 15.6, + img: CornImg, + colour: "#ffef62", + weightConversionKg: 25.4014333665971, + bushelsPerTonne: 39.368 + } + ], + [ + pond.Grain.GRAIN_CORN_C, + { + name: "Corn (Oswin)", + group: "Corn", + equation: Equation.oswin, + a: 15.303, + b: -0.10164, + c: 3.0358, + setTempC: 38.0, + targetMC: 15.6, + img: CornImg, + colour: "#ffef62", + weightConversionKg: 25.4014333665971, + bushelsPerTonne: 39.368 + } + ], [ pond.Grain.GRAIN_MAIZE_WHITE, { @@ -190,7 +224,7 @@ export const GrainExtensions: Map = new Map([ [ pond.Grain.GRAIN_OATS, { - name: "Oats a", + name: "Oats (Henderson)", group: "Oats", equation: Equation.henderson, a: 0.000085511, @@ -207,7 +241,7 @@ export const GrainExtensions: Map = new Map([ [ pond.Grain.GRAIN_OATS_B, { - name: "Oats b", + name: "Oats (Chung-Pfost)", group: "Oats", equation: Equation.chungPfost, a: 442.85, @@ -224,7 +258,7 @@ export const GrainExtensions: Map = new Map([ [ pond.Grain.GRAIN_OATS_C, { - name: "Oats c", + name: "Oats (Oswin)", group: "Oats", equation: Equation.oswin, a: 12.412, @@ -543,7 +577,7 @@ export const GrainExtensions: Map = new Map([ ],[ pond.Grain.GRAIN_RYE_A, { - name: "Rye a", + name: "Rye (Henderson)", group: "Rye", equation: Equation.henderson, a: 0.00006343, @@ -558,7 +592,7 @@ export const GrainExtensions: Map = new Map([ ],[ pond.Grain.GRAIN_RYE_B, { - name: "Rye b", + name: "Rye (Chung-Pfost)", group: "Rye", equation: Equation.chungPfost, a: 461.0230, @@ -573,7 +607,7 @@ export const GrainExtensions: Map = new Map([ ],[ pond.Grain.GRAIN_RYE_C, { - name: "Rye c", + name: "Rye (Halsey)", group: "Rye", equation: Equation.halsey, a: 4.2970, @@ -588,7 +622,7 @@ export const GrainExtensions: Map = new Map([ ],[ pond.Grain.GRAIN_RYE_D, { - name: "Rye d", + name: "Rye (Oswin)", group: "Rye", equation: Equation.oswin, a: 11.8870, From 79c29f6f8121fac170ff39fe80b9dbb8979856e8 Mon Sep 17 00:00:00 2001 From: csawatzky Date: Thu, 20 Nov 2025 11:07:14 -0600 Subject: [PATCH 4/4] increasing the limit for conditions on devices running 2.1.9 to 4, and changing the button logic for adding and removing them --- src/interactions/InteractionSettings.tsx | 43 +++++++++++------------- src/models/Device.ts | 12 +++++++ 2 files changed, 32 insertions(+), 23 deletions(-) diff --git a/src/interactions/InteractionSettings.tsx b/src/interactions/InteractionSettings.tsx index 40b9132..2519669 100644 --- a/src/interactions/InteractionSettings.tsx +++ b/src/interactions/InteractionSettings.tsx @@ -957,29 +957,16 @@ export default function InteractionSettings(props: Props) { - {index === 0 ? ( - - 1 || !canEdit} - aria-label="Add another condition" - onClick={addCondition} - className={classNames(classes.greenButton, classes.noPadding)}> - - - - ) : ( - - removeCondition(index)} - className={classNames(classes.redButton, classes.noPadding)}> - - - - )} + + removeCondition(index)} + className={classNames(classes.redButton, classes.noPadding)}> + + + {multiNodeSource() && !sensor && ( @@ -1076,6 +1063,16 @@ export default function InteractionSettings(props: Props) { ) : ( You must select a source before adding conditions )} + + = device.maxConditions() || !canEdit} + aria-label="Add another condition" + onClick={addCondition} + className={classNames(classes.greenButton, classes.noPadding)}> + + + ); }; diff --git a/src/models/Device.ts b/src/models/Device.ts index de372ce..2577618 100644 --- a/src/models/Device.ts +++ b/src/models/Device.ts @@ -154,6 +154,18 @@ export class Device { } } + public maxConditions(): number { + let max = 2 + switch (this.settings.platform) { + case pond.DevicePlatform.DEVICE_PLATFORM_V2_CELLULAR_BLACK: + case pond.DevicePlatform.DEVICE_PLATFORM_V2_WIFI_BLUE: + case pond.DevicePlatform.DEVICE_PLATFORM_V2_CELLULAR_BLUE: + case pond.DevicePlatform.DEVICE_PLATFORM_V2_ETHERNET_BLUE: + max = this.status.firmwareVersion >= "2.1.9" ? 4 : 2; + } + return max + } + public featureSupported(feature: string): boolean { let versions = featureVersions.get(feature); if (!versions) {