From 162eca31378c749b8f70c32ce2ed988b1101e881 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@63.com>
Date: 星期五, 19 八月 2022 09:15:09 +0800
Subject: [PATCH] #
---
static/js/object/CrnTask.js | 84 +++++++++++++++++++++++++++++-------------
1 files changed, 58 insertions(+), 26 deletions(-)
diff --git a/static/js/object/CrnTask.js b/static/js/object/CrnTask.js
index 751ae59..de21fd6 100644
--- a/static/js/object/CrnTask.js
+++ b/static/js/object/CrnTask.js
@@ -11,13 +11,13 @@
const yOffset1 = -116;
const zOffset1 = -475;
-const palletX = -18;
-const palletY = 2;
-const palletZ = -46;
+const palletX = -2;
+const palletY = 0;
+const palletZ = -25;
-const goodsX = -17;
-const goodsY = 5;
-const goodsZ = -6;
+const goodsX = -2;
+const goodsY = 22;
+const goodsZ = -25;
// 鍫嗗灈鏈哄綋鍓嶈繍琛岀姸鎬佸璞�
function CrnTask(crnData, object) {
@@ -33,6 +33,7 @@
that.preZ = 0;
that.prePosition = null;
that.preForkPos = -1; // -1, "涓嶅湪瀹氫綅" 0, "璐у弶鍘熶綅" 1, "璐у弶鍦ㄥ乏渚ц繙" 2, "璐у弶鍦ㄥ乏渚�" 3, "璐у弶鍦ㄥ彸渚�" 4, "璐у弶鍦ㄥ彸渚ц繙"
+ that.preLoadPos = -1;
// 褰撳墠鏁版嵁
that.bay = 1 ;
that.lev = 1 ;
@@ -41,6 +42,7 @@
that.z = 0;
that.position = null;
that.forkPos = -1;
+ that.loadPos = -1;
that.crnBody = null;
that.crnLoad = null;
@@ -49,6 +51,7 @@
that.pallet = null;
that.goods = null;
+ that.wrkNo = null;
that.sourceLocNo = null;
that.locNo = null;
@@ -63,6 +66,7 @@
that.z = crnData.position.z;
that.position = crnData.position;
that.forkPos = crnData.forkPos;
+ that.loadPos = crnData.loadPos;
that.crnBody = getArrVal(object.objects, "name", that.crnNo + "-body");
that.crnLoad = getArrVal(object.objects, "name", that.crnNo + "-load");
@@ -81,23 +85,27 @@
}
if (that.crnBody===null) {
that.crnBody = getArrVal(object.objects, "name", that.crnNo + "-body");
- // return;
+ return;
}
if (that.crnLoad===null) {
that.crnLoad = getArrVal(object.objects, "name", that.crnNo + "-load");
- // return;
+ return;
}
if (that.crnFork===null) {
that.crnFork = getArrVal(object.objects, "name", that.crnNo + "-fork");
- // return;
+ return;
}
+
+ // 鍑哄簱 / 绉诲簱
if (crnData.sourceLocNo != null) {
- that.sourceLocNo = crnData.sourceLocNo;
that.pallet = getArrVal(object.objects, "name", crnData.sourceLocNo + "-Pallet");
that.goods = getArrVal(object.objects, "name", crnData.sourceLocNo + "-Goods");
- }
- if (crnData.locNo != null) {
- that.locNo = crnData.locNo;
+ } else {
+ // 鍏ュ簱
+ if (crnData.wrkNo != null) {
+ that.pallet = getArrVal(object.objects, "name", crnData.wrkNo + "-Pallet");
+ that.goods = getArrVal(object.objects, "name", crnData.wrkNo + "-Goods");
+ }
}
if (JSON.stringify(crnData.position) === JSON.stringify(that.position)) {
@@ -109,9 +117,10 @@
that.preLev = that.lev;
that.preX = that.x;
that.preY = that.y;
- that.preY = that.y;
+ that.preZ = that.z;
that.prePosition = JSON.parse(JSON.stringify(that.position));
that.preForkPos = that.forkPos;
+ that.preLoadPos = that.loadPos;
// 褰撳墠
that.bay = crnData.bay;
that.lev = crnData.lev;
@@ -120,6 +129,38 @@
that.z = crnData.position.z;
that.position = crnData.position;
that.forkPos = crnData.forkPos;
+ that.loadPos = crnData.loadPos;
+ that.sourceLocNo = crnData.sourceLocNo;
+ that.locNo = crnData.locNo;
+ that.wrkNo = crnData.wrkNo;
+
+ // 鏍规嵁璐у弶涓婁笅瀹氫綅 鍒ゆ柇鍫嗗灈鏈哄彇鏀捐揣浣滀笟 -----------------------------------------------
+
+ // 涓婂畾浣� ===>> 涓嬪畾浣� 鏀捐揣瀹屾垚
+ if (that.preLoadPos === 1 && that.loadPos === 0) {
+ // 鍏ュ簱 / 绉诲簱
+ if (that.locNo != null) {
+ if (that.pallet != null) {
+ that.pallet.name = that.locNo + "-Pallet";
+ }
+ if (that.goods != null) {
+ that.goods.name = that.locNo + "-Goods";
+ }
+ } else {
+ // 鍑哄簱
+ if (crnData.wrkNo != null) {
+ if (that.pallet != null) {
+ that.pallet.name = crnData.wrkNo + "-Pallet";
+ }
+ if (that.goods != null) {
+ that.goods.name = crnData.wrkNo + "-Goods";
+ }
+ }
+ }
+ // 涓嬪畾浣� ===>> 涓婂畾浣� 鍙栬揣瀹屾垚
+ } else {
+
+ }
// create Route ------------------------------------------------
@@ -130,6 +171,7 @@
progress: 0,
part: 'fork',
loaded: crnData.loaded,
+ loadPos: crnData.loadPos,
route: new Route([
{
x: that.prePosition.x,
@@ -152,6 +194,7 @@
progress: 0,
part: 'load',
loaded: crnData.loaded,
+ loadPos: crnData.loadPos,
route: new Route([
{
x: that.crnLoad.position.x,
@@ -169,7 +212,6 @@
curves.map((value, index) => {
if (that.crnNo === 1) {
- // console.log(crnData)
// console.log(value.part + " --> " + JSON.stringify(value.route.points))
}
});
@@ -188,15 +230,6 @@
if (i !== curves.length - 1) {
curves[i+1].start = true;
} else {
- // if (that.locNo != null) {
- // if (that.pallet != null) {
- // that.pallet.name = that.locNo + "-Pallet";
- // }
- // if (that.goods != null) {
- // that.goods.name = that.locNo + "-Goods";
- // }
- // }
- // reset
curves = [];
that.run = false;
}
@@ -215,8 +248,7 @@
break
case 'fork':
that.crnFork.position.set(point.x + xOffset1, point.y, point.z);
- // todo:luxiaotao 鎵樼洏+璐х墿 杩愬姩 涓嶆槸鏍规嵁loaded锛屾槸鏍规嵁涓婁笅瀹氫綅
- if (curves[i].loaded === 1 && that.pallet) {
+ if (curves[i].loadPos === 1 && that.pallet) {
that.pallet.position.setX(point.x + palletX);
that.goods.position.setX(point.x + goodsX);
}
--
Gitblit v1.9.1