You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

239 lines
9.0 KiB

export function buildRackPerformanceData(rows, cols) {
const spacingX = 20 // X轴间距
const spacingZ = 2.5 // Y轴间距
// 创建一个二维数组来存储点阵数据
const data = new Map()
for (let row = 0; row < rows; row++) {
for (let col = 0; col < cols; col++) {
// 计算每个点的坐标
const node = {
id: 'wp_' + row + '_' + col,
t: 'rack',
v: true,
tf: [[4.196, 0.1, 5.882], [0, 270, 0], [1, 1, 1]],
dt: {
rackDepth: 1,
rackWidth: 5.1,
rackHeight: 4.2,
levelCount: 3,
bayCount: 4,
hideFloor: false,
extendColumns: true,
columnSpacing: 1,
bays: [
{ bayWidth: 1.275, levelHeight: [1.4, 1.4, 1.4, 1.4, 1.4, 1.4, 1.4] },
{ bayWidth: 1.275, levelHeight: [1.4, 1.4, 1.4, 1.4, 1.4, 1.4, 1.4] },
{ bayWidth: 1.275, levelHeight: [1.4, 1.4, 1.4, 1.4, 1.4, 1.4, 1.4] },
{ bayWidth: 1.275, levelHeight: [1.4, 1.4, 1.4, 1.4, 1.4, 1.4, 1.4] },
{ bayWidth: 1.275, levelHeight: [1.4, 1.4, 1.4, 1.4, 1.4, 1.4, 1.4] },
{ bayWidth: 1.275, levelHeight: [1.4, 1.4, 1.4, 1.4, 1.4, 1.4, 1.4] },
{ bayWidth: 1.275, levelHeight: [1.4, 1.4, 1.4, 1.4, 1.4, 1.4, 1.4] },
{ bayWidth: 1.275, levelHeight: [1.4, 1.4, 1.4, 1.4, 1.4, 1.4, 1.4] },
{ bayWidth: 1.275, levelHeight: [1.4, 1.4, 1.4, 1.4, 1.4, 1.4, 1.4] },
{ bayWidth: 1.275, levelHeight: [1.4, 1.4, 1.4, 1.4, 1.4, 1.4, 1.4] }
// { bayWidth: 1.275, levelHeight: [1.4, 1.4, 1.4, 1.4, 1.4, 1.4, 1.4] },
// { bayWidth: 1.275, levelHeight: [1.4, 1.4, 1.4, 1.4, 1.4, 1.4, 1.4] },
// { bayWidth: 1.275, levelHeight: [1.4, 1.4, 1.4, 1.4, 1.4, 1.4, 1.4] },
// { bayWidth: 1.275, levelHeight: [1.4, 1.4, 1.4, 1.4, 1.4, 1.4, 1.4] },
// { bayWidth: 1.275, levelHeight: [1.4, 1.4, 1.4, 1.4, 1.4, 1.4, 1.4] },
// { bayWidth: 1.275, levelHeight: [1.4, 1.4, 1.4, 1.4, 1.4, 1.4, 1.4] },
// { bayWidth: 1.275, levelHeight: [1.4, 1.4, 1.4, 1.4, 1.4, 1.4, 1.4] },
// { bayWidth: 1.275, levelHeight: [1.4, 1.4, 1.4, 1.4, 1.4, 1.4, 1.4] },
// { bayWidth: 1.275, levelHeight: [1.4, 1.4, 1.4, 1.4, 1.4, 1.4, 1.4] },
// { bayWidth: 1.275, levelHeight: [1.4, 1.4, 1.4, 1.4, 1.4, 1.4, 1.4] },
// { bayWidth: 1.275, levelHeight: [1.4, 1.4, 1.4, 1.4, 1.4, 1.4, 1.4] },
// { bayWidth: 1.275, levelHeight: [1.4, 1.4, 1.4, 1.4, 1.4, 1.4, 1.4] },
// { bayWidth: 1.275, levelHeight: [1.4, 1.4, 1.4, 1.4, 1.4, 1.4, 1.4] },
// { bayWidth: 1.275, levelHeight: [1.4, 1.4, 1.4, 1.4, 1.4, 1.4, 1.4] },
// { bayWidth: 1.275, levelHeight: [1.4, 1.4, 1.4, 1.4, 1.4, 1.4, 1.4] },
// { bayWidth: 1.275, levelHeight: [1.4, 1.4, 1.4, 1.4, 1.4, 1.4, 1.4] },
// { bayWidth: 1.275, levelHeight: [1.4, 1.4, 1.4, 1.4, 1.4, 1.4, 1.4] },
// { bayWidth: 1.275, levelHeight: [1.4, 1.4, 1.4, 1.4, 1.4, 1.4, 1.4] },
// { bayWidth: 1.275, levelHeight: [1.4, 1.4, 1.4, 1.4, 1.4, 1.4, 1.4] },
// { bayWidth: 1.275, levelHeight: [1.4, 1.4, 1.4, 1.4, 1.4, 1.4, 1.4] },
// { bayWidth: 1.275, levelHeight: [1.4, 1.4, 1.4, 1.4, 1.4, 1.4, 1.4] },
// { bayWidth: 1.275, levelHeight: [1.4, 1.4, 1.4, 1.4, 1.4, 1.4, 1.4] },
// { bayWidth: 1.275, levelHeight: [1.4, 1.4, 1.4, 1.4, 1.4, 1.4, 1.4] },
// { bayWidth: 1.275, levelHeight: [1.4, 1.4, 1.4, 1.4, 1.4, 1.4, 1.4] },
// { bayWidth: 1.275, levelHeight: [1.4, 1.4, 1.4, 1.4, 1.4, 1.4, 1.4] },
// { bayWidth: 1.275, levelHeight: [1.4, 1.4, 1.4, 1.4, 1.4, 1.4, 1.4] },
// { bayWidth: 1.275, levelHeight: [1.4, 1.4, 1.4, 1.4, 1.4, 1.4, 1.4] },
// { bayWidth: 1.275, levelHeight: [1.4, 1.4, 1.4, 1.4, 1.4, 1.4, 1.4] },
// { bayWidth: 1.275, levelHeight: [1.4, 1.4, 1.4, 1.4, 1.4, 1.4, 1.4] },
// { bayWidth: 1.275, levelHeight: [1.4, 1.4, 1.4, 1.4, 1.4, 1.4, 1.4] },
// { bayWidth: 1.275, levelHeight: [1.4, 1.4, 1.4, 1.4, 1.4, 1.4, 1.4] },
// { bayWidth: 1.275, levelHeight: [1.4, 1.4, 1.4, 1.4, 1.4, 1.4, 1.4] },
// { bayWidth: 1.275, levelHeight: [1.4, 1.4, 1.4, 1.4, 1.4, 1.4, 1.4] },
// { bayWidth: 1.275, levelHeight: [1.4, 1.4, 1.4, 1.4, 1.4, 1.4, 1.4] },
// { bayWidth: 1.275, levelHeight: [1.4, 1.4, 1.4, 1.4, 1.4, 1.4, 1.4] }
],
center: [],
in: [],
out: []
}
}
node.tf[0][0] = row * spacingX
node.tf[0][1] = 0.01
node.tf[0][2] = col * spacingZ
node.tf[1] = [0, 0, 0]
node.tf[2] = [1, 0.4, 1]
data.set(node.id, node)
}
}
return Array.from(data.values())
}
/**
* 构建点阵性能数据
* @param t
* @param rows
* @param cols
*/
export function buildPointPerformanceData(t, rows, cols) {
const spacingX = 1.5 // X轴间距
const spacingZ = 1.5 // Y轴间距
// 创建一个二维数组来存储点阵数据
const data = new Map()
for (let row = 0; row < rows; row++) {
for (let col = 0; col < cols; col++) {
// 计算每个点的坐标
const node = createAgvNode(t, row, col)
node.tf[0][0] = row * spacingX
node.tf[0][1] = 0.01
node.tf[0][2] = col * spacingZ
node.tf[1] = [0, 0, 0]
node.tf[2] = [1, 1.5, 1]
data.set(node.id, node)
}
}
return Array.from(data.values())
}
/**
* 构建AGV性能数据
* @param rows 行数
* @param cols 列数
*/
export function buildAgvPerformanceData(t, rows, cols) {
const spacingX = 1.25 // X轴间距
const spacingZ = 1.25 // Y轴间距
// 创建一个二维数组来存储点阵数据
const data = new Map()
for (let row = 0; row < rows; row++) {
for (let col = 0; col < cols; col++) {
// 计算每个点的坐标
const node = createAgvNode(t, row, col)
node.tf[0][0] = row * spacingX
node.tf[0][2] = col * spacingZ
data.set(node.id, node)
// 与前一个点进行连线
if (row > 0 && col > 0) {
const preXNode = data.get('wp_' + (row - 1) + '_' + (col))
node.dt.in.push(preXNode.id)
preXNode.dt.out.push(node.id)
const preYNode = data.get('wp_' + (row) + '_' + (col - 1))
node.dt.in.push(preYNode.id)
preYNode.dt.out.push(node.id)
} else if (row > 0) {
const preXNode = data.get('wp_' + (row - 1) + '_' + (col))
node.dt.in.push(preXNode.id)
preXNode.dt.out.push(node.id)
} else if (col > 0) {
const preYNode = data.get('wp_' + (row) + '_' + (col - 1))
node.dt.in.push(preYNode.id)
preYNode.dt.out.push(node.id)
}
}
}
return Array.from(data.values())
}
/**
* 构建AGV性能数据
* @param rows 行数
* @param cols 列数
*/
export function buildCenterLinkPerformanceData(t, rows, cols) {
const spacingX = 1.25 // X轴间距
const spacingZ = 1.25 // Y轴间距
// 创建一个二维数组来存储点阵数据
const data = new Map()
for (let row = 0; row < rows; row++) {
for (let col = 0; col < cols; col++) {
// 计算每个点的坐标
const node = createAgvNode(t, row, col)
node.tf[0][0] = row * spacingX
node.tf[0][2] = col * spacingZ
data.set(node.id, node)
// 与前一个点进行连线
if (row > 0 && col > 0) {
const preXNode = data.get('wp_' + (row - 1) + '_' + (col))
node.dt.center.push(preXNode.id)
preXNode.dt.center.push(node.id)
const preYNode = data.get('wp_' + (row) + '_' + (col - 1))
node.dt.center.push(preYNode.id)
preYNode.dt.center.push(node.id)
} else if (row > 0) {
const preXNode = data.get('wp_' + (row - 1) + '_' + (col))
node.dt.center.push(preXNode.id)
preXNode.dt.center.push(node.id)
} else if (col > 0) {
const preYNode = data.get('wp_' + (row) + '_' + (col - 1))
node.dt.center.push(preYNode.id)
preYNode.dt.center.push(node.id)
}
}
}
// 四个对角连线
// data.get('wp_0_0').dt.center.push('wp_0_' + (cols - 1))
// data.get('wp_0_' + (cols - 1)).dt.center.push('wp_0_0')
//
// data.get('wp_' + (rows - 1) + '_0').dt.center.push('wp_' + (rows - 1) + '_' + (cols - 1))
// data.get('wp_' + (rows - 1) + '_' + (cols - 1)).dt.center.push('wp_' + (rows - 1) + '_0')
//
// data.get('wp_' + (rows - 1) + '_0').dt.center.push('wp_0_0')
// data.get('wp_0_0').dt.center.push('wp_' + (rows - 1) + '_0')
//
// data.get('wp_' + (rows - 1) + '_' + (cols - 1)).dt.center.push('wp_0_' + (cols - 1))
// data.get('wp_0_' + (cols - 1)).dt.center.push('wp_' + (rows - 1) + '_' + (cols - 1))
return Array.from(data.values())
}
/**
*
* @returns {ItemJson}
*/
export function createAgvNode(t, x, z) {
return {
id: 'wp_' + x + '_' + z,
t: t,
tf: [
[x, 0.01, z],
[90, 0, 0],
[0.25, 0.25, 0.1]
],
dt: {
in: [],
out: [],
center: []
}
}
}