new human event mangaer

This commit is contained in:
2025-07-22 16:33:33 +05:30
parent 88361b1623
commit 708c8a4ba1
19 changed files with 1355 additions and 992 deletions

View File

@@ -1,24 +1,24 @@
import { useEffect } from 'react'
import { useResetButtonStore } from '../../../../../store/usePlayButtonStore';
import { useFrame } from '@react-three/fiber'
import { useSceneContext } from '../../../../scene/sceneContext';
import { useProductContext } from '../../../products/productContext';
// import { findConveyorSubsequence } from '../../../simulator/functions/getConveyorSequencesInProduct';
function ConveyorInstance({ conveyor }: { readonly conveyor: ConveyorStatus }) {
const { materialStore, conveyorStore, productStore } = useSceneContext();
const { getProductById } = productStore();
const { selectedProductStore } = useProductContext();
const { selectedProduct } = selectedProductStore();
const { getMaterialsByCurrentModelUuid, materials } = materialStore();
const { isReset } = useResetButtonStore();
const { getMaterialsByCurrentModelUuid } = materialStore();
const { setConveyorPaused } = conveyorStore();
useEffect(() => {
useFrame(() => {
const product = getProductById(selectedProduct.productUuid);
if (!product) return;
const conveyorMaterials = getMaterialsByCurrentModelUuid(conveyor.modelUuid);
if (conveyorMaterials && conveyorMaterials?.length > 0) {
if (conveyorMaterials && conveyorMaterials.length > 0) {
const hasPausedMaterials = conveyorMaterials.some(material => material.isPaused);
@@ -52,7 +52,7 @@ function ConveyorInstance({ conveyor }: { readonly conveyor: ConveyorStatus }) {
// }
// });
}, [materials, conveyor.modelUuid, getMaterialsByCurrentModelUuid, setConveyorPaused, isReset, selectedProduct.productUuid, getProductById]);
});
useEffect(() => {
// console.log('conveyor: ', conveyor);
@@ -61,7 +61,7 @@ function ConveyorInstance({ conveyor }: { readonly conveyor: ConveyorStatus }) {
return (
<>
</>
)
};
);
}
export default ConveyorInstance