diff --git a/src/bin/3dView/Data/BuildNodeData.ts b/src/bin/3dView/Data/BuildNodeData.ts
index bf6fad3..4196820 100644
--- a/src/bin/3dView/Data/BuildNodeData.ts
+++ b/src/bin/3dView/Data/BuildNodeData.ts
@@ -12,6 +12,12 @@ export interface NodeData {
topNode?: boolean
excluded?: boolean
inGrain?: boolean
+ /**
+ * The vertical spacing between nodes on this cable (cm).
+ * Used by GrainCableFill to offset the grain surface half a spacing above the top node,
+ * matching the 2D bin view behaviour.
+ */
+ nodeSpacing: number
}
export function BuildNodeData(cables: CableData[]): NodeData[] {
@@ -31,23 +37,13 @@ export function BuildNodeData(cables: CableData[]): NodeData[] {
const spacing = height / nodeCount;
-
- grainCable.celcius.forEach((celcius,i) => {
-
+ grainCable.celcius.forEach((celcius, i) => {
+
const nodeY = bottomY + (i * spacing);
const humidity = grainCable.relativeHumidity[i] || undefined;
const moisture = grainCable.moisture[i] || undefined;
let t = celcius
- //this is for testing to force a single node to a specific temp
- // if (i === 0) {
- // t = -10
- // }
- // if (i === 1) {
- // t = 30
- // }
-
-
nodeData.push({
cableIndex: cableIndex,
@@ -57,13 +53,11 @@ export function BuildNodeData(cables: CableData[]): NodeData[] {
celcius: t,
humidity: humidity,
moisture: moisture,
- topNode: grainCable.topNode === i+1, //top node tracking starts at 1 not 0 so add one to the index
+ topNode: grainCable.topNode === i + 1,
excluded: grainCable.excludedNodes?.includes(i) ?? false,
- inGrain: i+1 <= grainCable.topNode
- // optional: (may want to add this to the node data later)
- // normalizedHeight: (nodeY - bottomY) / height
+ inGrain: i + 1 <= grainCable.topNode || !grainCable.topNode,
+ nodeSpacing: spacing,
})
-
})
})
diff --git a/src/bin/3dView/Scene/Bin3dView.tsx b/src/bin/3dView/Scene/Bin3dView.tsx
index 8c0c377..45fcdb6 100644
--- a/src/bin/3dView/Scene/Bin3dView.tsx
+++ b/src/bin/3dView/Scene/Bin3dView.tsx
@@ -8,8 +8,9 @@ import { Vector3 } from "three";
import { useMemo } from "react";
import { BuildCableData } from "../Data/BuildCableData";
import { BuildNodeData } from "../Data/BuildNodeData";
-import Heatmap from "../Systems/Heatmap/HeatMapAlpha";
import NodePointCloud from "../Systems/Heatmap/NodePointCloud";
+import { pond } from "protobuf-ts/pond";
+import GrainCableFill from "../Systems/Inventory/GrainCableFill";
interface Props {
/**
@@ -37,6 +38,29 @@ export default function Bin3dView(props: Props){
const cableData = useMemo(() => BuildCableData(bin), [bin]);
const nodeData = useMemo(() => BuildNodeData(cableData), [cableData]);
+ const grainInventory = () => {
+ if(bin.inventoryControl() === pond.BinInventoryControl.BIN_INVENTORY_CONTROL_AUTOMATIC ||
+ bin.inventoryControl() === pond.BinInventoryControl.BIN_INVENTORY_CONTROL_HYBRID_CABLE){
+ return (
+
+ )
+ }else if (fillPercent){
+
+ }
+ }
+
return (