Browse Source

展会地图

master
yuliang 6 months ago
parent
commit
1c91c5bb37
  1. BIN
      src/assets/images/ptr/charger.png
  2. BIN
      src/assets/images/ptr/clx.png
  3. BIN
      src/assets/images/ptr/ptr.png
  4. 6
      src/core/manager/WorldModel.ts
  5. 259
      src/example/example1.js
  6. 5
      src/modules/charger/ChargerEntity.ts
  7. 22
      src/modules/charger/ChargerInteraction.ts
  8. 49
      src/modules/charger/ChargerMeta.ts
  9. 97
      src/modules/charger/ChargerRenderer.ts
  10. 15
      src/modules/charger/index.ts
  11. 5
      src/modules/clx/ClxEntity.ts
  12. 22
      src/modules/clx/ClxInteraction.ts
  13. 49
      src/modules/clx/ClxMeta.ts
  14. 97
      src/modules/clx/ClxRenderer.ts
  15. 15
      src/modules/clx/index.ts
  16. 6
      src/modules/gstore/GstoreRenderer.ts
  17. 6
      src/modules/pallet/PalletRenderer.ts
  18. 4
      src/modules/ptr/PtrMeta.ts
  19. 7
      src/modules/ptr/PtrRenderer.ts
  20. 6
      src/modules/rack/RackRenderer.ts

BIN
src/assets/images/ptr/charger.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

BIN
src/assets/images/ptr/clx.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

BIN
src/assets/images/ptr/ptr.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 12 KiB

6
src/core/manager/WorldModel.ts

