From ecee3b092f07d5fa1e6f417cc19abb6a8a06f544 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@gmail.com>
Date: 星期四, 27 三月 2025 13:29:39 +0800
Subject: [PATCH] #

---
 zy-acs-flow/src/map/tool.js |   38 ++++++++++++++++++--------------------
 1 files changed, 18 insertions(+), 20 deletions(-)

diff --git a/zy-acs-flow/src/map/tool.js b/zy-acs-flow/src/map/tool.js
index 946a72a..c490f07 100644
--- a/zy-acs-flow/src/map/tool.js
+++ b/zy-acs-flow/src/map/tool.js
@@ -11,6 +11,7 @@
     DEVICE_SELECTED_EFFECT_COLOR,
     POINT_ROUTE_DIRECTION,
     ANIMATE_DURING_TIME,
+    AGV_ANGLE_OFFSET_VAL,
 } from './constants';
 import { getRouteList } from './http';
 import PointRoute from "./PointRoute";
@@ -500,7 +501,7 @@
                 const pointRoute = new PointRoute(POINT_ROUTE_DIRECTION[route.direction]);
                 pointRoute.setPoint(startPoint, endPoint);
                 pointRoute.clear();
-                pointRoute.lineStyle(Math.max(7, 2 * (1 / mapContainer.scale.x)), themeMode === 'light' ? '#ced6e0' : '#535c68');
+                pointRoute.lineStyle(Math.max(7, 2 * (1 / Math.abs(mapContainer.scale.x))), themeMode === 'light' ? '#ced6e0' : '#535c68');
                 pointRoute.moveTo(startPoint.position.x, startPoint.position.y);
                 pointRoute.lineTo(endPoint.position.x, endPoint.position.y);
                 pointRoute.alpha = 1;
@@ -653,23 +654,25 @@
 }
 
 export function createAgvJobPanel(parentContainer, text) {
+    const panelScale = 4;
+
     const panel = new PIXI.Container();
 
-    const sideLen = 50;
+    const sideLen = 50 * panelScale;
     const halfCircle = new PIXI.Graphics();
-    halfCircle.beginFill(themeMode === 'light' ? '#5c5a5a' : '#eee');
-    halfCircle.lineStyle(2, themeMode === 'light' ? '#5c5a5a' : '#eee');
+    halfCircle.beginFill(themeMode === 'light' ? '#333333' : '#eee');
+    halfCircle.lineStyle(2 * panelScale, themeMode === 'light' ? '#333333' : '#eee');
     halfCircle.arc(0, 0, sideLen, 0, Math.PI);
     halfCircle.endFill();
 
     const rectangle = new PIXI.Graphics();
-    rectangle.lineStyle(2, themeMode === 'light' ? '#5c5a5a' : '#eee', 1);
+    rectangle.lineStyle(2 * panelScale, themeMode === 'light' ? '#333333' : '#eee', .8);
     rectangle.drawRoundedRect(
         -sideLen / 2,   // 宸︿笂瑙� x
         -sideLen / 2,   // 宸︿笂瑙� y
         sideLen,       // 瀹�
-        sideLen - 20,  // 楂� (鐣欎竴鐐圭┖闂达紝鐪嬭捣鏉ユ洿鍍忓崐鍦嗗鍣�)
-        16             // 鍦嗚
+        sideLen - (20 * panelScale),  // 楂� (鐣欎竴鐐圭┖闂达紝鐪嬭捣鏉ユ洿鍍忓崐鍦嗗鍣�)
+        16 * panelScale             // 鍦嗚
     );
     rectangle.endFill();
     rectangle.mask = halfCircle;
@@ -678,21 +681,20 @@
 
     const msg = new PIXI.Text(text, {
         fill: themeMode === 'light' ? '#2b2b2b' : '#eee',
-        fontSize: 12,
+        fontSize: 12 * panelScale,
         fontFamily: 'MicrosoftYaHei',
-        fontWeight: 'bold',
+        fontWeight: 'bolder',
         align: 'center',
     });
     msg.anchor.set(0.5);
-    msg.position.set(0, -10);
+    msg.position.set(0, -10 * panelScale);
 
     panel.addChild(msg);
-    panel.scale.set(3);
     parentContainer.addChild(panel);
 
     let phase = 0;
     function onTick(delta) {
-        phase += delta / 8;  // 鏃嬭浆閫熷害鍙皟
+        phase += delta / 6;  // 鏃嬭浆閫熷害鍙皟
         phase %= (Math.PI * 2);
         halfCircle.rotation = phase;
     }
@@ -711,18 +713,14 @@
     }
 }
 
-const agvRotationOffsetDegrees = 90;
-const agvRotationOffset = rotationParseNum(agvRotationOffsetDegrees);
+const agvRotationOffset = rotationParseNum(AGV_ANGLE_OFFSET_VAL);
 
 const showAgvSprite = (curZone, agvVo, setCurSprite) => {
-    const { agvNo, code, direction, battery, jobType, backpack: backpackCount, error } = agvVo;
+    const { agvNo, code, direction, battery, jobType, backpack: backpackCount, slots, error } = agvVo;
     if (!code) { return; }
     const codeSprite = querySprite(DEVICE_TYPE.POINT, code);
     if (!codeSprite) { return; }
-    if (agvNo === '12') {
-        console.log(backpackCount);
-    }
-    
+
     const targetRotation = rotationParseNum(direction);
     // const backpackCount = backpack?.filter(item => item.loaded === true).length || 0;
 
@@ -777,7 +775,7 @@
     // job effect
     if (jobType) {
         if (!agvSprite.data.jobEffect) {
-            agvSprite.data.jobEffect = createAgvJobPanel(agvSprite, jobType);
+            agvSprite.data.jobEffect = createAgvJobPanel(agvSprite, jobType + " (" + backpackCount + "/" + slots + ")");
             agvSprite.data.jobEffect.x = -80;
             agvSprite.data.jobEffect.y = 0;
         }

--
Gitblit v1.9.1