Files
Dwinzo_dev/app/src/modules/simulation/simulation.tsx

53 lines
1.5 KiB
TypeScript
Raw Normal View History

2025-04-02 19:12:14 +05:30
import { useState, useEffect, useRef, useMemo } from "react";
import {
useSelectedActionSphere,
useSelectedPath,
useSimulationPaths,
} from "../../store/store";
import * as THREE from "three";
import Behaviour from "./behaviour/behaviour";
import PathCreation from "./path/pathCreation";
import PathConnector from "./path/pathConnector";
import useModuleStore from "../../store/useModuleStore";
import ProcessContainer from "./process/processContainer";
import Agv from "../builder/agv/agv";
2025-03-25 17:34:20 +05:30
function Simulation() {
2025-04-02 19:12:14 +05:30
const { activeModule } = useModuleStore();
const pathsGroupRef = useRef() as React.MutableRefObject<THREE.Group>;
const { simulationPaths, setSimulationPaths } = useSimulationPaths();
const [processes, setProcesses] = useState([]);
2025-03-25 17:34:20 +05:30
2025-04-02 19:12:14 +05:30
useEffect(() => {
// console.log('simulationPaths: ', simulationPaths);
2025-04-02 19:12:14 +05:30
}, [simulationPaths]);
2025-03-25 17:34:20 +05:30
2025-04-02 19:12:14 +05:30
// useEffect(() => {
// if (selectedActionSphere) {
// console.log('selectedActionSphere: ', selectedActionSphere);
// }
// }, [selectedActionSphere]);
2025-03-25 17:34:20 +05:30
2025-04-02 19:12:14 +05:30
// useEffect(() => {
// if (selectedPath) {
// console.log('selectedPath: ', selectedPath);
// }
// }, [selectedPath]);
2025-03-25 17:34:20 +05:30
2025-04-02 19:12:14 +05:30
return (
<>
<Behaviour />
{activeModule === "simulation" && (
2025-03-25 17:34:20 +05:30
<>
2025-04-02 19:12:14 +05:30
<PathCreation pathsGroupRef={pathsGroupRef} />
<PathConnector pathsGroupRef={pathsGroupRef} />
<ProcessContainer />
{/* <Agv /> */}
2025-03-25 17:34:20 +05:30
</>
2025-04-02 19:12:14 +05:30
)}
</>
);
2025-03-25 17:34:20 +05:30
}
2025-04-02 19:12:14 +05:30
export default Simulation;