From 71eda6a3a84ddf210801f9dd25a4432c1c14e07c Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期三, 24 四月 2024 15:40:59 +0800
Subject: [PATCH] #

---
 src/config/setting.js    |    2 
 src/assets/data/shelf.js |   89 +++++++++++++++++++++++++++++++++++++++-----
 src/core/warehouse.jsx   |    4 -
 src/components/shelf.jsx |    4 -
 4 files changed, 82 insertions(+), 17 deletions(-)

diff --git a/src/assets/data/shelf.js b/src/assets/data/shelf.js
index 9896f71..2976170 100644
--- a/src/assets/data/shelf.js
+++ b/src/assets/data/shelf.js
@@ -1,41 +1,110 @@
 import * as Common from '@/utils/common';
 
 // row
+const shelfRowOffset = 1000;
+const realRowPos = [0 - shelfRowOffset, 0 + shelfRowOffset, 2420 - shelfRowOffset, 2420 + shelfRowOffset];
 
 // bay
 const realBayPos = [1589, 3540, 5491, 7442, 9393, 11344];
 
 const shelfData = [
+  // row 1 --------------------------------------------------------------------------
+  {
+    no: '1-1-1',
+    position: Common.calculateMappedPosition([realRowPos[0], 0, realBayPos[5]]),
+    rotationY: Math.PI / 2,
+  },
+  {
+    no: '1-4-1',
+    position: Common.calculateMappedPosition([realRowPos[0], 0, realBayPos[4]]),
+    rotationY: Math.PI / 2,
+  },
+  // {
+  //   no: '1-7-1',
+  //   position: Common.calculateMappedPosition([realRowPos[0], 0, realBayPos[3]]),
+  //   rotationY: Math.PI / 2,
+  // },
+  // {
+  //   no: '1-10-1',
+  //   position: Common.calculateMappedPosition([realRowPos[0], 0, realBayPos[2]]),
+  //   rotationY: Math.PI / 2,
+  // },
+  // {
+  //   no: '1-13-1',
+  //   position: Common.calculateMappedPosition([realRowPos[0], 0, realBayPos[1]]),
+  //   rotationY: Math.PI / 2,
+  // },
+  // {
+  //   no: '1-16-1',
+  //   position: Common.calculateMappedPosition([realRowPos[0], 0, realBayPos[0]]),
+  //   rotationY: Math.PI / 2,
+  // },
+
+  // row 2 --------------------------------------------------------------------------
+  {
+    no: '2-1-1',
+    position: Common.calculateMappedPosition([realRowPos[1], 0, realBayPos[5]]),
+    rotationY: Math.PI / 2,
+  },
+  {
+    no: '2-4-1',
+    position: Common.calculateMappedPosition([realRowPos[1], 0, realBayPos[4]]),
+    rotationY: Math.PI / 2,
+  },
+  // {
+  //   no: '2-7-1',
+  //   position: Common.calculateMappedPosition([realRowPos[1], 0, realBayPos[3]]),
+  //   rotationY: Math.PI / 2,
+  // },
+  {
+    no: '2-10-1',
+    position: Common.calculateMappedPosition([realRowPos[1], 0, realBayPos[2]]),
+    rotationY: Math.PI / 2,
+  },
+  {
+    no: '2-13-1',
+    position: Common.calculateMappedPosition([realRowPos[1], 0, realBayPos[1]]),
+    rotationY: Math.PI / 2,
+  },
+  {
+    no: '2-16-1',
+    position: Common.calculateMappedPosition([realRowPos[1], 0, realBayPos[0]]),
+    rotationY: Math.PI / 2,
+  },
+
+  // row 3 --------------------------------------------------------------------------
   {
     no: '3-1-1',
-    position: Common.calculateMappedPosition([0, 0, realBayPos[5]]),
+    position: Common.calculateMappedPosition([realRowPos[2], 0, realBayPos[5]]),
     rotationY: Math.PI / 2,
   },
   {
     no: '3-4-1',
-    position: Common.calculateMappedPosition([0, 0, realBayPos[4]]),
+    position: Common.calculateMappedPosition([realRowPos[2], 0, realBayPos[4]]),
     rotationY: Math.PI / 2,
   },
-  {
-    no: '3-7-1',
-    position: Common.calculateMappedPosition([0, 0, realBayPos[3]]),
-    rotationY: Math.PI / 2,
-  },
+  // {
+  //   no: '3-7-1',
+  //   position: Common.calculateMappedPosition([realRowPos[2], 0, realBayPos[3]]),
+  //   rotationY: Math.PI / 2,
+  // },
   {
     no: '3-10-1',
-    position: Common.calculateMappedPosition([0, 0, realBayPos[2]]),
+    position: Common.calculateMappedPosition([realRowPos[2], 0, realBayPos[2]]),
     rotationY: Math.PI / 2,
   },
   {
     no: '3-13-1',
-    position: Common.calculateMappedPosition([0, 0, realBayPos[1]]),
+    position: Common.calculateMappedPosition([realRowPos[2], 0, realBayPos[1]]),
     rotationY: Math.PI / 2,
   },
   {
     no: '3-16-1',
-    position: Common.calculateMappedPosition([0, 0, realBayPos[0]]),
+    position: Common.calculateMappedPosition([realRowPos[2], 0, realBayPos[0]]),
     rotationY: Math.PI / 2,
   },
+
+
 ];
 
 export default shelfData;
diff --git a/src/components/shelf.jsx b/src/components/shelf.jsx
index 4c39a50..90d7e8f 100644
--- a/src/components/shelf.jsx
+++ b/src/components/shelf.jsx
@@ -29,10 +29,8 @@
                     <boxGeometry args={[150, 200, 30]} />
                     <meshStandardMaterial color={'orange'} transparent={true} opacity={.5} />
                 </mesh>
+                {/* <Box rotationY={0} position={[0, 0, 0]} /> */}
             </group>
-            {/* <Box rotationY={Math.PI / 2} position={[0, 100, -50]} />
-            <Box rotationY={Math.PI / 2} position={[0, 100, 0]} />
-            <Box rotationY={Math.PI / 2} position={[0, 100, 30]} /> */}
         </>
     )
 }
diff --git a/src/config/setting.js b/src/config/setting.js
index 0495e01..cf4fad5 100644
--- a/src/config/setting.js
+++ b/src/config/setting.js
@@ -18,4 +18,4 @@
 
 export const REAL_COMPARE_MAP_OFFSET_X = -200;
 
-export const REAL_COMPARE_MAP_OFFSET_Z = -400;
\ No newline at end of file
+export const REAL_COMPARE_MAP_OFFSET_Z = -600;
\ No newline at end of file
diff --git a/src/core/warehouse.jsx b/src/core/warehouse.jsx
index f1bea49..e349492 100644
--- a/src/core/warehouse.jsx
+++ b/src/core/warehouse.jsx
@@ -17,8 +17,6 @@
 
     const [agvData, setAgvData] = useState([
         {}
-        ,
-        {}
     ]);
     const [boxData, setBoxData] = useState([
         {}
@@ -28,7 +26,7 @@
         const timer = setInterval(() => {
             const agvRealData = agvRealDataList[index];
             if (agvRealData) {
-                // setAgvData(agvRealData);
+                setAgvData(agvRealData);
             }
             index++;
         }, INTERVAL_TIME * 1.1);

--
Gitblit v1.9.1