@ -7,6 +7,8 @@ import Gstore from '@/modules/gstore'
import Rack from '@/modules/rack'
import Pallet from "@/modules/pallet"
import Ptr from "@/modules/ptr"
import Clx from "@/modules/clx"
import Charger from "@/modules/charger"
import StateManager from '@/core/manager/StateManager.ts'
export interface WorldModelState {
@ -70,7 +72,9 @@ export default class WorldModel {
Gstore,
Rack,
Pallet,
Ptr
Ptr,
Clx,
Charger
]).then(() => {
console.log('世界模型初始化完成')

259
src/example/example1.js

@ -7,10 +7,10 @@ export default {
Dashboard: [], // 监控面板
DataTable: [], // 地图自带的数据
Trigger: [ // 触发器
{ name: 'OnOpen', fn: '' }, // 打开
{ name: 'OnReset', fn: '' }, // 仿真重置
{ name: 'OnStart', fn: '' }, // 开始仿真
{ name: 'OnStop', fn: '' } // 停止仿真
{name: 'OnOpen', fn: ''}, // 打开
{name: 'OnReset', fn: ''}, // 仿真重置
{name: 'OnStart', fn: ''}, // 开始仿真
{name: 'OnStop', fn: ''} // 停止仿真
],
gridHelper: { // 网格辅助线
axesEnabled: true, // 是否显示中心轴
@ -93,11 +93,11 @@ export default {
bays: [ // 每列的配置
{
bayWidth: 1.4, // 列的宽度
levelHeight: [ 1.4, 1.4, 1.4 ] // 每层的高度
levelHeight: [1.4, 1.4, 1.4] // 每层的高度
},
{bayWidth: 1.4, levelHeight: [ 1.4, 1.4, 1.4 ]},
{bayWidth: 1.4, levelHeight: [ 1.4, 1.4, 1.4 ]},
{bayWidth: 1.4, levelHeight: [ 1.4, 1.4, 1.4 ]},
{bayWidth: 1.4, levelHeight: [1.4, 1.4, 1.4]},
{bayWidth: 1.4, levelHeight: [1.4, 1.4, 1.4]},
{bayWidth: 1.4, levelHeight: [1.4, 1.4, 1.4]},
]
}
},
@ -106,87 +106,258 @@ export default {
t: 'measure',
v: true,
tf: [[-4, 0.1, 4], [90, 0, 0], [0.25, 0.25, 0.1]],
dt: { in: [], out: [], center: ['P2'] }
dt: {in: [], out: [], center: ['P2']}
}, {
id: 'P2',
t: 'measure',
v: true,
tf: [[5, 0.1, 4], [90, 0, 0], [0.25, 0.25, 0.1]],
dt: { in: [], out: [], center: ['P1', 'P3'] }
dt: {in: [], out: [], center: ['P1', 'P3']}
}, {
id: 'P3',
t: 'measure',
v: true,
tf: [[5, 0.1, 6.25], [90, 0, 0], [0.25, 0.25, 0.1]],
dt: { in: [], out: [], center: ['P2'] }
dt: {in: [], out: [], center: ['P2']}
}, {
id: '39zML1rnSOOQGQYQ2YUMGy',
t: 'way',
v: true,
tf: [[-4, 0.1, 2], [90, 0, 0], [0.25, 0.25, 0.1]],
dt: { in: [], out: [], center: ['6wrGKiVJniwgKkoggOoEy6'] }
dt: {in: [], out: [], center: ['6wrGKiVJniwgKkoggOoEy6']}
}, {
id: '6wrGKiVJniwgKkoggOoEy6',
t: 'way',
v: true,
tf: [[5, 0.1, 2], [90, 0, 0], [0.25, 0.25, 0.1]],
dt: { in: [], out: [], center: ['39zML1rnSOOQGQYQ2YUMGy'] }
dt: {in: [], out: [], center: ['39zML1rnSOOQGQYQ2YUMGy']}
}, {
id: '6UhIIw9QPYh6acwyW8OSGs',
t: 'gstore',
v: true,
tf: [[-1, 0.1, 0.55], [0, 0, 0], [1.5, 1.2, 0.1]],
dt: { in: [], out: [], center: [], storeWidth: 1.4, storeDepth: 1.4 }
dt: {in: [], out: [], center: [], storeWidth: 1.4, storeDepth: 1.4}
}, {
id: '1D0WSRPj8JJJwIcmA0UMqG',
t: 'gstore',
v: true,
tf: [[0.75, 0.1, 0.55], [0, 0, 0], [1.5, 1.2, 0.1]],
dt: { in: [], out: [], center: [], storeWidth: 1.4, storeDepth: 1.4 }
dt: {in: [], out: [], center: [], storeWidth: 1.4, storeDepth: 1.4}
}, {
id: 'gstore3',
t: 'gstore',
v: true,
tf: [[3, 0.1, 0.55], [0, 0, 0], [1.5, 1.2, 0.1]],
dt: { in: [], out: [], center: [], storeWidth: 1.4, storeDepth: 1.4 }
},{
dt: {in: [], out: [], center: [], storeWidth: 1.4, storeDepth: 1.4}
}, {
id: 'pallet1',
t: 'pallet',
v: true,
tf: [[0.75, 0.075, 0.55], [0, 0, 0], [1.5, 1.2, 0.1]],
dt: { in: [], out: [], center: [], palletWidth: 1, palletDepth: 1.2 }
dt: {in: [], out: [], center: [], palletWidth: 1, palletDepth: 1.2}
}, {
id: 'pallet2',
t: 'pallet',
v: true,
tf: [[3, 0.075, 0.55], [0, 0, 0], [1.5, 1.2, 0.1]],
dt: { in: [], out: [], center: [], palletWidth: 1, palletDepth: 1.2 }
dt: {in: [], out: [], center: [], palletWidth: 1, palletDepth: 1.2}
}, {
id: 'ptr1',
t: 'ptr',
v: true,
tf: [[0.75, 0.075, 2], [0, 0, 0], [1.5, 1.2, 0.1]],
dt: { in: [], out: [], center: [], ptrWidth: 1.5, ptrDepth: 1.5, ptrHeight: 1.98 }
dt: {in: [], out: [], center: [], ptrWidth: 1.5, ptrDepth: 1.5, ptrHeight: 1.98}
}, {
id: 'ptr2',
t: 'ptr',
v: true,
tf: [[3, 0.075, 2], [0, 0, 0], [1.5, 1.2, 0.1]],
dt: { in: [], out: [], center: [], ptrWidth: 1.5, ptrDepth: 1.5, ptrHeight: 1.98 }
dt: {in: [], out: [], center: [], ptrWidth: 1.5, ptrDepth: 1.5, ptrHeight: 1.98}
}, {
id: 'pallet3',
t: 'pallet',
v: true,
tf: [[3, 0.175, 1.9], [0, 0, 0], [1.5, 1.2, 0.1]],
dt: { in: [], out: [], center: [], palletWidth: 1, palletDepth: 1.2 }
tf: [[3, 0.175, 1.88], [0, 0, 0], [1.5, 1.2, 0.1]],
dt: {in: [], out: [], center: [], palletWidth: 1, palletDepth: 1.2}
}, {
id: 'pallet4',
t: 'pallet',
v: true,
tf: [[0.75, 0.175, 3.5], [0, 0, 0], [1.5, 1.2, 0.1]],
dt: { in: [], out: [], center: [], palletWidth: 1, palletDepth: 1.2 }
dt: {in: [], out: [], center: [], palletWidth: 1, palletDepth: 1.2}
}
]
},
{
catalogCode: 'f2', t: 'floor', // 楼层
items: [{
id: 'rack1',
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]},
{bayWidth: 1.275, levelHeight: [1.4, 1.4, 1.4]},
{bayWidth: 1.275, levelHeight: [1.4, 1.4, 1.4]},
{bayWidth: 1.275, levelHeight: [1.4, 1.4, 1.4]}],
center: [],
in: [],
out: []
}
}, {id: '3ExXFSuV9WB2WMY2Quyq6L', t: 'measure', v: true, tf: [[0, 0.1, 0], [90, 0, 0], [0.1, 0.1, 0.1]], dt: {in: [], out: [], center: ['4YZKo6XtvL2migaIUmakAr', '7Ik2sRdDZy8Q6sC00AaqCv']}}, {
id: '3ExXFSuV9WB2WMY2Quyq6L',
t: 'measure',
v: true,
tf: [[0, 0.1, 0], [90, 0, 0], [0.1, 0.1, 0.1]],
dt: {in: [], out: [], center: ['4YZKo6XtvL2migaIUmakAr', '7Ik2sRdDZy8Q6sC00AaqCv']}
}, {id: '4YZKo6XtvL2migaIUmakAr', t: 'measure', v: true, tf: [[8.4, 0.1, 0], [90, 0, 0], [0.1, 0.1, 0.1]], dt: {in: [], out: [], center: ['3ExXFSuV9WB2WMY2Quyq6L', '3cdb6OHkp132soSsgW8McA']}}, {
id: '3cdb6OHkp132soSsgW8McA',
t: 'measure',
v: true,
tf: [[8.4, 0.1, 9], [90, 0, 0], [0.1, 0.1, 0.1]],
dt: {in: [], out: [], center: ['4YZKo6XtvL2migaIUmakAr', '7Ik2sRdDZy8Q6sC00AaqCv']}
}, {id: '7Ik2sRdDZy8Q6sC00AaqCv', t: 'measure', v: true, tf: [[0, 0.1, 9], [90, 0, 0], [0.1, 0.1, 0.1]], dt: {in: [], out: [], center: ['3cdb6OHkp132soSsgW8McA', '3ExXFSuV9WB2WMY2Quyq6L']}}, {
id: '6Vu3dX1V7Si0ISWIiCkoEh',
t: 'gstore',
v: true,
tf: [[1.5, 0.1, 0.63], [0, 0, 0], [1, 1, 1]],
dt: {in: [], out: [], center: [], storeWidth: 1.1, storeDepth: 1.3}
}, {id: '592UY0EMScbwIyQqgs8aAs', t: 'gstore', v: true, tf: [[3.9, 0.1, 0.63], [0, 0, 0], [1, 1, 1]], dt: {in: [], out: [], center: [], storeWidth: 1.1, storeDepth: 1.3}}, {
id: '38TYyVWMGLf8OogQMIiSOz',
t: 'gstore',
v: true,
tf: [[7.1, 0.1, 2.865], [0, 90, 0], [1, 1, 1]],
dt: {in: [], out: [], center: [], storeWidth: 1.1, storeDepth: 1.3}
}, {id: '1hAaZ1xtvukZowAKeWAcqs', t: 'gstore', v: true, tf: [[7.1, 0.1, 4.35], [0, 90, 0], [1, 1, 1]], dt: {in: [], out: [], center: [], storeWidth: 1.1, storeDepth: 1.3}}, {
id: '28GxDYUqDwZc2WsOgMU2wi',
t: 'gstore',
v: true,
tf: [[7.1, 0.1, 6.75], [0, 90, 0], [1, 1, 1]],
dt: {in: [], out: [], center: [], storeWidth: 1.1, storeDepth: 1.3}
}, {id: '2fWOnUmFpvYyCWEqAyU0QC', t: 'way', v: true, tf: [[1.5, 0.1, 2.13], [90, 0, 0], [0.25, 0.25, 0.1]], dt: {in: [], out: [], center: ['09PTEMUnACWY0MUG4qmk0r']}}, {
id: '09PTEMUnACWY0MUG4qmk0r',
t: 'way',
v: true,
tf: [[2.7, 0.1, 2.13], [90, 0, 0], [0.25, 0.25, 0.1]],
dt: {in: [], out: [], center: ['2fWOnUmFpvYyCWEqAyU0QC', '2CSDVrpqthaiQuyWUymCwy', '0mVU9FacN1fmCAmQqwWgIZ']}
}, {id: '2CSDVrpqthaiQuyWUymCwy', t: 'way', v: true, tf: [[3.9, 0.1, 2.13], [90, 0, 0], [0.25, 0.25, 0.1]], dt: {in: [], out: [], center: ['09PTEMUnACWY0MUG4qmk0r']}}, {
id: '0mVU9FacN1fmCAmQqwWgIZ',
t: 'way',
v: true,
tf: [[2.7, 0.1, 2.832], [90, 0, 0], [0.25, 0.25, 0.1]],
dt: {in: [], out: [], center: ['09PTEMUnACWY0MUG4qmk0r', '7LuzEYQQI7OQcEUekEqWcm']}
}, {id: '7LuzEYQQI7OQcEUekEqWcm', t: 'way', v: true, tf: [[2.7, 0.1, 3.932], [90, 0, 0], [0.25, 0.25, 0.1]], dt: {in: [], out: [], center: ['0mVU9FacN1fmCAmQqwWgIZ', '2RForJhOHXtcw0gq8mYAMh']}}, {
id: '2RForJhOHXtcw0gq8mYAMh',
t: 'way',
v: true,
tf: [[2.7, 0.1, 4.582], [90, 0, 0], [0.25, 0.25, 0.1]],
dt: {in: [], out: [], center: ['7LuzEYQQI7OQcEUekEqWcm', '32vDSCKBrgMWycW0ySIgsJ']}
}, {id: '32vDSCKBrgMWycW0ySIgsJ', t: 'way', v: true, tf: [[2.7, 0.1, 5.232], [90, 0, 0], [0.25, 0.25, 0.1]], dt: {in: [], out: [], center: ['2RForJhOHXtcw0gq8mYAMh', '0wcYKcGQialFQCGkAa6aYB']}}, {
id: '0wcYKcGQialFQCGkAa6aYB',
t: 'way',
v: true,
tf: [[2.7, 0.1, 5.882], [90, 0, 0], [0.25, 0.25, 0.1]],
dt: {in: [], out: [], center: ['32vDSCKBrgMWycW0ySIgsJ', '55g6mUWBdozg4m2ueUEUsy']}
}, {id: '55g6mUWBdozg4m2ueUEUsy', t: 'way', v: true, tf: [[2.7, 0.1, 6.532], [90, 0, 0], [0.25, 0.25, 0.1]], dt: {in: [], out: [], center: ['0wcYKcGQialFQCGkAa6aYB', '5iKoIUBhnU08EM0IsoyOSW']}}, {
id: '5iKoIUBhnU08EM0IsoyOSW',
t: 'way',
v: true,
tf: [[2.7, 0.1, 7.632], [90, 0, 0], [0.25, 0.25, 0.1]],
dt: {in: [], out: [], center: ['55g6mUWBdozg4m2ueUEUsy']}
}, {
id: '3ZP01pHXJRuyeg24oCaaMq',
t: 'way',
v: true,
tf: [[5.65, 0.1, 2.13], [90, 0, 0], [0.25, 0.25, 0.1]],
dt: {in: [], out: [], center: ['5onDSGuIKBpUQo6g0EIsuS']}
}, {id: '5onDSGuIKBpUQo6g0EIsuS', t: 'way', v: true, tf: [[5.65, 0.1, 2.865], [90, 0, 0], [0.25, 0.25, 0.1]], dt: {in: [], out: [], center: ['3ZP01pHXJRuyeg24oCaaMq', '41A0CKR8cFW8wKkcSMQ4uk']}}, {
id: '41A0CKR8cFW8wKkcSMQ4uk',
t: 'way',
v: true,
tf: [[5.65, 0.1, 3.932], [90, 0, 0], [0.25, 0.25, 0.1]],
dt: {in: [], out: [], center: ['5onDSGuIKBpUQo6g0EIsuS', '4PunEz5C3Xk66EaOgMEuMq']}
}, {id: '4PunEz5C3Xk66EaOgMEuMq', t: 'way', v: true, tf: [[5.65, 0.1, 4.348], [90, 0, 0], [0.25, 0.25, 0.1]], dt: {in: [], out: [], center: ['41A0CKR8cFW8wKkcSMQ4uk', '6oCW8i0dpRtuCEIWIaAcQi']}}, {
id: '6oCW8i0dpRtuCEIWIaAcQi',
t: 'way',
v: true,
tf: [[5.65, 0.1, 5.232], [90, 0, 0], [0.25, 0.25, 0.1]],
dt: {in: [], out: [], center: ['4PunEz5C3Xk66EaOgMEuMq', '3C9Z8c6oxQbWcS4uSGkC8b']}
}, {id: '3C9Z8c6oxQbWcS4uSGkC8b', t: 'way', v: true, tf: [[5.65, 0.1, 5.882], [90, 0, 0], [0.25, 0.25, 0.1]], dt: {in: [], out: [], center: ['6oCW8i0dpRtuCEIWIaAcQi', '1jJX8KZLMPSSCwuCOU6AQz']}}, {
id: '1jJX8KZLMPSSCwuCOU6AQz',
t: 'way',
v: true,
tf: [[5.65, 0.1, 6.532], [90, 0, 0], [0.25, 0.25, 0.1]],
dt: {in: [], out: [], center: ['3C9Z8c6oxQbWcS4uSGkC8b', '0aJ81sOKqm9FYo60AIQmMG']}
}, {id: '0aJ81sOKqm9FYo60AIQmMG', t: 'way', v: true, tf: [[5.65, 0.1, 6.744], [90, 0, 0], [0.25, 0.25, 0.1]], dt: {in: [], out: [], center: ['1jJX8KZLMPSSCwuCOU6AQz', '2qtxSDVn30EcI2uY4W0CWf']}}, {
id: '2qtxSDVn30EcI2uY4W0CWf',
t: 'way',
v: true,
tf: [[5.65, 0.1, 7.632], [90, 0, 0], [0.25, 0.25, 0.1]],
dt: {in: [], out: [], center: ['0aJ81sOKqm9FYo60AIQmMG']}
}, {
id: 'ptr1',
t: 'ptr',
v: true,
tf: [[5.65, 0.1, 2.865], [0, -90, 0], [1, 1, 1]],
dt: {in: [], out: [], center: [], ptrWidth: 1.5, ptrDepth: 1.5, ptrHeight: 1.98}
}, {
id: 'clx1',
t: 'clx',
v: true,
tf: [[1.5, 0.1, 2.13], [0, 0, 0], [1, 1, 1]],
dt: {in: [], out: [], center: [], clxWidth: 1.65, clxDepth: 1.65, clxHeight: 3.393}
}, {
id: 'charger1',
t: 'charger',
v: true,
tf: [[2.696, 0.1, 8.75], [0, 0, 0], [1, 1, 1]],
dt: {in: [], out: [], center: [], chargerWidth: 0.53, chargerDepth: 0.275, clxHeight: 0.3}
}, {
id: 'charger2',
t: 'charger',
v: true,
tf: [[5.655, 0.1, 8.75], [0, 0, 0], [1, 1, 1]],
dt: {in: [], out: [], center: [], chargerWidth: 0.53, chargerDepth: 0.275, clxHeight: 0.3}
}, {
id: 'pallet1122',
t: 'pallet',
v: true,
tf: [[1.5, 0.1, 0.63], [0, 0, 0], [1, 1, 1]],
dt: {in: [], out: [], center: [], palletWidth: 1, palletDepth: 1.2}
}, {
id: 'pallet1123',
t: 'pallet',
v: true,
tf: [[7.100, 0.1, 4.35], [0, 90, 0], [1, 1, 1]],
dt: {in: [], out: [], center: [], palletWidth: 1, palletDepth: 1.2}
}, {
id: 'pallet1124',
t: 'pallet',
v: true,
tf: [[4.196, 0.1, 3.95], [0, 90, 0], [1, 1, 1]],
dt: {in: [], out: [], center: [], palletWidth: 1, palletDepth: 1.2}
}, {
id: 'pallet1125',
t: 'pallet',
v: true,
tf: [[4.196, 0.1, 5.225], [0, 90, 0], [1, 1, 1]],
dt: {in: [], out: [], center: [], palletWidth: 1, palletDepth: 1.2}
}, {
id: 'pallet1126',
t: 'pallet',
v: true,
tf: [[4.196, 0.1, 7.775], [0, 90, 0], [1, 1, 1]],
dt: {in: [], out: [], center: [], palletWidth: 1, palletDepth: 1.2}
}]
}
],
elevator: [], // 电梯
@ -196,41 +367,41 @@ export default {
{
label: '仓库楼层', // 目录分组名
items: [
{ catalogCode: '-f1', label: '地下室 (-f1)' }, // 目录项
{ catalogCode: 'f1', label: '一楼 (f1)' },
{ catalogCode: 'f2', label: '二楼 (f2)' },
{ catalogCode: 'OUT', label: '外场 (OUT)' },
{ catalogCode: 'fe', label: '楼层电梯 (fe)' }
{catalogCode: '-f1', label: '地下室 (-f1)'}, // 目录项
{catalogCode: 'f1', label: '一楼 (f1)'},
{catalogCode: 'f2', label: '二楼 (f2)'},
{catalogCode: 'OUT', label: '外场 (OUT)'},
{catalogCode: 'fe', label: '楼层电梯 (fe)'}
]
},
{
label: '密集库区域',
items: [
{ catalogCode: 'm1', label: 'M1 (m1)' },
{ catalogCode: 'm2', label: 'M2 (m2)' },
{ catalogCode: 'm3', label: 'M3 (m3)' },
{ catalogCode: 'm4', label: 'M4 (m4)' },
{ catalogCode: 'me', label: '提升机 (me)' }
{catalogCode: 'm1', label: 'M1 (m1)'},
{catalogCode: 'm2', label: 'M2 (m2)'},
{catalogCode: 'm3', label: 'M3 (m3)'},
{catalogCode: 'm4', label: 'M4 (m4)'},
{catalogCode: 'me', label: '提升机 (me)'}
]
},
{
label: '多穿库A',
items: [
{ catalogCode: 'd1', label: 'D1 (d1)' },
{ catalogCode: 'd2', label: 'D2 (d2)' },
{ catalogCode: 'd3', label: 'D3 (d3)' },
{ catalogCode: 'd4', label: 'D4 (d4)' },
{ catalogCode: 'de1', label: '提升机 (de1)' }
{catalogCode: 'd1', label: 'D1 (d1)'},
{catalogCode: 'd2', label: 'D2 (d2)'},
{catalogCode: 'd3', label: 'D3 (d3)'},
{catalogCode: 'd4', label: 'D4 (d4)'},
{catalogCode: 'de1', label: '提升机 (de1)'}
]
},
{
label: '多穿库B',
items: [
{ catalogCode: 'e1', label: 'E1 (e1)' },
{ catalogCode: 'e2', label: 'E2 (e2)' },
{ catalogCode: 'e3', label: 'E3 (e3)' },
{ catalogCode: 'e4', label: 'E4 (e4)' },
{ catalogCode: 'ee1', label: '提升机 (ee1)' }
{catalogCode: 'e1', label: 'E1 (e1)'},
{catalogCode: 'e2', label: 'E2 (e2)'},
{catalogCode: 'e3', label: 'E3 (e3)'},
{catalogCode: 'e4', label: 'E4 (e4)'},
{catalogCode: 'ee1', label: '提升机 (ee1)'}
]
}
]

