|
|
@ -1,9 +1,36 @@ |
|
|
/** |
|
|
/** |
|
|
|
|
|
* 构建点阵性能数据 |
|
|
|
|
|
* @param t |
|
|
|
|
|
* @param rows |
|
|
|
|
|
* @param cols |
|
|
|
|
|
*/ |
|
|
|
|
|
export function buildPointPerformanceData(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][1] = 0.01 |
|
|
|
|
|
node.tf[0][2] = col * spacingZ |
|
|
|
|
|
node.tf[1] = [0, 0, 0] |
|
|
|
|
|
node.tf[2] = [1, 0.01, 1] |
|
|
|
|
|
data.set(node.id, node) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
return Array.from(data.values()) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
* 构建AGV性能数据 |
|
|
* 构建AGV性能数据 |
|
|
* @param rows 行数 |
|
|
* @param rows 行数 |
|
|
* @param cols 列数 |
|
|
* @param cols 列数 |
|
|
*/ |
|
|
*/ |
|
|
export function buildAgvPerformanceData(rows, cols) { |
|
|
export function buildAgvPerformanceData(t, rows, cols) { |
|
|
const spacingX = 1.25 // X轴间距
|
|
|
const spacingX = 1.25 // X轴间距
|
|
|
const spacingZ = 1.25 // Y轴间距
|
|
|
const spacingZ = 1.25 // Y轴间距
|
|
|
|
|
|
|
|
|
@ -12,7 +39,7 @@ export function buildAgvPerformanceData(rows, cols) { |
|
|
for (let row = 0; row < rows; row++) { |
|
|
for (let row = 0; row < rows; row++) { |
|
|
for (let col = 0; col < cols; col++) { |
|
|
for (let col = 0; col < cols; col++) { |
|
|
// 计算每个点的坐标
|
|
|
// 计算每个点的坐标
|
|
|
const node = createAgvNode(row, col) |
|
|
const node = createAgvNode(t, row, col) |
|
|
node.tf[0][0] = row * spacingX |
|
|
node.tf[0][0] = row * spacingX |
|
|
node.tf[0][2] = col * spacingZ |
|
|
node.tf[0][2] = col * spacingZ |
|
|
data.set(node.id, node) |
|
|
data.set(node.id, node) |
|
|
@ -59,10 +86,10 @@ export function buildAgvPerformanceData(rows, cols) { |
|
|
* |
|
|
* |
|
|
* @returns {ItemJson} |
|
|
* @returns {ItemJson} |
|
|
*/ |
|
|
*/ |
|
|
export function createAgvNode(x, z) { |
|
|
export function createAgvNode(t, x, z) { |
|
|
return { |
|
|
return { |
|
|
id: 'wp_' + x + '_' + z, |
|
|
id: 'wp_' + x + '_' + z, |
|
|
t: 'measure', |
|
|
t: t, |
|
|
tf: [ |
|
|
tf: [ |
|
|
[x, 0.01, z], |
|
|
[x, 0.01, z], |
|
|
[90, 0, 0], |
|
|
[90, 0, 0], |
|
|
|