(null);
const [expand, setExpand] = useState(true);
- const [playSimulation, setPlaySimulation] = useState(false);
const { hidePlayer, setHidePlayer } = usePlayerStore();
const { speed, setSpeed } = useAnimationPlaySpeed();
@@ -40,6 +40,7 @@ const SimulationPlayer: React.FC = () => {
const { isPaused, setIsPaused } = usePauseButtonStore();
const { isReset, setReset } = useResetButtonStore();
const { subModule } = useSubModuleStore();
+ const { clearComparisonProduct } = useComparisonProduct();
useEffect(() => {
if (isReset) {
@@ -55,17 +56,15 @@ const SimulationPlayer: React.FC = () => {
setIsPaused(false);
setSpeed(1);
echo.info("Simulation RESET.....");
- setPlaySimulation(false); // local state reset
};
const handlePlayStop = () => {
setIsPaused(!isPaused);
echo.warn(`Simulation is ${isPaused ? "Resumed" : "Paused"}`);
- setPlaySimulation(!playSimulation);
};
const handleExit = () => {
- setPlaySimulation(false);
setIsPlaying(false);
setIsPaused(false);
+ clearComparisonProduct();
setActiveTool("cursor");
echo.info("Exit Simulation");
};
@@ -210,7 +209,7 @@ const SimulationPlayer: React.FC = () => {
{!hidePlayer && subModule !== "analysis" && (
- {playSimulation
+ {isPaused
? "Paused - system idle."
: "Running simulation..."}
@@ -237,7 +236,7 @@ const SimulationPlayer: React.FC = () => {
}}
>
- {playSimulation ? "Play" : "Stop"}
+ {isPaused ? "Play" : "Stop"}
)}