5
src/modules/charger/ChargerEntity.ts

@ -0,0 +1,5 @@
import BaseEntity from '@/core/base/BaseItemEntity.ts'
export default class ChargerEntity extends BaseEntity {
}

22
src/modules/charger/ChargerInteraction.ts

@ -0,0 +1,22 @@
import BaseInteraction from '@/core/base/BaseInteraction.ts'
import * as THREE from 'three'
export default class ChargerInteraction extends BaseInteraction {
get isSinglePointMode(): boolean {
return true
}
constructor(itemTypeName: string) {
super(itemTypeName)
}
createPointOfItem(item: ItemJson, point: THREE.Vector3): ItemJson {
item = super.createPointOfItem(item, point)
// 创建一个地堆货架
item.dt.palletWidth = 1 // 宽度
item.dt.palletDepth = 1.2 // 深度
return item
}
}

49
src/modules/charger/ChargerMeta.ts

@ -0,0 +1,49 @@
import type { IMeta } from '@/core/base/IMeta.ts'
export default [
{ field: 'uuid', editor: 'UUID', label: 'uuid', readonly: true, category: 'basic' },
{ field: 'name', editor: 'TextInput', label: '名称', category: 'basic' },
{ field: 'dt.label', editor: 'TextInput', label: '标签', category: 'basic' },
{ editor: 'TransformEditor', category: 'basic' },
{ field: 'dt.color', editor: 'Color', label: '颜色', category: 'basic' },
{ editor: '-', category: 'basic' },
{ field: 'dt.chargerWidth', editor: 'NumberInput', label: '充电桩宽度', category: 'basic' },
{ field: 'dt.chargerDepth', editor: 'NumberInput', label: '充电桩深度', category: 'basic' },
/**
* dt.bays 53
* {
* dt: {
* rackDepth: 1.1, // 货架深度
* levelCount: 3, // 总层数
* bayCount: 5, // 总列数
* hideFloor: false, // 隐藏底板
* extendColumns: true, // 扩展挡板
* columnSpacing: 1, // 支脚跨越
* bays: [ // 每列的配置
* {
* bayWidth: 1.6, // 列的宽度
* levelHeight: [ 1.4, 1.4, 1.4 ] // 每层的高度
* },
* {bayWidth: 1.6, levelHeight: [ 1.4, 1.4, 1.4 ]},
* {bayWidth: 1.6, levelHeight: [ 1.4, 1.4, 1.4 ]},
* {bayWidth: 1.6, levelHeight: [ 1.4, 1.4, 1.4 ]},
* {bayWidth: 1.6, levelHeight: [ 1.4, 1.4, 1.4 ]},
* ]
* }
* }
*
*
*
*
*
*
*
*/
{ field: 'tf', editor: 'InOutCenterEditor', category: 'basic' },
{ field: 'dt.selectable', editor: 'Switch', label: '可选中', category: 'basic' },
{ field: 'dt.protected', editor: 'Switch', label: '受保护', category: 'basic' },
{ field: 'visible', editor: 'Switch', label: '可见', category: 'basic' }
] as IMeta

