Browse Source

保存数据时,生成货架信息

master
修宁 6 months ago
parent
commit
8142545e28
  1. 1
      doc/RCS数据库结构.md
  2. 37
      doc/command-example/f1.json
  3. 23
      src/editor/menus/FileMenu.ts
  4. 27
      src/modules/cl2/Cl23dObject.ts

1
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 '货架层',

37
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",

23
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", {
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,
items: JSON.stringify(vdata.items),
});
envId: 1,
items: JSON.stringify(vdata.items)
})
// console.log(JSON.stringify(worldModel.state));
await Request.request.post("/api/workbench/LccModelManager@addOrUpdateWorld", {
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),
});
envId: 1,
otherData: JSON.stringify(worldModel.state.worldData)
})
} finally {
system.clearLoading()
}
}
},
{

27
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,7 +542,7 @@ 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

Loading…
Cancel
Save