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

48 lines
1.4 KiB
TypeScript
Raw Normal View History

2025-04-02 19:12:14 +05:30
import { useState, useEffect, useRef, useMemo } from "react";
import {
useSelectedActionSphere,
useSelectedPath,
useSimulationStates,
2025-04-02 19:12:14 +05:30
} 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 { simulationStates, setSimulationStates } = useSimulationStates();
2025-04-10 10:21:24 +05:30
const [processes, setProcesses] = useState<any[]>([]);
const agvRef = useRef([]);
2025-04-10 17:46:11 +05:30
const MaterialRef = useRef([]);
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} />
2025-04-10 17:46:11 +05:30
<ProcessContainer
processes={processes}
setProcesses={setProcesses}
agvRef={agvRef}
MaterialRef={MaterialRef}
/>
<Agv
processes={processes}
agvRef={agvRef}
MaterialRef={MaterialRef}
/>
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;