97
src/modules/charger/ChargerRenderer.ts

@ -0,0 +1,97 @@
import * as THREE from 'three'
import BaseRenderer from '@/core/base/BaseRenderer.ts'
import { Line2 } from 'three/examples/jsm/lines/Line2.js'
import { LineGeometry } from 'three/examples/jsm/lines/LineGeometry.js'
import { LineMaterial } from 'three/examples/jsm/lines/LineMaterial.js'
import {decimalSumBy} from "@/core/ModelUtils";
import Constract from '@/core/Constract.ts'
import chargerUrl from '@/assets/images/ptr/charger.png'
/**
*
*/
export default class ChargerRenderer extends BaseRenderer {
static POINT_NAME = 'charger'
pointMaterial: THREE.Material
/**
* ,
*/
readonly defulePositionY: number = Constract.HEIGHT_WAY
readonly defaultScale: THREE.Vector3 = new THREE.Vector3(1, 1, 1)
readonly defaultRotation: THREE.Vector3 = new THREE.Vector3(0, 0, 0)
readonly defaultLineWidth: number = 0.15
constructor(itemTypeName: string) {
super(itemTypeName)
}
/**
* 使 storeWidth/storeDepth, TF无效
*/
override afterCreateOrUpdatePoint(item: ItemJson, option: RendererCudOption, objects: THREE.Object3D[]) {
super.afterCreateOrUpdatePoint(item, option, objects)
const point = objects[0]
// point.position.y = this.defulePositionY
// point.scale.set(_.sumBy(item.dt.bays, b=>b.bayWidth), this.defaultScale.y, item.dt.rackDepth)
point.rotation.set(
THREE.MathUtils.degToRad(item.tf[1][0]),
THREE.MathUtils.degToRad(item.tf[1][1]),
THREE.MathUtils.degToRad(item.tf[1][2])
)
}
createLineBasic(start: ItemJson, end: ItemJson, type: LinkType): THREE.Object3D[] {
throw new Error('not allow store line.')
}
updateLine(start: ItemJson, end: ItemJson, type: LinkType, option?: RendererCudOption) {
throw new Error('not allow store line.')
}
createPoint(item: ItemJson, option?: RendererCudOption): THREE.Object3D[] {
// 创建平面几何体
if (!item.dt.chargerWidth || !item.dt.chargerDepth) {
return []
}
const textureLoader = new THREE.TextureLoader()
const texture = textureLoader.load(chargerUrl)
const group = new THREE.Group()
group.name = ChargerRenderer.POINT_NAME
// 绘制背景矩形框
const planeGeometry = new THREE.PlaneGeometry(item.dt.chargerWidth, item.dt.chargerDepth);
planeGeometry.rotateX(-Math.PI / 2)
const planeMaterial = new THREE.MeshLambertMaterial({
map: texture, // 颜色贴图
transparent: true, // 允许透明纹理
});
const planeMesh = new THREE.Mesh(planeGeometry, planeMaterial);
group.add(planeMesh)
// 设置位置
group.position.set(item.tf[0][0], item.tf[0][1], item.tf[0][2])
const points = [group]
this.fillObjectUserDataFromItem(item, ...points)
this.afterCreateOrUpdatePoint(item, option, points)
this.tempViewport.entityManager.appendObject(item.id, points)
this.appendToScene(...points)
return points
}
dispose() {
super.dispose()
this.pointMaterial?.dispose()
}
createPointBasic(item: ItemJson, option?: RendererCudOption): Object3D[] {
return [];
}
}

15
src/modules/charger/index.ts

@ -0,0 +1,15 @@
import { defineModule } from '@/core/manager/ModuleManager.ts'
import ChargerRenderer from './ChargerRenderer.ts'
import ChargerEntity from './ChargerEntity.ts'
import ChargerMeta from './ChargerMeta.ts'
import ChargerInteraction from './ChargerInteraction.ts'
export const ITEM_TYPE_NAME = 'charger'
export default defineModule({
name: ITEM_TYPE_NAME,
renderer: new ChargerRenderer(ITEM_TYPE_NAME),
interaction: new ChargerInteraction(ITEM_TYPE_NAME),
meta: ChargerMeta,
entity: ChargerEntity
})

5
src/modules/clx/ClxEntity.ts

@ -0,0 +1,5 @@
import BaseEntity from '@/core/base/BaseItemEntity.ts'
export default class ClxEntity extends BaseEntity {
}

22
src/modules/clx/ClxInteraction.ts

@ -0,0 +1,22 @@
import BaseInteraction from '@/core/base/BaseInteraction.ts'
import * as THREE from 'three'
export default class ClxInteraction extends BaseInteraction {
get isSinglePointMode(): boolean {
return true
}
constructor(itemTypeName: string) {
super(itemTypeName)
}
createPointOfItem(item: ItemJson, point: THREE.Vector3): ItemJson {
item = super.createPointOfItem(item, point)
// 创建一个地堆货架
item.dt.palletWidth = 1 // 宽度
item.dt.palletDepth = 1.2 // 深度
return item
}
}

