Browse Source

台湾展会脚本

master
修宁 5 months ago
parent
commit
8bf03fb22f
  1. 38
      tw_test/scripts/ZH_CL2.ts

38
tw_test/scripts/CL2_DEMO.ts → tw_test/scripts/ZH_CL2.ts

@ -1,7 +1,7 @@
const gstore = '105_105' const gstore = '504_501'
const agvId = '3' const agvId = '1'
const demoLocList = ['rack1/1/1/0', 'rack2/0/1/0', 'rack2/1/1/0'] const demoLocList = ['rack1/0/1/0', 'rack1/1/1/0', 'rack1/2/1/0', 'rack1/3/1/0']
const demoLocList2 = [ 'rack1/1/1/0', 'rack2/0/1/0', 'rack2/1/1/0' ].reverse() const demoLocList2 = [ ...demoLocList ].reverse()
while (true) { while (true) {
@ -24,7 +24,7 @@ while (true) {
break; break;
} }
} }
} else { } else {
// 地上没有托盘位, 找个位置拖过去 // 地上没有托盘位, 找个位置拖过去
@ -39,7 +39,7 @@ while (true) {
} else { } else {
LCC.log('托盘在货架') LCC.log('托盘在货架')
} }
let has = false let has = false
for (const loc of demoLocList2) { for (const loc of demoLocList2) {
const [rack, bay, level, cell] = loc.split('/') const [rack, bay, level, cell] = loc.split('/')
@ -58,4 +58,28 @@ while (true) {
LCC.log('货架没有空托盘,无法执行') LCC.log('货架没有空托盘,无法执行')
} }
} }
} }
async function freeLoc(){
for (const loc of demoLocList) {
const [rack, bay, level] = loc.split('/')
if (!rack) {
continue;
}
const [emptyLoc] = (await LCC.queryInv({ rack, bay: parseInt(bay), level: parseInt(level) })).data
if (!emptyLoc) {
// 这是一个好位置
return loc;
}
}
}
async function invLoc(){
for (const loc of demoLocList2) {
const [rack, bay, level, cell] = loc.split('/')
const [palletLoc] = (await LCC.queryInv({ rack, bay: parseInt(bay), level: parseInt(level) })).data
if (palletLoc) {
return loc
}
}
}
Loading…
Cancel
Save