From ec4d3db70e6a9e7ab80f914090624090ff0cc47f Mon Sep 17 00:00:00 2001 From: Poovizhi99 Date: Mon, 5 May 2025 12:20:55 +0530 Subject: [PATCH] added machine actions --- .../ui/simulation/simulationPlayer.tsx | 26 +++++--- .../simulation/actions/useActionHandler.ts | 32 +++++----- .../instances/animator/machineAnimator.tsx | 62 +++++++++---------- .../machineInstance/machineInstance.tsx | 6 +- .../simulation/simulator/simulator.tsx | 2 +- 5 files changed, 66 insertions(+), 62 deletions(-) diff --git a/app/src/components/ui/simulation/simulationPlayer.tsx b/app/src/components/ui/simulation/simulationPlayer.tsx index 2d9d4e3..fd9f418 100644 --- a/app/src/components/ui/simulation/simulationPlayer.tsx +++ b/app/src/components/ui/simulation/simulationPlayer.tsx @@ -38,10 +38,18 @@ const SimulationPlayer: React.FC = () => { const { isReset, setReset } = useResetButtonStore(); const { subModule } = useSubModuleStore(); + useEffect(() => { + if (isReset) { + setTimeout(() => { + setReset(false); + }, 0) + } + }, [isReset]) + // Button functions const handleReset = () => { - setReset(!isReset); - setSpeed(1); + setReset(true); + // setSpeed(1); }; const handlePlayStop = () => { setIsPaused(!isPaused); @@ -271,11 +279,10 @@ const SimulationPlayer: React.FC = () => { {index < intervals.length - 1 && (
= ((index + 1) / totalSegments) * 100 - ? "filled" - : "" - }`} + className={`line ${progress >= ((index + 1) / totalSegments) * 100 + ? "filled" + : "" + }`} >
)} @@ -314,9 +321,8 @@ const SimulationPlayer: React.FC = () => {