diff --git a/src/utils/AmrMapConvert.ts b/src/utils/AmrMapConvert.ts index e295a5d..97d7042 100644 --- a/src/utils/AmrMapConvert.ts +++ b/src/utils/AmrMapConvert.ts @@ -201,6 +201,7 @@ export function AmrMapConvert(from: any): Array { const rackDepth = new Decimal(td.width).div(d1000).toNumber() const levelHeight = td.layersHeight.map((lh: any) => new Decimal(lh.layerHeight).div(d1000).toNumber()) const levelCount = levelHeight.length + // 长度除以货位数 const width = new Decimal(td.length).div(td.goodsAllocationNum).div(d1000).toNumber() storeType.set(td.id, { 't': 'rack', @@ -275,6 +276,16 @@ export function AmrMapConvert(from: any): Array { ..._.cloneDeep(storeType.get(rackTypeId)) } + // 货架高度是从 attribute[0].goodsAllocation[].layerHeight 读取的 + if(insertNode.t === 'rack') { + const levelsInfo = amrNode.attribute[0].attrDetail + const levelCount = levelsInfo.length + const levelHeight = _.map(levelsInfo, l=> new Decimal(l.val).div(d1000).toNumber() ) + + insertNode.dt.levelCount = levelCount + insertNode.dt.bays[0].levelHeight = levelHeight + } + } else { // =================== 这是一个路标 =====================