cables now start at the top of the sidewall and dont go into the roof, added skeletons to the bin page for when it is loading, also fixed an issue with the camera being very zoomed in sometimes when the page loads
This commit is contained in:
parent
f6de509561
commit
87382dd5d8
6 changed files with 27 additions and 11 deletions
|
|
@ -172,7 +172,8 @@ export function BuildCableData(bin: Bin, dims: BinDims): CableData[] {
|
|||
distributed.forEach(orbit => {
|
||||
const count = orbit.assignedCount ?? 0;
|
||||
|
||||
const topY = getTopY(orbit.radius, dims);
|
||||
// const topY = getTopY(orbit.radius, dims); //this is if we want the cables to start at the roof
|
||||
const topY = dims.sidewallHeight/2 //this will start the cables at the top of the sidewall
|
||||
const bottomY = getBottomY(orbit.radius, dims);
|
||||
|
||||
if (orbit.orbit === 0 && count > 0) {
|
||||
|
|
|
|||
|
|
@ -70,7 +70,8 @@ export default function Bin3dView(props: Props) {
|
|||
const diameter = dims.diameter / scale;
|
||||
const largestDim = Math.max(totalHeight, diameter);
|
||||
const fovRad = (75 * Math.PI) / 180;
|
||||
const padding = 1.3; // 30% breathing room
|
||||
// const padding = 1.3; // 30% breathing room
|
||||
const padding = 1.3 + (largestDim / 100) * 2; //more dynamic breathing room based on the bin size
|
||||
return (largestDim / (2 * Math.tan(fovRad / 2))) * padding;
|
||||
}, [dims, scale]);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { Box, Card, DialogContent, DialogTitle, Grid2, IconButton, LinearProgress, Slider, Switch, Tooltip, Typography } from "@mui/material";
|
||||
import { Box, Card, DialogContent, DialogTitle, Grid2, IconButton, LinearProgress, Skeleton, Slider, Switch, Tooltip, Typography } from "@mui/material";
|
||||
import { useMobile } from "hooks";
|
||||
import { Bin, Component, Device } from "models";
|
||||
import Bin3dVisualizer from "../bin3dVisualizer";
|
||||
|
|
@ -23,6 +23,7 @@ import BinPlayer from "bin/BinPlayer";
|
|||
|
||||
interface Props {
|
||||
bin: Bin
|
||||
loading?: boolean,
|
||||
devices: Device[]
|
||||
cables?: GrainCable[]
|
||||
plenums?: Plenum[]
|
||||
|
|
@ -40,7 +41,7 @@ interface Props {
|
|||
|
||||
}
|
||||
export default function BinSummary(props: Props){
|
||||
const {bin, devices, fans, heaters, permissions, componentDevices, componentMap, binPrefs, updateBinCallback, cables = [], plenums = [], setPreferences, setBin} = props
|
||||
const {bin, loading, devices, fans, heaters, permissions, componentDevices, componentMap, binPrefs, updateBinCallback, cables = [], plenums = [], setPreferences, setBin} = props
|
||||
//const [currentDevice, setCurrentDevice] = useState<Device | undefined>(undefined)
|
||||
const isMobile = useMobile()
|
||||
const [openGrainDialog, setOpenGrainDialog] = useState(false)
|
||||
|
|
@ -387,9 +388,12 @@ export default function BinSummary(props: Props){
|
|||
}}
|
||||
/>
|
||||
<ChangeGrainDialog bin={bin} open={openGrainDialog} closeDialog={()=>setOpenGrainDialog(false)} permissions={permissions} updateBin={updateBinCallback}/>
|
||||
{isMobile ? inventorySummaryMobile() : inventorySummaryDesktop()}
|
||||
{loading ? <Skeleton variant="rectangular" height={100} sx={{marginBottom: 2}} /> : isMobile ? inventorySummaryMobile() : inventorySummaryDesktop()}
|
||||
<Grid2 container spacing={2}>
|
||||
<Grid2 size={isMobile ? 12 : 7}>
|
||||
{loading ?
|
||||
<Skeleton variant="rectangular" height={600}/>
|
||||
:
|
||||
<Card raised sx={{height: 600, position: "relative"}}>
|
||||
<Bin3dVisualizer
|
||||
bin={bin}
|
||||
|
|
@ -409,8 +413,12 @@ export default function BinSummary(props: Props){
|
|||
</Box>
|
||||
}
|
||||
</Card>
|
||||
}
|
||||
</Grid2>
|
||||
<Grid2 size={isMobile ? 12 : 5}>
|
||||
{loading ?
|
||||
<Skeleton variant="rectangular" height={600}/>
|
||||
:
|
||||
<Card raised sx={{ height: 600, display: "flex", flexDirection: "column", overflow: "hidden" }}>
|
||||
<BinDetails
|
||||
bin={bin}
|
||||
|
|
@ -422,11 +430,17 @@ export default function BinSummary(props: Props){
|
|||
cables={cables}
|
||||
plenums={plenums}/>
|
||||
</Card>
|
||||
}
|
||||
</Grid2>
|
||||
<Grid2 size={12}>
|
||||
{loading ?
|
||||
<Skeleton variant="rectangular" height={250}/>
|
||||
:
|
||||
<Card>
|
||||
<BinSensorsDisplay components={componentMap} bin={bin} preferences={binPrefs} setPreferences={setPreferences} componentDevices={componentDevices}/>
|
||||
<BinSensorsDisplay components={componentMap} bin={bin} preferences={binPrefs} setPreferences={setPreferences} componentDevices={componentDevices}/>
|
||||
</Card>
|
||||
}
|
||||
|
||||
</Grid2>
|
||||
</Grid2>
|
||||
</Box>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue