diff --git a/src/bin/BinVisualizerV2.tsx b/src/bin/BinVisualizerV2.tsx index 37ed664..2da6f78 100644 --- a/src/bin/BinVisualizerV2.tsx +++ b/src/bin/BinVisualizerV2.tsx @@ -290,11 +290,7 @@ export default function BinVisualizer(props: Props) { const [modeChangeInProgress, setModeChangeInProgress] = useState(false) const [newGrainSettings, setNewGrainSettings] = useState() - const componentAPI = useComponentAPI() - const [openControllerDIalog, setOpenControllerDialog] = useState(false) - const [controllerOutputStates, setControllerOutputStates] = useState>(new Map()) - const [selectedController, setSelectedController] = useState() - const [newOutputState, setNewOutputState] = useState() + const [filteredComponents, setFilteredComponents] = useState([]) useEffect(() => { setModeTime(moment(bin.status.lastModeChange)); @@ -1420,13 +1416,21 @@ export default function BinVisualizer(props: Props) { coldestNodeTemp={valueDisplay === "low" ? lowNodeConditions?.tempC : undefined} cableNodeClicked={(cable, fillNode) => { if (cable) { - let devId = componentDevices?.get(cable.key()); + let devId = componentDevices.get(cable.key()); if (devId) { let device = devMap.get(devId); if (device) { setSelectedCable(cable); setSelectedNode(fillNode); setCableDevice(device); + //need to set the filtered components so that components on other devices do not show up as options in interaction settings + let filtered: Component[] = [] + components.forEach((component, key) => { + if(componentDevices.get(key) === devId){ + filtered.push(component) + } + }) + setFilteredComponents(filtered) setOpenNodeDialog(true); } } @@ -1556,7 +1560,7 @@ export default function BinVisualizer(props: Props) { let device = componentDevices.get(fan.key) if(fanComp && device){ return ( - + ) } })} @@ -2075,7 +2079,7 @@ export default function BinVisualizer(props: Props) { {selectedCable && cableDevice && (