From d64eec6c33a2b0eba504afed66d26a454ec3636b Mon Sep 17 00:00:00 2001 From: luoyifan Date: Tue, 10 Jun 2025 22:12:34 +0800 Subject: [PATCH] =?UTF-8?q?gstore=20=E5=8E=8B=E5=8A=9B=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/example/ExampleUtil.js | 35 +++++++++++++++++++++++++++++++---- src/example/example1.js | 9 +++++++-- 2 files changed, 38 insertions(+), 6 deletions(-) diff --git a/src/example/ExampleUtil.js b/src/example/ExampleUtil.js index 9ed98c7..b139f3d 100644 --- a/src/example/ExampleUtil.js +++ b/src/example/ExampleUtil.js @@ -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性能数据 * @param rows 行数 * @param cols 列数 */ -export function buildAgvPerformanceData(rows, cols) { +export function buildAgvPerformanceData(t, rows, cols) { const spacingX = 1.25 // X轴间距 const spacingZ = 1.25 // Y轴间距 @@ -12,7 +39,7 @@ export function buildAgvPerformanceData(rows, cols) { for (let row = 0; row < rows; row++) { 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][2] = col * spacingZ data.set(node.id, node) @@ -59,10 +86,10 @@ export function buildAgvPerformanceData(rows, cols) { * * @returns {ItemJson} */ -export function createAgvNode(x, z) { +export function createAgvNode(t, x, z) { return { id: 'wp_' + x + '_' + z, - t: 'measure', + t: t, tf: [ [x, 0.01, z], [90, 0, 0], diff --git a/src/example/example1.js b/src/example/example1.js index 9138f70..b713eeb 100644 --- a/src/example/example1.js +++ b/src/example/example1.js @@ -1,4 +1,4 @@ -import { buildAgvPerformanceData } from '@/example/ExampleUtil.js' +import { buildAgvPerformanceData, buildPointPerformanceData } from '@/example/ExampleUtil.js' export default { project_uuid: 'example1', @@ -343,7 +343,11 @@ export default { }, { catalogCode: '__f1', t: 'floor', - items: buildAgvPerformanceData(100, 100) + items: buildAgvPerformanceData('measure', 100, 100) + }, + { + catalogCode: '__f2', t: 'floor', + items: buildPointPerformanceData('gstore', 10, 10) } ], elevator: [], // 电梯 @@ -353,6 +357,7 @@ export default { { label: '仓库楼层', // 目录分组名 items: [ + { catalogCode: '__f2', label: '压力测试 (-f2)' }, // 目录项 { catalogCode: '__f1', label: '地下室 (-f1)' }, // 目录项 { catalogCode: 'f1', label: '一楼 (f1)' }, { catalogCode: 'f2', label: '二楼 (f2)' },