From 8142545e287a28eb03567e836e1406c2f0a93085 Mon Sep 17 00:00:00 2001 From: luoyifan Date: Sun, 29 Jun 2025 21:05:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=9D=E5=AD=98=E6=95=B0=E6=8D=AE=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E7=94=9F=E6=88=90=E8=B4=A7=E6=9E=B6=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/RCS数据库结构.md | 1 + doc/command-example/f1.json | 37 ++++++++++++++++++++++++++++++------- src/editor/menus/FileMenu.ts | 33 ++++++++++++++++++++------------- src/modules/cl2/Cl23dObject.ts | 29 ++++++++++++++++------------- 4 files changed, 67 insertions(+), 33 deletions(-) diff --git a/doc/RCS数据库结构.md b/doc/RCS数据库结构.md index da7edbb..28cf92b 100644 --- a/doc/RCS数据库结构.md +++ b/doc/RCS数据库结构.md @@ -136,6 +136,7 @@ create table lcc_bas_location loc_type varchar(20) not null comment '位置类型_gstore_rack_executor', way_point varchar(50) not null comment '路径点编码', loc_direction varchar(10) not null comment '货位相对于路径方向', + catalog_code varchar(50) not null comment '楼层数据', rack varchar(50) not null comment '位置编码', bay integer not null default '0' comment '货架列', level integer not null default '0' comment '货架层', diff --git a/doc/command-example/f1.json b/doc/command-example/f1.json index a4b4076..94d6600 100644 --- a/doc/command-example/f1.json +++ b/doc/command-example/f1.json @@ -16,7 +16,7 @@ ], [ 2.2, - 2.8, + 1.211, 1 ] ], @@ -52,7 +52,7 @@ "in": [], "out": [], "rackWidth": 2.2, - "rackHeight": 2.8 + "rackHeight": 1.211 }, "_rid": "_2" }, @@ -73,7 +73,7 @@ ], [ 2.2, - 2.8, + 2.186, 1 ] ], @@ -109,14 +109,37 @@ "in": [], "out": [], "rackWidth": 2.2, - "rackHeight": 2.8 + "rackHeight": 2.186 }, "_rid": "_3" }, { - "id": "105_105", "t": "gstore", "v": true, - "tf": [[4.44, 0, -1.5], [0, 0, 0], [1, 0.01, 1.2]], - "dt": { "in": [], "out": [], "center": [], "strokeWidth": 0.1 } + "id": "105_105", + "t": "gstore", + "v": true, + "tf": [ + [ + 4.44, + 0, + 1.5 + ], + [ + 0, + 0, + 0 + ], + [ + 1, + 0.01, + 1.2 + ] + ], + "dt": { + "in": [], + "out": [], + "center": [], + "strokeWidth": 0.1 + } }, { "id": "1_2", diff --git a/src/editor/menus/FileMenu.ts b/src/editor/menus/FileMenu.ts index da554d7..cad6a1a 100644 --- a/src/editor/menus/FileMenu.ts +++ b/src/editor/menus/FileMenu.ts @@ -88,7 +88,7 @@ export default defineMenu((menus) => { dialog?.onClose() const veryBigData = JSON.parse(row.otherData) veryBigData.catalog = JSON.parse(row.directoryData) - if(!veryBigData.items) veryBigData.items = [] + if (!veryBigData.items) veryBigData.items = [] worldModel.state.isOpened = false worldModel.state.isDraft = false worldModel.state.catalog = [] @@ -126,18 +126,25 @@ export default defineMenu((menus) => { click: async () => { const viewport: Viewport = window['viewport'] const vdata: any = await viewport.stateManager.save() - console.log(system.json5.stringify(vdata.items)); - await Request.request.post("/api/workbench/LccModelManager@addOrUpdateFloor", { - projectUuid: worldModel.state.project_uuid, - catalogCode: worldModel.state.catalogCode, - items: JSON.stringify(vdata.items), - }); - // console.log(JSON.stringify(worldModel.state)); - await Request.request.post("/api/workbench/LccModelManager@addOrUpdateWorld", { - projectUuid: worldModel.state.project_uuid, - directoryData: JSON.stringify(worldModel.state.catalog), - otherData: JSON.stringify(worldModel.state.worldData), - }); + console.log(system.json5.stringify(vdata.items)) + system.showLoading('正在保存模型数据...') + try { + await Request.request.post('/api/workbench/LccModelManager@addOrUpdateFloor', { + projectUuid: worldModel.state.project_uuid, + catalogCode: worldModel.state.catalogCode, + envId: 1, + items: JSON.stringify(vdata.items) + }) + // console.log(JSON.stringify(worldModel.state)); + await Request.request.post('/api/workbench/LccModelManager@addOrUpdateWorld', { + projectUuid: worldModel.state.project_uuid, + directoryData: JSON.stringify(worldModel.state.catalog), + envId: 1, + otherData: JSON.stringify(worldModel.state.worldData) + }) + } finally { + system.clearLoading() + } } }, { diff --git a/src/modules/cl2/Cl23dObject.ts b/src/modules/cl2/Cl23dObject.ts index 5080669..f959178 100644 --- a/src/modules/cl2/Cl23dObject.ts +++ b/src/modules/cl2/Cl23dObject.ts @@ -395,17 +395,20 @@ export default class Cl23dObject extends THREE.Object3D { try { // 安全连接配置 - const client = - mqtt.connect('mqtt://127.0.0.1:9001', { - path: '/mqtt', - clientId: 'virtual-' + item.id, - clean: true, - connectTimeout: 10000, - username: 'user', - password: 'user', - unixSocket: true, - keepalive: 60, - }); + // const client = mqtt.connect('mqtt://127.0.0.1:9001', { + // path: '/mqtt', + // clientId: 'virtual-' + item.id, + // clean: true, + // connectTimeout: 10000, + // username: 'user', + // password: 'user', + // unixSocket: true, + // keepalive: 60 + // }) + const client = { + on() { + } + } const m20020 = { 'content': { @@ -539,10 +542,10 @@ export default class Cl23dObject extends THREE.Object3D { && ((task.Speed > 0) != (this.currentTask.Speed > 0) || task.Direction != this.currentTask.Direction)) { if (!this.currentAnimation || this.currentAnimation == this.rotationAnimation) { // 转向 - this.addRotation(task.Direction).then(()=>{ + this.addRotation(task.Direction).then(() => { this.executeTask() }) - this.currentAnimation = this.rotationAnimation + this.currentAnimation = this.rotationAnimation this.currentTask = task } } else if (task.OperationType === 0) {