49
src/modules/clx/ClxMeta.ts

@ -0,0 +1,49 @@
import type { IMeta } from '@/core/base/IMeta.ts'
export default [
{ field: 'uuid', editor: 'UUID', label: 'uuid', readonly: true, category: 'basic' },
{ field: 'name', editor: 'TextInput', label: '名称', category: 'basic' },
{ field: 'dt.label', editor: 'TextInput', label: '标签', category: 'basic' },
{ editor: 'TransformEditor', category: 'basic' },
{ field: 'dt.color', editor: 'Color', label: '颜色', category: 'basic' },
{ editor: '-', category: 'basic' },
{ field: 'dt.clxWidth', editor: 'NumberInput', label: 'CLX宽度', category: 'basic' },
{ field: 'dt.clxDepth', editor: 'NumberInput', label: 'CLX深度', category: 'basic' },
/**
* dt.bays 53
* {
* dt: {
* rackDepth: 1.1, // 货架深度
* levelCount: 3, // 总层数
* bayCount: 5, // 总列数
* hideFloor: false, // 隐藏底板
* extendColumns: true, // 扩展挡板
* columnSpacing: 1, // 支脚跨越
* bays: [ // 每列的配置
* {
* bayWidth: 1.6, // 列的宽度
* levelHeight: [ 1.4, 1.4, 1.4 ] // 每层的高度
* },
* {bayWidth: 1.6, levelHeight: [ 1.4, 1.4, 1.4 ]},
* {bayWidth: 1.6, levelHeight: [ 1.4, 1.4, 1.4 ]},
* {bayWidth: 1.6, levelHeight: [ 1.4, 1.4, 1.4 ]},
* {bayWidth: 1.6, levelHeight: [ 1.4, 1.4, 1.4 ]},
* ]
* }
* }
*
*
*
*
*
*
*
*/
{ field: 'tf', editor: 'InOutCenterEditor', category: 'basic' },
{ field: 'dt.selectable', editor: 'Switch', label: '可选中', category: 'basic' },
{ field: 'dt.protected', editor: 'Switch', label: '受保护', category: 'basic' },
{ field: 'visible', editor: 'Switch', label: '可见', category: 'basic' }
] as IMeta

97
src/modules/clx/ClxRenderer.ts

@ -0,0 +1,97 @@
import * as THREE from 'three'
import BaseRenderer from '@/core/base/BaseRenderer.ts'
import { Line2 } from 'three/examples/jsm/lines/Line2.js'
import { LineGeometry } from 'three/examples/jsm/lines/LineGeometry.js'
import { LineMaterial } from 'three/examples/jsm/lines/LineMaterial.js'
import {decimalSumBy} from "@/core/ModelUtils";
import Constract from '@/core/Constract.ts'
import clxUrl from '@/assets/images/ptr/clx.png'
/**
* clx渲染器
*/
export default class ClxRenderer extends BaseRenderer {
static POINT_NAME = 'clx'
pointMaterial: THREE.Material
/**
* ,
*/
readonly defulePositionY: number = Constract.HEIGHT_WAY
readonly defaultScale: THREE.Vector3 = new THREE.Vector3(1, 1, 1)
readonly defaultRotation: THREE.Vector3 = new THREE.Vector3(0, 0, 0)
readonly defaultLineWidth: number = 0.15
constructor(itemTypeName: string) {
super(itemTypeName)
}
/**
* 使 storeWidth/storeDepth, TF无效
*/
override afterCreateOrUpdatePoint(item: ItemJson, option: RendererCudOption, objects: THREE.Object3D[]) {
super.afterCreateOrUpdatePoint(item, option, objects)
const point = objects[0]
// point.position.y = this.defulePositionY
// point.scale.set(_.sumBy(item.dt.bays, b=>b.bayWidth), this.defaultScale.y, item.dt.rackDepth)
point.rotation.set(
THREE.MathUtils.degToRad(item.tf[1][0]),
THREE.MathUtils.degToRad(item.tf[1][1]),
THREE.MathUtils.degToRad(item.tf[1][2])
)
}
createLineBasic(start: ItemJson, end: ItemJson, type: LinkType): THREE.Object3D[] {
throw new Error('not allow store line.')
}
updateLine(start: ItemJson, end: ItemJson, type: LinkType, option?: RendererCudOption) {
throw new Error('not allow store line.')
}
createPoint(item: ItemJson, option?: RendererCudOption): THREE.Object3D[] {
// 创建平面几何体
if (!item.dt.clxWidth || !item.dt.clxDepth) {
return []
}
const textureLoader = new THREE.TextureLoader()
const texture = textureLoader.load(clxUrl)
const group = new THREE.Group()
group.name = ClxRenderer.POINT_NAME
// 绘制背景矩形框
const planeGeometry = new THREE.PlaneGeometry(item.dt.clxWidth, item.dt.clxDepth);
planeGeometry.rotateX(-Math.PI / 2)
const planeMaterial = new THREE.MeshLambertMaterial({
map: texture, // 颜色贴图
transparent: true, // 允许透明纹理
});
const planeMesh = new THREE.Mesh(planeGeometry, planeMaterial);
group.add(planeMesh)
// 设置位置
group.position.set(item.tf[0][0], item.tf[0][1], item.tf[0][2])
const points = [group]
this.fillObjectUserDataFromItem(item, ...points)
this.afterCreateOrUpdatePoint(item, option, points)
this.tempViewport.entityManager.appendObject(item.id, points)
this.appendToScene(...points)
return points
}
dispose() {
super.dispose()
this.pointMaterial?.dispose()
}
createPointBasic(item: ItemJson, option?: RendererCudOption): Object3D[] {
return [];
}
}

