feat: Integrate upsertProductOrEventApi in Simulations and Products components; adjust loadInitialFloorItems to accept renderDistance parameter; update material handling in addAssetModel and Vehicles components

This commit is contained in:
2025-04-25 18:29:01 +05:30
parent d7a22f5bfb
commit 81b353307b
10 changed files with 34 additions and 24 deletions

View File

@@ -2,6 +2,8 @@ import React, { useEffect } from 'react'
import { useProductStore } from '../../../store/simulation/useProductStore'
import * as THREE from 'three';
import { useSelectedProduct } from '../../../store/simulation/useSimulationStore';
import { upsertProductOrEventApi } from '../../../services/simulation/UpsertProductOrEventApi';
import { getAllProductsApi } from '../../../services/simulation/getallProductsApi';
function Products() {
const { products, addProduct } = useProductStore();
@@ -12,10 +14,22 @@ function Products() {
const id = THREE.MathUtils.generateUUID();
const name = 'Product 1';
addProduct(name, id);
// upsertProductOrEventApi({ productName: name, productId: id }).then((data) => {
// console.log('data: ', data);
// });
setSelectedProduct(id, name);
}
}, [products])
useEffect(() => {
// const email = localStorage.getItem('email')
// const organization = (email!.split("@")[1]).split(".")[0];
// console.log(organization);
// getAllProductsApi(organization).then((data) => {
// console.log('data: ', data);
// })
}, [])
return (
<>
</>

View File

@@ -5,7 +5,6 @@ import { useArmBotStore } from '../../../../store/simulation/useArmBotStore';
function RoboticArmInstances() {
const { armBots } = useArmBotStore();
return (
<>

View File

@@ -3,15 +3,11 @@ import RoboticArmInstances from "./instances/roboticArmInstances";
import { useArmBotStore } from "../../../store/simulation/useArmBotStore";
function RoboticArm() {
const { armBots, addArmBot, addCurrentAction } = useArmBotStore();
const { armBots, addArmBot, removeArmBot, addCurrentAction } = useArmBotStore();
const armBotStatusSample: RoboticArmEventSchema[] = [
{
state: "idle",
// currentAction: {
// actionUuid: "action-001",
// actionName: "Pick Component",
// },
modelUuid: "armbot-xyz-001",
modelName: "ArmBot-X200",
position: [0, 0, 0],
@@ -80,6 +76,7 @@ function RoboticArm() {
];
useEffect(() => {
removeArmBot(armBotStatusSample[0].modelUuid);
addArmBot('123', armBotStatusSample[0]);
// addCurrentAction('armbot-xyz-001', 'action-001');
}, []);
@@ -94,8 +91,6 @@ function RoboticArm() {
<RoboticArmInstances />
<></>
</>
);
}

View File

@@ -24,7 +24,6 @@ function Vehicles() {
actionUuid: "action-456",
actionName: "Deliver to Zone A",
actionType: "travel",
material: "crate",
unLoadDuration: 15,
loadCapacity: 5,
pickUpPoint: { x: 5, y: 0, z: 3 },
@@ -68,7 +67,6 @@ function Vehicles() {
actionUuid: "action-456",
actionName: "Deliver to Zone A",
actionType: "travel",
material: "crate",
unLoadDuration: 15,
loadCapacity: 5,
pickUpPoint: { x: 5, y: 0, z: 3 },