made binTableView component, and am starting to average node levels
This commit is contained in:
parent
4b2c67dfd9
commit
325d3ea7a0
2 changed files with 39 additions and 1 deletions
|
|
@ -2,6 +2,7 @@ import { Box, Card, Grid2 } from "@mui/material";
|
||||||
import { useMobile } from "hooks";
|
import { useMobile } from "hooks";
|
||||||
import { Bin } from "models";
|
import { Bin } from "models";
|
||||||
import Bin3dVisualizer from "./components/bin3dVisualizer";
|
import Bin3dVisualizer from "./components/bin3dVisualizer";
|
||||||
|
import BinTableView from "./components/binTableView";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
bin: Bin
|
bin: Bin
|
||||||
|
|
@ -18,7 +19,7 @@ export default function BinSummary(props: Props){
|
||||||
|
|
||||||
const tableView = () => {
|
const tableView = () => {
|
||||||
return (
|
return (
|
||||||
<Box>table View</Box>
|
<BinTableView bin={bin}/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
37
src/bin/binSummary/components/binTableView.tsx
Normal file
37
src/bin/binSummary/components/binTableView.tsx
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
import { Box } from "@mui/material";
|
||||||
|
import { Bin } from "models";
|
||||||
|
import { useMemo } from "react";
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
bin: Bin
|
||||||
|
}
|
||||||
|
|
||||||
|
interface LevelAvg {
|
||||||
|
temp: number
|
||||||
|
moisture: number
|
||||||
|
inGrain: boolean
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export default function BinTableView(props: Props) {
|
||||||
|
const {bin} = props
|
||||||
|
|
||||||
|
const cableLevelAverages = useMemo(() => {
|
||||||
|
const cables = bin.status.grainCables
|
||||||
|
let levels: LevelAvg[] = []
|
||||||
|
console.log(cables)
|
||||||
|
//note for future self, the first item in the measurement arrays is the lowest node on the cable
|
||||||
|
//the zones we are creating here will match with the node number because most cables will either have the same number of nodes or only have a difference of 1 or 2
|
||||||
|
//example: cable 1 has 5 nodes cable 2 has 7 nodes, the first five nodes of the cables will match up and average together for each zone
|
||||||
|
//and then zones 6 and 7 will be made using only cable 2 because cable 1 doesn't have them
|
||||||
|
cables.forEach(cable => {
|
||||||
|
|
||||||
|
})
|
||||||
|
return levels
|
||||||
|
},[bin])
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Box>Table View</Box>
|
||||||
|
)
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue