@jnrs/lingshu-smart 2.2.8 → 2.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/App.vue.d.ts +1 -2
- package/dist/assets/data/editor_default_setting.d.ts +1 -8
- package/dist/assets/data/editor_preset_menu.d.ts +1 -8
- package/dist/components/editor/ControlBar/CaseManger.vue.d.ts +15 -3
- package/dist/components/editor/ControlBar/CaseTitleEdit.vue.d.ts +411 -2
- package/dist/components/editor/ControlBar/ExportImportDialog.vue.d.ts +2 -3
- package/dist/components/editor/ControlBar/MainButton.vue.d.ts +2 -3
- package/dist/components/editor/ControlBar/StepButton.vue.d.ts +1 -2
- package/dist/components/editor/ControlBar/StepRecordVisualizer.vue.d.ts +1 -2
- package/dist/components/editor/DrawingBoard.vue.d.ts +1 -2
- package/dist/components/editor/MenuCard/Equipments.vue.d.ts +1 -2
- package/dist/components/editor/MenuCard/Layers.vue.d.ts +1 -2
- package/dist/components/editor/MenuCard/index.vue.d.ts +1 -2
- package/dist/components/editor/OptionCard/Equipment/Base.vue.d.ts +1 -2
- package/dist/components/editor/OptionCard/Equipment/DataSets.vue.d.ts +1 -2
- package/dist/components/editor/OptionCard/Equipment/Interaction.vue.d.ts +1 -2
- package/dist/components/editor/OptionCard/Equipment/Position.vue.d.ts +1 -2
- package/dist/components/editor/OptionCard/Equipment/StationSlotGroup.vue.d.ts +1 -2
- package/dist/components/editor/OptionCard/Equipment/index.vue.d.ts +1 -2
- package/dist/components/editor/OptionCard/Equipment/models/MachineTool.vue.d.ts +1 -2
- package/dist/components/editor/OptionCard/Equipment/models/Rail.vue.d.ts +1 -2
- package/dist/components/editor/OptionCard/Equipment/models/SingleJointRobot.vue.d.ts +2 -0
- package/dist/components/editor/OptionCard/Scene/Background.vue.d.ts +1 -2
- package/dist/components/editor/OptionCard/Scene/index.vue.d.ts +1 -2
- package/dist/components/editor/OptionCard/index.vue.d.ts +1 -2
- package/dist/components/editor/index.vue.d.ts +13 -4
- package/dist/components/index.d.ts +2 -2
- package/dist/components/index.js +27281 -4
- package/dist/components/preview/index.vue.d.ts +5 -6
- package/dist/composables/useStepRecord.d.ts +4 -12
- package/dist/constants/options.d.ts +1 -8
- package/dist/controller/AppController.d.ts +3 -10
- package/dist/controller/EditorController.d.ts +2 -9
- package/dist/index.js +1 -1
- package/dist/json/cases.json +577 -20
- package/dist/locales/i18next.d.ts +1 -1
- package/dist/locales/index.d.ts +2 -2
- package/dist/locales/index.js +13 -3
- package/dist/main.d.ts +0 -3
- package/dist/playground/EditPageDemo.vue.d.ts +1 -2
- package/dist/playground/ViewPageDemo.vue.d.ts +27 -2
- package/dist/stores/useAppStore.d.ts +5 -12
- package/dist/stores/useDataStore.d.ts +11 -18
- package/dist/stores/useEditorStore.d.ts +20 -27
- package/dist/types/app.types.d.ts +1 -1
- package/dist/types/base.types.d.ts +1 -1
- package/dist/types/components/config.types.d.ts +1 -1
- package/dist/types/components/operating.types.d.ts +1 -1
- package/dist/types/enums.d.ts +1 -1
- package/dist/types/guards.d.ts +5 -12
- package/dist/types/index.d.ts +2 -2
- package/dist/types/models/config.types.d.ts +49 -47
- package/dist/types/models/operating.types.d.ts +53 -53
- package/dist/ui/abstract/ComponentAbs.d.ts +2 -9
- package/dist/ui/abstract/ModelAbs.d.ts +2 -10
- package/dist/ui/components/Entrance.d.ts +1 -8
- package/dist/ui/components/Light.d.ts +1 -8
- package/dist/ui/components/Progress.d.ts +1 -8
- package/dist/ui/components/Resource.d.ts +1 -8
- package/dist/ui/components/StationSlot.d.ts +1 -23
- package/dist/ui/components/StationSlotGroup.d.ts +1 -8
- package/dist/ui/factories/createGlass.d.ts +0 -6
- package/dist/ui/factories/createModel.d.ts +2 -9
- package/dist/ui/factories/createShadow.d.ts +1 -9
- package/dist/ui/factories/createText.d.ts +0 -7
- package/dist/ui/models/CleaningMachine.d.ts +1 -1
- package/dist/ui/models/DoubleJointRobot.d.ts +19 -20
- package/dist/ui/models/LoadingStation.d.ts +1 -1
- package/dist/ui/models/MachineTool.d.ts +1 -1
- package/dist/ui/models/MarkingMachine.d.ts +1 -1
- package/dist/ui/models/Rail.d.ts +1 -1
- package/dist/ui/models/ResourceStore.d.ts +1 -1
- package/dist/ui/models/SingleJointRobot.d.ts +3 -3
- package/dist/ui/shapes/NamePlate.d.ts +0 -7
- package/dist/ui/shapes/ScrewHole.d.ts +0 -7
- package/dist/ui/shapes/Texture.d.ts +1 -8
- package/dist/ui/utils/attr.d.ts +2 -9
- package/dist/utils/type-guards.d.ts +1 -1
- package/package.json +3 -3
- package/dist/App.vue.js +0 -30
- package/dist/assets/data/editor_default.d.ts +0 -16
- package/dist/assets/data/editor_default.js +0 -59
- package/dist/assets/data/editor_default_setting.js +0 -58
- package/dist/assets/data/editor_preset.d.ts +0 -9
- package/dist/assets/data/editor_preset.js +0 -51
- package/dist/assets/data/editor_preset_menu.js +0 -290
- package/dist/components/editor/ControlBar/CaseManger.vue.js +0 -465
- package/dist/components/editor/ControlBar/CaseTitleEdit.vue.js +0 -108
- package/dist/components/editor/ControlBar/ExportImportDialog.vue.js +0 -280
- package/dist/components/editor/ControlBar/MainButton.vue.js +0 -183
- package/dist/components/editor/ControlBar/StepButton.vue.js +0 -147
- package/dist/components/editor/ControlBar/StepRecordVisualizer.vue.js +0 -98
- package/dist/components/editor/DrawingBoard.vue.js +0 -31
- package/dist/components/editor/MenuCard/Equipments.vue.js +0 -129
- package/dist/components/editor/MenuCard/Layers.vue.js +0 -201
- package/dist/components/editor/MenuCard/index.vue.js +0 -84
- package/dist/components/editor/OptionCard/Equipment/Base.vue.js +0 -96
- package/dist/components/editor/OptionCard/Equipment/Binds.vue.d.ts +0 -3
- package/dist/components/editor/OptionCard/Equipment/Binds.vue.js +0 -443
- package/dist/components/editor/OptionCard/Equipment/Bot.vue.d.ts +0 -3
- package/dist/components/editor/OptionCard/Equipment/Bot.vue.js +0 -81
- package/dist/components/editor/OptionCard/Equipment/DataSets.vue.js +0 -304
- package/dist/components/editor/OptionCard/Equipment/DockStore.vue.d.ts +0 -3
- package/dist/components/editor/OptionCard/Equipment/DockStore.vue.js +0 -597
- package/dist/components/editor/OptionCard/Equipment/Interaction.vue.js +0 -287
- package/dist/components/editor/OptionCard/Equipment/Position.backup.vue.d.ts +0 -3
- package/dist/components/editor/OptionCard/Equipment/Position.backup.vue.js +0 -440
- package/dist/components/editor/OptionCard/Equipment/Position.vue.js +0 -436
- package/dist/components/editor/OptionCard/Equipment/StationSlotGroup.vue.js +0 -1131
- package/dist/components/editor/OptionCard/Equipment/Store.vue.d.ts +0 -3
- package/dist/components/editor/OptionCard/Equipment/Store.vue.js +0 -453
- package/dist/components/editor/OptionCard/Equipment/Trailer.vue.d.ts +0 -3
- package/dist/components/editor/OptionCard/Equipment/Trailer.vue.js +0 -1109
- package/dist/components/editor/OptionCard/Equipment/index.vue.js +0 -100
- package/dist/components/editor/OptionCard/Equipment/models/MachineTool.vue.js +0 -99
- package/dist/components/editor/OptionCard/Equipment/models/Rail.vue.js +0 -225
- package/dist/components/editor/OptionCard/Equipment/models/SingleGripperRobot.vue.d.ts +0 -3
- package/dist/components/editor/OptionCard/Equipment/models/SingleGripperRobot.vue.js +0 -99
- package/dist/components/editor/OptionCard/Scene/Background.vue.js +0 -543
- package/dist/components/editor/OptionCard/Scene/index.vue.js +0 -200
- package/dist/components/editor/OptionCard/index.vue.js +0 -73
- package/dist/components/editor/index.vue.js +0 -156
- package/dist/components/preview/index.vue.js +0 -104
- package/dist/composables/useStepRecord.js +0 -135
- package/dist/constants/options.js +0 -55
- package/dist/controller/AppController.js +0 -168
- package/dist/controller/EditorController.js +0 -173
- package/dist/locales/en.js +0 -5
- package/dist/locales/i18next.js +0 -6
- package/dist/locales/zhCn.js +0 -5
- package/dist/main.js +0 -13
- package/dist/playground/EditPageDemo.vue.js +0 -57
- package/dist/playground/ViewPageDemo.vue.js +0 -277
- package/dist/stores/index.js +0 -3
- package/dist/stores/useAppStore.js +0 -78
- package/dist/stores/useDataStore.js +0 -116
- package/dist/stores/useEditorStore.js +0 -263
- package/dist/types/app.types.js +0 -2
- package/dist/types/base.types.js +0 -1
- package/dist/types/components/config.types.js +0 -1
- package/dist/types/components/operating.types.js +0 -1
- package/dist/types/enums.js +0 -46
- package/dist/types/guards.js +0 -28
- package/dist/types/index.js +0 -8
- package/dist/types/models/config.types.js +0 -1
- package/dist/types/models/operating.types.js +0 -1
- package/dist/ui/abstract/ComponentAbs.js +0 -64
- package/dist/ui/abstract/ModelAbs.js +0 -119
- package/dist/ui/components/Entrance.js +0 -83
- package/dist/ui/components/Light.js +0 -167
- package/dist/ui/components/Progress.js +0 -84
- package/dist/ui/components/Resource.js +0 -70
- package/dist/ui/components/StationSlot.js +0 -207
- package/dist/ui/components/StationSlotGroup.js +0 -110
- package/dist/ui/factories/createGlass.js +0 -51
- package/dist/ui/factories/createModel.js +0 -35
- package/dist/ui/factories/createShadow.js +0 -52
- package/dist/ui/factories/createText.js +0 -46
- package/dist/ui/models/CleaningMachine.js +0 -141
- package/dist/ui/models/DoubleJointRobot.js +0 -545
- package/dist/ui/models/LoadingStation.js +0 -167
- package/dist/ui/models/MachineTool.js +0 -184
- package/dist/ui/models/MarkingMachine.js +0 -148
- package/dist/ui/models/Rail.js +0 -117
- package/dist/ui/models/ResourceStore.js +0 -101
- package/dist/ui/models/SingleBot.d.ts +0 -20
- package/dist/ui/models/SingleBot.js +0 -202
- package/dist/ui/models/SingleGripperRobot.d.ts +0 -19
- package/dist/ui/models/SingleGripperRobot.js +0 -272
- package/dist/ui/models/SingleJointRobot.js +0 -346
- package/dist/ui/shapes/NamePlate.js +0 -85
- package/dist/ui/shapes/ScrewHole.js +0 -57
- package/dist/ui/shapes/Texture.js +0 -51
- package/dist/ui/utils/attr.js +0 -50
- package/dist/utils/index.js +0 -92
- package/dist/utils/type-guards.js +0 -105
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
import { Box } from 'leafer';
|
|
2
|
-
import { ModelAbs } from '../abstract/ModelAbs';
|
|
3
|
-
import { EllipseLight } from '../components/Light';
|
|
4
|
-
import { Progress } from '../components/Progress';
|
|
5
|
-
import { Entrance } from '../components/Entrance';
|
|
6
|
-
import { StationSlotGroup } from '../components/StationSlotGroup';
|
|
7
|
-
import { createGlass } from '../factories/createGlass';
|
|
8
|
-
import { NamePlate } from '../shapes/NamePlate';
|
|
9
|
-
import { setCursor } from '../utils/attr';
|
|
10
|
-
/**
|
|
11
|
-
* 机床
|
|
12
|
-
*/
|
|
13
|
-
export class MachineTool extends ModelAbs {
|
|
14
|
-
static STATION_OFFSET = 16;
|
|
15
|
-
light = null;
|
|
16
|
-
progress = null;
|
|
17
|
-
entrance = null;
|
|
18
|
-
stationSlotGroup = null;
|
|
19
|
-
stationContainer = null;
|
|
20
|
-
stationContainerBaseRotation = 0; // 基础工位容器旋转角度
|
|
21
|
-
// 创建 UI
|
|
22
|
-
createUi() {
|
|
23
|
-
const {
|
|
24
|
-
// 基础属性
|
|
25
|
-
uuid, className, nameplate, stationSlotGroup, stationContainerDirection,
|
|
26
|
-
// 位置与变换
|
|
27
|
-
width, height, x, y, zIndex, rotation, scale,
|
|
28
|
-
// 交互控制
|
|
29
|
-
visible, editable, draggable } = this.config;
|
|
30
|
-
this.stationContainerBaseRotation = stationContainerDirection === 'vertical' ? 90 : 0;
|
|
31
|
-
// 指示灯
|
|
32
|
-
this.light = new EllipseLight({
|
|
33
|
-
x: this.width_05,
|
|
34
|
-
y: 30,
|
|
35
|
-
width: this.width_02,
|
|
36
|
-
height: this.width_02,
|
|
37
|
-
showShadow: true
|
|
38
|
-
}).init();
|
|
39
|
-
// 出入口
|
|
40
|
-
this.entrance = new Entrance({
|
|
41
|
-
x: this.width_05,
|
|
42
|
-
y: -2,
|
|
43
|
-
width,
|
|
44
|
-
height: this.width_02,
|
|
45
|
-
isIn: false,
|
|
46
|
-
isOut: false
|
|
47
|
-
}).init();
|
|
48
|
-
// 进度条
|
|
49
|
-
this.progress = new Progress({
|
|
50
|
-
x: this.width_05,
|
|
51
|
-
y: height - 74,
|
|
52
|
-
width: this.width_08,
|
|
53
|
-
height: 20,
|
|
54
|
-
progress: 0
|
|
55
|
-
}).init();
|
|
56
|
-
this.stationContainer = new Box({
|
|
57
|
-
className: 'StationContainer',
|
|
58
|
-
x: this.width_05,
|
|
59
|
-
y: this.height_05 - MachineTool.STATION_OFFSET,
|
|
60
|
-
width: this.width_05,
|
|
61
|
-
height: 66,
|
|
62
|
-
around: 'center',
|
|
63
|
-
rotation: this.stationContainerBaseRotation,
|
|
64
|
-
children: [
|
|
65
|
-
createGlass({
|
|
66
|
-
around: 'top-left',
|
|
67
|
-
width: this.width_05,
|
|
68
|
-
height: 66,
|
|
69
|
-
cornerRadius: 10
|
|
70
|
-
})
|
|
71
|
-
]
|
|
72
|
-
});
|
|
73
|
-
// 主容器
|
|
74
|
-
const main = new Box({
|
|
75
|
-
visible,
|
|
76
|
-
editable,
|
|
77
|
-
draggable,
|
|
78
|
-
data: this.config,
|
|
79
|
-
id: uuid,
|
|
80
|
-
className,
|
|
81
|
-
zIndex,
|
|
82
|
-
width,
|
|
83
|
-
height,
|
|
84
|
-
x,
|
|
85
|
-
y,
|
|
86
|
-
rotation,
|
|
87
|
-
scale,
|
|
88
|
-
cornerRadius: 8,
|
|
89
|
-
fill: '#DADEE7',
|
|
90
|
-
origin: 'center',
|
|
91
|
-
around: 'center',
|
|
92
|
-
shadow: {
|
|
93
|
-
spread: 1,
|
|
94
|
-
blur: 4,
|
|
95
|
-
color: 'rgba(0,0,0,0.5)'
|
|
96
|
-
},
|
|
97
|
-
children: [
|
|
98
|
-
new Box({
|
|
99
|
-
hittable: false,
|
|
100
|
-
x: 0,
|
|
101
|
-
y: height - 60,
|
|
102
|
-
width: width,
|
|
103
|
-
height: 60,
|
|
104
|
-
zIndex: 0,
|
|
105
|
-
fill: '#232323',
|
|
106
|
-
cornerRadius: [0, 0, 8, 8]
|
|
107
|
-
}),
|
|
108
|
-
this.light.ui,
|
|
109
|
-
this.entrance.ui,
|
|
110
|
-
this.progress.ui,
|
|
111
|
-
this.stationContainer
|
|
112
|
-
]
|
|
113
|
-
});
|
|
114
|
-
// 创建工位槽位数组
|
|
115
|
-
if (stationSlotGroup) {
|
|
116
|
-
this.stationSlotGroup = new StationSlotGroup({
|
|
117
|
-
...stationSlotGroup,
|
|
118
|
-
x: this.width_05,
|
|
119
|
-
y: this.height_05 - MachineTool.STATION_OFFSET,
|
|
120
|
-
width: this.width_05,
|
|
121
|
-
height: this.width_05,
|
|
122
|
-
rotation: this.stationContainerBaseRotation,
|
|
123
|
-
hittable: this.config.hittable
|
|
124
|
-
}, this.config.rotation).init();
|
|
125
|
-
main.add(this.stationSlotGroup.ui);
|
|
126
|
-
}
|
|
127
|
-
setCursor(main, this.config);
|
|
128
|
-
// 名牌
|
|
129
|
-
if (nameplate) {
|
|
130
|
-
main.add(NamePlate({
|
|
131
|
-
title: nameplate,
|
|
132
|
-
x: this.width_05,
|
|
133
|
-
y: height - 30,
|
|
134
|
-
height: 20
|
|
135
|
-
}));
|
|
136
|
-
}
|
|
137
|
-
return main;
|
|
138
|
-
}
|
|
139
|
-
// 操作
|
|
140
|
-
operating(data) {
|
|
141
|
-
if (data.light && this.light) {
|
|
142
|
-
this.light.operating(data.light);
|
|
143
|
-
}
|
|
144
|
-
if (data.progress && this.progress) {
|
|
145
|
-
this.progress.operating(data.progress);
|
|
146
|
-
}
|
|
147
|
-
if (data.entrance && this.entrance) {
|
|
148
|
-
this.entrance.operating(data.entrance);
|
|
149
|
-
}
|
|
150
|
-
if (data.resource && this.stationSlotGroup) {
|
|
151
|
-
this.stationSlotGroup.operating(data.resource);
|
|
152
|
-
}
|
|
153
|
-
if (Object.hasOwn(data, 'stationRotatable')) {
|
|
154
|
-
if (data.stationRotatable) {
|
|
155
|
-
this.rotateStationContainerWithAnimation('rotate');
|
|
156
|
-
}
|
|
157
|
-
else {
|
|
158
|
-
this.rotateStationContainerWithAnimation('reset');
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
// 工位旋转/回转动画
|
|
163
|
-
rotateStationContainerWithAnimation(mode) {
|
|
164
|
-
if (!this.stationContainer)
|
|
165
|
-
return;
|
|
166
|
-
let rotation = this.stationContainerBaseRotation;
|
|
167
|
-
if (mode === 'rotate') {
|
|
168
|
-
rotation += 180;
|
|
169
|
-
}
|
|
170
|
-
else {
|
|
171
|
-
rotation = this.stationContainerBaseRotation;
|
|
172
|
-
}
|
|
173
|
-
this.stationContainer.animate({
|
|
174
|
-
rotation,
|
|
175
|
-
duration: 0.5,
|
|
176
|
-
easing: 'ease'
|
|
177
|
-
});
|
|
178
|
-
this.stationSlotGroup?.ui.animate({
|
|
179
|
-
rotation,
|
|
180
|
-
duration: 0.5,
|
|
181
|
-
easing: 'ease'
|
|
182
|
-
});
|
|
183
|
-
}
|
|
184
|
-
}
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import { Box } from 'leafer';
|
|
2
|
-
import { ModelAbs } from '../abstract/ModelAbs';
|
|
3
|
-
import { Entrance } from '../components/Entrance';
|
|
4
|
-
import { EllipseLight } from '../components/Light';
|
|
5
|
-
import { Progress } from '../components/Progress';
|
|
6
|
-
import { StationSlotGroup } from '../components/StationSlotGroup';
|
|
7
|
-
import { NamePlate } from '../shapes/NamePlate';
|
|
8
|
-
import { setCursor } from '../utils/attr';
|
|
9
|
-
/**
|
|
10
|
-
* 打标机
|
|
11
|
-
*/
|
|
12
|
-
export class MarkingMachine extends ModelAbs {
|
|
13
|
-
light = null;
|
|
14
|
-
progress = null;
|
|
15
|
-
entrance = null;
|
|
16
|
-
stationSlotGroup = null;
|
|
17
|
-
createUi() {
|
|
18
|
-
const { uuid, className, nameplate, stationSlotGroup, width, height, x, y, zIndex, rotation, scale, visible, editable, draggable } = this.config;
|
|
19
|
-
this.entrance = new Entrance({
|
|
20
|
-
x: this.width_05,
|
|
21
|
-
y: -2,
|
|
22
|
-
width,
|
|
23
|
-
height: this.width_02,
|
|
24
|
-
isIn: false,
|
|
25
|
-
isOut: false
|
|
26
|
-
}).init();
|
|
27
|
-
this.light = new EllipseLight({
|
|
28
|
-
x: this.width_05,
|
|
29
|
-
y: 30,
|
|
30
|
-
width: this.width_02,
|
|
31
|
-
height: this.width_02,
|
|
32
|
-
showShadow: true
|
|
33
|
-
}).init();
|
|
34
|
-
this.progress = new Progress({
|
|
35
|
-
x: this.width_05,
|
|
36
|
-
y: height - 40,
|
|
37
|
-
width: this.width_08,
|
|
38
|
-
height: 20,
|
|
39
|
-
progress: 0
|
|
40
|
-
}).init();
|
|
41
|
-
const laserBar = new Box({
|
|
42
|
-
hittable: false,
|
|
43
|
-
width: this.width_05,
|
|
44
|
-
height: 5,
|
|
45
|
-
y: 32,
|
|
46
|
-
x: this.width_05,
|
|
47
|
-
around: 'center',
|
|
48
|
-
fill: '#7B8395',
|
|
49
|
-
shadow: {
|
|
50
|
-
blur: 2,
|
|
51
|
-
color: 'rgba(0,0,0,0.5)'
|
|
52
|
-
},
|
|
53
|
-
children: [this.renderLaser('laser1', 0), this.renderLaser('laser2', this.width_05)]
|
|
54
|
-
});
|
|
55
|
-
const main = new Box({
|
|
56
|
-
data: this.config,
|
|
57
|
-
id: uuid,
|
|
58
|
-
className,
|
|
59
|
-
x,
|
|
60
|
-
y,
|
|
61
|
-
width,
|
|
62
|
-
height,
|
|
63
|
-
zIndex,
|
|
64
|
-
rotation,
|
|
65
|
-
scale,
|
|
66
|
-
visible,
|
|
67
|
-
editable,
|
|
68
|
-
draggable,
|
|
69
|
-
origin: 'center',
|
|
70
|
-
around: 'center',
|
|
71
|
-
cornerRadius: 4,
|
|
72
|
-
fill: '#ECEEF0',
|
|
73
|
-
shadow: {
|
|
74
|
-
spread: 1,
|
|
75
|
-
blur: 4,
|
|
76
|
-
color: 'rgba(0,0,0,0.5)'
|
|
77
|
-
},
|
|
78
|
-
children: [laserBar, this.entrance.ui, this.light.ui, this.progress.ui]
|
|
79
|
-
});
|
|
80
|
-
if (stationSlotGroup) {
|
|
81
|
-
this.stationSlotGroup = new StationSlotGroup({
|
|
82
|
-
...stationSlotGroup,
|
|
83
|
-
x: this.width_05,
|
|
84
|
-
y: this.height_05,
|
|
85
|
-
width,
|
|
86
|
-
height,
|
|
87
|
-
hittable: this.config.hittable
|
|
88
|
-
}, this.config.rotation).init();
|
|
89
|
-
main.add(this.stationSlotGroup.ui);
|
|
90
|
-
}
|
|
91
|
-
if (nameplate) {
|
|
92
|
-
main.add(NamePlate({
|
|
93
|
-
title: nameplate,
|
|
94
|
-
x: this.width_05,
|
|
95
|
-
y: height - 14,
|
|
96
|
-
stroke: 'rgba(0,0,0,0.05)'
|
|
97
|
-
}));
|
|
98
|
-
}
|
|
99
|
-
setCursor(main, this.config);
|
|
100
|
-
return main;
|
|
101
|
-
}
|
|
102
|
-
operating(data) {
|
|
103
|
-
if (data.light && this.light)
|
|
104
|
-
this.light.operating(data.light);
|
|
105
|
-
if (data.progress && this.progress)
|
|
106
|
-
this.progress.operating(data.progress);
|
|
107
|
-
if (data.entrance && this.entrance)
|
|
108
|
-
this.entrance.operating(data.entrance);
|
|
109
|
-
if (data.resource && this.stationSlotGroup)
|
|
110
|
-
this.stationSlotGroup.operating(data.resource);
|
|
111
|
-
if (data.laserSiteNumberArray?.length)
|
|
112
|
-
this.setLaserWorking(data.laserSiteNumberArray);
|
|
113
|
-
}
|
|
114
|
-
// 渲染激光
|
|
115
|
-
renderLaser(className, x) {
|
|
116
|
-
return new Box({
|
|
117
|
-
width: 14,
|
|
118
|
-
height: 40,
|
|
119
|
-
x,
|
|
120
|
-
y: 18,
|
|
121
|
-
around: 'center',
|
|
122
|
-
fill: '#7B8395',
|
|
123
|
-
cornerRadius: [0, 0, 8, 8],
|
|
124
|
-
shadow: {
|
|
125
|
-
blur: 2,
|
|
126
|
-
color: 'rgba(0,0,0,0.5)'
|
|
127
|
-
},
|
|
128
|
-
children: [
|
|
129
|
-
new Box({
|
|
130
|
-
className,
|
|
131
|
-
visible: false,
|
|
132
|
-
width: 16,
|
|
133
|
-
height: 40,
|
|
134
|
-
cornerRadius: [0, 0, 8, 8],
|
|
135
|
-
fill: '#94A6D2'
|
|
136
|
-
})
|
|
137
|
-
]
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
// 设置激光工作状态
|
|
141
|
-
setLaserWorking(laserSiteNumberArray) {
|
|
142
|
-
laserSiteNumberArray.forEach((element) => {
|
|
143
|
-
this.ui.findOne(`.laser${element.site}`)?.set({
|
|
144
|
-
visible: element.active
|
|
145
|
-
});
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
}
|
package/dist/ui/models/Rail.js
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import { Box, hitType } from 'leafer';
|
|
2
|
-
import { ModelAbs } from '../abstract/ModelAbs';
|
|
3
|
-
import { Texture } from '../shapes/Texture';
|
|
4
|
-
import { setCursor } from '../utils/attr';
|
|
5
|
-
/**
|
|
6
|
-
* 轨道(Rail)
|
|
7
|
-
*/
|
|
8
|
-
export class Rail extends ModelAbs {
|
|
9
|
-
static DEFAULT_HEIGHT = 60;
|
|
10
|
-
chains = new Map();
|
|
11
|
-
createUi() {
|
|
12
|
-
const { uuid, className, width, height = Rail.DEFAULT_HEIGHT, x, y, zIndex, rotation, scale, visible, editable, draggable } = this.config;
|
|
13
|
-
// 主容器
|
|
14
|
-
const main = new Box({
|
|
15
|
-
id: uuid,
|
|
16
|
-
data: this.config,
|
|
17
|
-
className,
|
|
18
|
-
x,
|
|
19
|
-
y,
|
|
20
|
-
width,
|
|
21
|
-
height,
|
|
22
|
-
zIndex,
|
|
23
|
-
rotation,
|
|
24
|
-
scale,
|
|
25
|
-
visible,
|
|
26
|
-
editable,
|
|
27
|
-
draggable,
|
|
28
|
-
around: 'center',
|
|
29
|
-
overflow: 'hidden',
|
|
30
|
-
fill: {
|
|
31
|
-
type: 'linear',
|
|
32
|
-
stops: [
|
|
33
|
-
{ offset: 0, color: 'rgba(238, 238, 238, 1)' },
|
|
34
|
-
{ offset: 0.1, color: 'rgba(221, 221, 221, 1)' },
|
|
35
|
-
{ offset: 0.1, color: 'rgba(197, 197, 197, 1)' },
|
|
36
|
-
{ offset: 0.2, color: 'rgba(197, 197, 197, 1)' },
|
|
37
|
-
{ offset: 0.2, color: 'rgba(238, 238, 238, 1)' },
|
|
38
|
-
{ offset: 0.8, color: 'rgba(238, 238, 238, 1)' },
|
|
39
|
-
{ offset: 0.8, color: 'rgba(197, 197, 197, 1)' },
|
|
40
|
-
{ offset: 0.9, color: 'rgba(197, 197, 197, 1)' },
|
|
41
|
-
{ offset: 0.9, color: 'rgba(238, 238, 238, 1)' },
|
|
42
|
-
{ offset: 1, color: 'rgba(238, 238, 238, 1)' }
|
|
43
|
-
]
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
this.initChains(main);
|
|
47
|
-
setCursor(main, this.config, 'border');
|
|
48
|
-
return main;
|
|
49
|
-
}
|
|
50
|
-
operating(data) {
|
|
51
|
-
if (data.x !== undefined && data.botId) {
|
|
52
|
-
this.moveChain(data.botId, data.x);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
// 初始化拖链
|
|
56
|
-
initChains(parent) {
|
|
57
|
-
const { linkEquipIdArray = [], chainDirection = 'left', height } = this.config;
|
|
58
|
-
linkEquipIdArray.forEach((botId) => {
|
|
59
|
-
const chain = this.createChain(botId, chainDirection, height);
|
|
60
|
-
this.chains.set(botId, chain);
|
|
61
|
-
parent.add(chain);
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
// 创建单个拖链
|
|
65
|
-
createChain(botId, chainDirection, height) {
|
|
66
|
-
const railW = this.config.width;
|
|
67
|
-
const chainBox = new Box({
|
|
68
|
-
hittable: false,
|
|
69
|
-
className: `Chain_${botId}`,
|
|
70
|
-
x: 0,
|
|
71
|
-
y: height / 2,
|
|
72
|
-
width: railW,
|
|
73
|
-
height: height * 0.5,
|
|
74
|
-
cornerRadius: 5,
|
|
75
|
-
around: 'left',
|
|
76
|
-
overflow: 'hide',
|
|
77
|
-
fill: '#555',
|
|
78
|
-
children: [
|
|
79
|
-
Texture({
|
|
80
|
-
width: railW,
|
|
81
|
-
height: height * 0.5,
|
|
82
|
-
effect: 'VerticalBar',
|
|
83
|
-
scale: 0.03
|
|
84
|
-
})
|
|
85
|
-
]
|
|
86
|
-
});
|
|
87
|
-
return chainBox;
|
|
88
|
-
}
|
|
89
|
-
// 移动拖链
|
|
90
|
-
moveChain(botId, x) {
|
|
91
|
-
if (!Number.isFinite(x))
|
|
92
|
-
return;
|
|
93
|
-
const chain = this.chains.get(botId);
|
|
94
|
-
if (!chain)
|
|
95
|
-
return;
|
|
96
|
-
const { chainDirection = 'left' } = this.config;
|
|
97
|
-
const railW = this.config.width;
|
|
98
|
-
const s = this.config.scale || 1;
|
|
99
|
-
const xLocal = Math.min(Math.max(x / s, 0), railW);
|
|
100
|
-
if (chainDirection === 'left') {
|
|
101
|
-
// 主容器内从左端 0 向右延伸至 x(本地宽度)
|
|
102
|
-
chain.animate({
|
|
103
|
-
x: 0,
|
|
104
|
-
width: xLocal,
|
|
105
|
-
duration: 0.5
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
else if (chainDirection === 'right') {
|
|
109
|
-
// 右端对齐轨道右缘,从左向右长度为 railW - x(本地宽度)
|
|
110
|
-
chain.animate({
|
|
111
|
-
x: xLocal,
|
|
112
|
-
width: Math.max(railW - xLocal, 0),
|
|
113
|
-
duration: 0.5
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { Box } from 'leafer';
|
|
2
|
-
import { ModelAbs } from '../abstract/ModelAbs';
|
|
3
|
-
import { StationSlotGroup } from '../components/StationSlotGroup';
|
|
4
|
-
import { NamePlate } from '../shapes/NamePlate';
|
|
5
|
-
import { Texture } from '../shapes/Texture';
|
|
6
|
-
import { setCursor } from '../utils/attr';
|
|
7
|
-
import { RectLight } from '../components/Light';
|
|
8
|
-
/**
|
|
9
|
-
* 资源库
|
|
10
|
-
*/
|
|
11
|
-
export class ResourceStore extends ModelAbs {
|
|
12
|
-
light = null;
|
|
13
|
-
stationSlotGroup = null;
|
|
14
|
-
createUi() {
|
|
15
|
-
const { uuid, className, nameplate, stationSlotGroup, width, height, x, y, zIndex, rotation, scale, visible, editable, draggable } = this.config;
|
|
16
|
-
const cornerRadius = [20, 20, 4, 4];
|
|
17
|
-
// 设备状态灯
|
|
18
|
-
this.light = new RectLight({
|
|
19
|
-
width: 40,
|
|
20
|
-
height: 6,
|
|
21
|
-
x: this.width_05,
|
|
22
|
-
y: 14,
|
|
23
|
-
color: '#2D313B'
|
|
24
|
-
}).init();
|
|
25
|
-
const main = new Box({
|
|
26
|
-
data: this.config,
|
|
27
|
-
id: uuid,
|
|
28
|
-
className,
|
|
29
|
-
x,
|
|
30
|
-
y,
|
|
31
|
-
width,
|
|
32
|
-
height,
|
|
33
|
-
zIndex,
|
|
34
|
-
rotation,
|
|
35
|
-
scale,
|
|
36
|
-
visible,
|
|
37
|
-
editable,
|
|
38
|
-
draggable,
|
|
39
|
-
origin: 'center',
|
|
40
|
-
around: 'center',
|
|
41
|
-
cornerRadius,
|
|
42
|
-
fill: {
|
|
43
|
-
type: 'linear',
|
|
44
|
-
from: 'left',
|
|
45
|
-
to: 'right',
|
|
46
|
-
stops: [
|
|
47
|
-
{ offset: 0, color: 'rgba(150,150,150,1)' },
|
|
48
|
-
{ offset: 0.1, color: 'rgba(220,220,220,1)' },
|
|
49
|
-
{ offset: 0.9, color: 'rgba(220,220,220,1)' },
|
|
50
|
-
{ offset: 1, color: 'rgba(150,150,150,1)' }
|
|
51
|
-
]
|
|
52
|
-
},
|
|
53
|
-
overflow: 'hide',
|
|
54
|
-
shadow: {
|
|
55
|
-
spread: 1,
|
|
56
|
-
blur: 4,
|
|
57
|
-
color: 'rgba(0,0,0,0.5)'
|
|
58
|
-
},
|
|
59
|
-
children: [
|
|
60
|
-
Texture({
|
|
61
|
-
className: 'ResourceStoreTexture',
|
|
62
|
-
width,
|
|
63
|
-
height,
|
|
64
|
-
effect: 'MatrixGrid',
|
|
65
|
-
scale: 0.015,
|
|
66
|
-
opacity: 0.2,
|
|
67
|
-
cornerRadius
|
|
68
|
-
}),
|
|
69
|
-
this.light.ui
|
|
70
|
-
]
|
|
71
|
-
});
|
|
72
|
-
if (stationSlotGroup) {
|
|
73
|
-
this.stationSlotGroup = new StationSlotGroup({
|
|
74
|
-
...stationSlotGroup,
|
|
75
|
-
x: this.width_05,
|
|
76
|
-
y: this.height_05,
|
|
77
|
-
hittable: this.config.hittable
|
|
78
|
-
}, this.config.rotation).init();
|
|
79
|
-
main.add(this.stationSlotGroup.ui);
|
|
80
|
-
}
|
|
81
|
-
if (nameplate) {
|
|
82
|
-
main.add(NamePlate({
|
|
83
|
-
title: nameplate,
|
|
84
|
-
x: this.width_05,
|
|
85
|
-
y: height - 14,
|
|
86
|
-
height: 20
|
|
87
|
-
}));
|
|
88
|
-
}
|
|
89
|
-
setCursor(main, this.config);
|
|
90
|
-
return main;
|
|
91
|
-
}
|
|
92
|
-
// 操作
|
|
93
|
-
operating(data) {
|
|
94
|
-
if (data.light && this.light) {
|
|
95
|
-
this.light.operating(data.light);
|
|
96
|
-
}
|
|
97
|
-
if (data.resource && this.stationSlotGroup) {
|
|
98
|
-
this.stationSlotGroup.operating(data.resource);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { ISingleJointRobotConfig, ISingleGripperRobotOperating } from '@/types'
|
|
2
|
-
import { Box } from 'leafer'
|
|
3
|
-
import { ModelAbs } from '../abstract/ModelAbs'
|
|
4
|
-
/**
|
|
5
|
-
* 单关节机器人(SingleBot)
|
|
6
|
-
* 基于 ModelAbs 重构,保留 Bot.js 核心运行行为:状态灯、沿 X 移动、手臂旋转、夹具切换。
|
|
7
|
-
*/
|
|
8
|
-
export declare class SingleBot extends ModelAbs<ISingleJointRobotConfig> {
|
|
9
|
-
private static readonly DEFAULT_WIDTH
|
|
10
|
-
private static readonly DEFAULT_HEIGHT
|
|
11
|
-
private static readonly DEFAULT_LIGHT_COLOR
|
|
12
|
-
private defaultLightColor
|
|
13
|
-
private armRotation
|
|
14
|
-
protected createUi(): Box
|
|
15
|
-
protected operating(data: ISingleGripperRobotOperating): void
|
|
16
|
-
private handleRotate
|
|
17
|
-
private moveX
|
|
18
|
-
private handleLight
|
|
19
|
-
private switchFixture
|
|
20
|
-
}
|