From 06a742a52079bc5caffc339ec1a33a478d7d7723 Mon Sep 17 00:00:00 2001 From: Jerald-Golden-B Date: Sat, 20 Dec 2025 13:19:26 +0530 Subject: [PATCH] feat: add Simulation Dashboard Editor component and pillar jib crane instance file --- app/src/components/SimulationDashboard/DashboardEditor.tsx | 7 +++++++ .../crane/instances/instance/pillarJibInstance.tsx | 2 ++ 2 files changed, 9 insertions(+) diff --git a/app/src/components/SimulationDashboard/DashboardEditor.tsx b/app/src/components/SimulationDashboard/DashboardEditor.tsx index 970ed4e..b20296f 100644 --- a/app/src/components/SimulationDashboard/DashboardEditor.tsx +++ b/app/src/components/SimulationDashboard/DashboardEditor.tsx @@ -95,6 +95,13 @@ const DashboardEditor: React.FC = () => { const currentBlock = blocks.find((b) => b.blockUuid === selectedBlock); const currentElement = currentBlock?.elements.find((el) => el.elementUuid === selectedElement); + useEffect(()=>{ + if (!editMode) { + setSelectedBlock(null); + setSelectedElement(null); + } + },[editMode]) + // Helper function to send updates to backend - only sends the specific block that changed const updateBackend = async (updatedBlock: Block) => { if (!projectId || !selectedVersion) return; diff --git a/app/src/modules/simulation/crane/instances/instance/pillarJibInstance.tsx b/app/src/modules/simulation/crane/instances/instance/pillarJibInstance.tsx index e1da240..9c63eba 100644 --- a/app/src/modules/simulation/crane/instances/instance/pillarJibInstance.tsx +++ b/app/src/modules/simulation/crane/instances/instance/pillarJibInstance.tsx @@ -93,11 +93,13 @@ function PillarJibInstance({ crane }: { readonly crane: CraneStatus }) { if (!crane.isActive && crane.currentPhase === "init" && crane.currentMaterials.length > 0 && action.maxPickUpCount <= crane.currentMaterials.length) { setCurrentPhase(crane.modelUuid, "init-pickup"); + setCraneActive(crane.modelUuid, true); } else if (crane.currentPhase === "picking" && crane.currentMaterials.length > 0 && action.maxPickUpCount <= crane.currentMaterials.length && !crane.isCarrying) { if (humanAsset?.animationState?.current === "working_standing" && humanAsset?.animationState?.isCompleted && humanId && humanAction && humanAction.actionType === "operator") { setCurrentAnimation(humanId, "idle", true, true, true); setIsCaryying(crane.modelUuid, true); setCurrentPhase(crane.modelUuid, "pickup-drop"); + setCraneActive(crane.modelUuid, true); } else { setCurrentPhaseHuman(humanId, "hooking"); setHumanActive(humanId, true);