Refactor socket initialization to include organization and enhance asset event handling; remove unused console logs and improve asset data structure

This commit is contained in:
2025-03-31 19:38:23 +05:30
parent e54c9e6e0d
commit e3a85c81e5
12 changed files with 137 additions and 85 deletions

View File

@@ -2,22 +2,16 @@ import { useFloorItems, useSimulationPaths } from '../../../store/store';
import * as THREE from 'three';
import * as Types from '../../../types/world/worldTypes';
import { useEffect } from 'react';
import { getAssetEventType } from '../../../services/simulation/getAssetEventType';
function Behaviour() {
const { setSimulationPaths } = useSimulationPaths();
const { floorItems } = useFloorItems();
useEffect(() => {
const email = localStorage.getItem('email')
const organization = (email!.split("@")[1]).split(".")[0];
const newPaths: (Types.ConveyorEventsSchema | Types.VehicleEventsSchema)[] = [];
floorItems.forEach((item: Types.FloorItemType) => {
if (item.modelfileID === "672a090f80d91ac979f4d0bd") {
// getAssetEventType(item.modelfileID, organization).then((res) => {
// console.log('res: ', res);
// });
const point1Position = new THREE.Vector3(0, 0.85, 2.2);
const middlePointPosition = new THREE.Vector3(0, 0.85, 0);
const point2Position = new THREE.Vector3(0, 0.85, -2.2);