From 29d9e7377ca6b37e5e55f2a425252567bd9d8ec3 Mon Sep 17 00:00:00 2001 From: csawatzky Date: Wed, 4 Mar 2026 12:51:10 -0600 Subject: [PATCH] working on US ton stuff --- package-lock.json | 2 +- src/bin/BinCardV2.tsx | 12 +- src/bin/BinSettings.tsx | 210 +++++++++++++++++--- src/bin/BinTransactions.tsx | 25 ++- src/bin/BinVisualizerV2.tsx | 46 +++-- src/bin/BinyardDisplay.tsx | 30 ++- src/bin/graphs/BinLevelOverTime.tsx | 25 ++- src/field/FieldSettings.tsx | 3 + src/grain/CustomGrainForm.tsx | 8 +- src/grain/GrainDescriber.ts | 109 ++++++---- src/grain/GrainTransaction.tsx | 47 ++++- src/grainBag/grainBagSettings.tsx | 1 + src/models/Bin.ts | 31 ++- src/pages/grainBag.tsx | 1 - src/providers/pond/grainBagAPI.tsx | 2 +- src/transactions/transactionDataDisplay.tsx | 1 + src/user/UserSettings.tsx | 10 +- src/utils/units.ts | 28 ++- 18 files changed, 474 insertions(+), 117 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2a91371..3c23e65 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11967,7 +11967,7 @@ }, "node_modules/protobuf-ts": { "version": "1.0.0", - "resolved": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#7649feaa2222b555fe15fe9e4a19244c23f0e442", + "resolved": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#8281f64aa2c8db09a73f5a2eb8a1b97a63bcc653", "dependencies": { "protobufjs": "^6.8.8" } diff --git a/src/bin/BinCardV2.tsx b/src/bin/BinCardV2.tsx index f39c553..f8fa5fb 100644 --- a/src/bin/BinCardV2.tsx +++ b/src/bin/BinCardV2.tsx @@ -443,14 +443,24 @@ export default function BinCard(props: Props) { " L" ); } - if (getGrainUnit() === pond.GrainUnit.GRAIN_UNIT_WEIGHT && bin.bushelsPerTonne() > 1) { + + if (getGrainUnit() === pond.GrainUnit.GRAIN_UNIT_TONNE && bin.bushelsPerTonne() > 1) { return ( bin.grainTonnes().toLocaleString() + " mT " + bin.fillPercent() + "%" ); + } else if (getGrainUnit() === pond.GrainUnit.GRAIN_UNIT_TON && bin.bushelsPerTon() > 1) { + return ( + bin.grainTons().toLocaleString() + + " t " + + bin.fillPercent() + + "%" + ); } + + return ( current.toLocaleString() + "/" + diff --git a/src/bin/BinSettings.tsx b/src/bin/BinSettings.tsx index 4192974..df9a6fe 100644 --- a/src/bin/BinSettings.tsx +++ b/src/bin/BinSettings.tsx @@ -126,14 +126,13 @@ interface BinFormExtension { hopperHeight: string; diameter: string; grainBushels: string; - grainTonnes: string; + grainWeight: string; grainType: Option | null; grainUse: Option | null; grainSubtype: string; customTypeName: string; highTemp: number; lowTemp: number; - bushelsPerTonne: string; tempTarget: number; } @@ -160,14 +159,13 @@ export default function BinSettings(props: Props) { hopperHeight: "", diameter: "", grainBushels: "", - grainTonnes: "", + grainWeight: "", grainType: null, grainUse: null, grainSubtype: "", customTypeName: "", highTemp: 20, lowTemp: 10, - bushelsPerTonne: "", tempTarget: 15 }); const [initialized, setInitialized] = useState(false); @@ -194,6 +192,7 @@ export default function BinSettings(props: Props) { const [isCustomBin, setIsCustomBin] = useState(false); const [binModelOps, setBinModelOptions] = useState([]); const [selectedBinModel, setSelectedBinModel] = useState