15
src/modules/clx/index.ts

@ -0,0 +1,15 @@
import { defineModule } from '@/core/manager/ModuleManager.ts'
import ClxRenderer from './ClxRenderer.ts'
import ClxEntity from './ClxEntity.ts'
import ClxMeta from './ClxMeta.ts'
import ClxInteraction from './ClxInteraction.ts'
export const ITEM_TYPE_NAME = 'clx'
export default defineModule({
name: ITEM_TYPE_NAME,
renderer: new ClxRenderer(ITEM_TYPE_NAME),
interaction: new ClxInteraction(ITEM_TYPE_NAME),
meta: ClxMeta,
entity: ClxEntity
})

6
src/modules/gstore/GstoreRenderer.ts

@ -35,9 +35,9 @@ export default class GstoreRenderer extends BaseRenderer {
point.position.y = this.defulePositionY
// point.scale.set(item.dt.storeWidth, this.defaultScale.y, item.dt.storeDepth)
point.rotation.set(
THREE.MathUtils.degToRad(this.defaultRotation.x),
THREE.MathUtils.degToRad(this.defaultRotation.y),
THREE.MathUtils.degToRad(this.defaultRotation.z)
THREE.MathUtils.degToRad(item.tf[1][0]),
THREE.MathUtils.degToRad(item.tf[1][1]),
THREE.MathUtils.degToRad(item.tf[1][2])
)
}

6
src/modules/pallet/PalletRenderer.ts

@ -37,9 +37,9 @@ export default class PalletRenderer extends BaseRenderer {
//point.scale.set(_.sumBy(item.dt.bays, b=>b.bayWidth), this.defaultScale.y, item.dt.rackDepth)
point.rotation.set(
THREE.MathUtils.degToRad(this.defaultRotation.x),
THREE.MathUtils.degToRad(this.defaultRotation.y),
THREE.MathUtils.degToRad(this.defaultRotation.z)
THREE.MathUtils.degToRad(item.tf[1][0]),
THREE.MathUtils.degToRad(item.tf[1][1]),
THREE.MathUtils.degToRad(item.tf[1][2])
)
}

4
src/modules/ptr/PtrMeta.ts

@ -8,8 +8,8 @@ export default [
{ field: 'dt.color', editor: 'Color', label: '颜色', category: 'basic' },
{ editor: '-', category: 'basic' },
{ field: 'dt.palletWidth', editor: 'NumberInput', label: '托盘深度', category: 'basic' },
{ field: 'dt.palletDepth', editor: 'NumberInput', label: '托盘深度', category: 'basic' },
{ field: 'dt.ptrWidth', editor: 'NumberInput', label: 'PTR宽度', category: 'basic' },
{ field: 'dt.ptrDepth', editor: 'NumberInput', label: 'PTR深度', category: 'basic' },
/**
* dt.bays 53
* {

7
src/modules/ptr/PtrRenderer.ts

@ -37,9 +37,9 @@ export default class PtrRenderer extends BaseRenderer {
// point.position.y = this.defulePositionY
// point.scale.set(_.sumBy(item.dt.bays, b=>b.bayWidth), this.defaultScale.y, item.dt.rackDepth)
point.rotation.set(
THREE.MathUtils.degToRad(this.defaultRotation.x),
THREE.MathUtils.degToRad(this.defaultRotation.y),
THREE.MathUtils.degToRad(this.defaultRotation.z)
THREE.MathUtils.degToRad(item.tf[1][0]),
THREE.MathUtils.degToRad(item.tf[1][1]),
THREE.MathUtils.degToRad(item.tf[1][2])
)
}
@ -68,7 +68,6 @@ export default class PtrRenderer extends BaseRenderer {
// 绘制背景矩形框
const planeGeometry = new THREE.PlaneGeometry(item.dt.ptrWidth, item.dt.ptrDepth);
planeGeometry.rotateX(-Math.PI / 2)
planeGeometry.rotateY(-Math.PI / 2)
const planeMaterial = new THREE.MeshLambertMaterial({
map: texture, // 颜色贴图
transparent: true, // 允许透明纹理

6
src/modules/rack/RackRenderer.ts

@ -37,9 +37,9 @@ export default class RackRenderer extends BaseRenderer {
//point.scale.set(_.sumBy(item.dt.bays, b=>b.bayWidth), this.defaultScale.y, item.dt.rackDepth)
point.rotation.set(
THREE.MathUtils.degToRad(this.defaultRotation.x),
THREE.MathUtils.degToRad(this.defaultRotation.y),
THREE.MathUtils.degToRad(this.defaultRotation.z)
THREE.MathUtils.degToRad(item.tf[1][0]),
THREE.MathUtils.degToRad(item.tf[1][1]),
THREE.MathUtils.degToRad(item.tf[1][2])
)
}

Loading…
Cancel
Save