@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,202 +0,0 @@
|
|
|
1
|
-
import { Box } from 'leafer'
|
|
2
|
-
import { ModelAbs } from '../abstract/ModelAbs'
|
|
3
|
-
import { setCursor } from '../utils/attr'
|
|
4
|
-
import { NamePlate } from '../shapes/NamePlate'
|
|
5
|
-
/**
|
|
6
|
-
* 单关节机器人(SingleBot)
|
|
7
|
-
* 基于 ModelAbs 重构,保留 Bot.js 核心运行行为:状态灯、沿 X 移动、手臂旋转、夹具切换。
|
|
8
|
-
*/
|
|
9
|
-
export class SingleBot extends ModelAbs {
|
|
10
|
-
static DEFAULT_WIDTH = 90
|
|
11
|
-
static DEFAULT_HEIGHT = 76
|
|
12
|
-
static DEFAULT_LIGHT_COLOR = 'rgba(255,255,255,0.2)'
|
|
13
|
-
defaultLightColor = SingleBot.DEFAULT_LIGHT_COLOR
|
|
14
|
-
armRotation = 0
|
|
15
|
-
createUi() {
|
|
16
|
-
const {
|
|
17
|
-
uuid,
|
|
18
|
-
className,
|
|
19
|
-
nameplate,
|
|
20
|
-
width = SingleBot.DEFAULT_WIDTH,
|
|
21
|
-
height = SingleBot.DEFAULT_HEIGHT,
|
|
22
|
-
x,
|
|
23
|
-
y,
|
|
24
|
-
zIndex,
|
|
25
|
-
rotation,
|
|
26
|
-
scale,
|
|
27
|
-
visible,
|
|
28
|
-
editable,
|
|
29
|
-
draggable,
|
|
30
|
-
currentFixture
|
|
31
|
-
} = this.config
|
|
32
|
-
const main = new Box({
|
|
33
|
-
id: uuid,
|
|
34
|
-
className,
|
|
35
|
-
data: this.config,
|
|
36
|
-
width,
|
|
37
|
-
height,
|
|
38
|
-
x,
|
|
39
|
-
y,
|
|
40
|
-
zIndex,
|
|
41
|
-
rotation,
|
|
42
|
-
scale,
|
|
43
|
-
visible,
|
|
44
|
-
editable,
|
|
45
|
-
draggable,
|
|
46
|
-
cornerRadius: 10,
|
|
47
|
-
fill: '#FF9933',
|
|
48
|
-
origin: 'center',
|
|
49
|
-
around: 'center',
|
|
50
|
-
children: [
|
|
51
|
-
{
|
|
52
|
-
className: 'statusLightTop',
|
|
53
|
-
tag: 'Box',
|
|
54
|
-
width: 30,
|
|
55
|
-
height: 4,
|
|
56
|
-
x: width / 2,
|
|
57
|
-
y: 4,
|
|
58
|
-
fill: this.defaultLightColor,
|
|
59
|
-
around: 'center',
|
|
60
|
-
cornerRadius: 4
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
className: 'statusLightBottom',
|
|
64
|
-
tag: 'Box',
|
|
65
|
-
width: 30,
|
|
66
|
-
height: 4,
|
|
67
|
-
x: width / 2,
|
|
68
|
-
y: height - 4,
|
|
69
|
-
fill: this.defaultLightColor,
|
|
70
|
-
around: 'center',
|
|
71
|
-
cornerRadius: 4
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
className: 'secondBase',
|
|
75
|
-
tag: 'Box',
|
|
76
|
-
width: 70,
|
|
77
|
-
height: 60,
|
|
78
|
-
x: width / 2,
|
|
79
|
-
y: height / 2 + 8,
|
|
80
|
-
around: 'center',
|
|
81
|
-
cornerRadius: 10,
|
|
82
|
-
fill: {
|
|
83
|
-
type: 'radial',
|
|
84
|
-
stops: [
|
|
85
|
-
{ offset: 0.3, color: '#FFcc00' },
|
|
86
|
-
{ offset: 1, color: '#FF6600' }
|
|
87
|
-
]
|
|
88
|
-
},
|
|
89
|
-
children: [
|
|
90
|
-
{
|
|
91
|
-
className: 'bigArm',
|
|
92
|
-
tag: 'Box',
|
|
93
|
-
width: 50,
|
|
94
|
-
height: 30,
|
|
95
|
-
x: 0,
|
|
96
|
-
y: -8,
|
|
97
|
-
around: 'center',
|
|
98
|
-
cornerRadius: [15, 3, 3, 15],
|
|
99
|
-
fill: {
|
|
100
|
-
type: 'radial',
|
|
101
|
-
stops: [
|
|
102
|
-
{ offset: 0, color: '#FFcc00' },
|
|
103
|
-
{ offset: 1, color: '#FF6600' }
|
|
104
|
-
]
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
className: 'smallArm',
|
|
109
|
-
tag: 'Box',
|
|
110
|
-
width: 36,
|
|
111
|
-
height: 16,
|
|
112
|
-
x: 2,
|
|
113
|
-
y: -8,
|
|
114
|
-
around: 'left',
|
|
115
|
-
cornerRadius: [16, 0, 0, 16],
|
|
116
|
-
fill: {
|
|
117
|
-
type: 'linear',
|
|
118
|
-
stops: ['#FF6600', '#FFbb00', '#FF6600']
|
|
119
|
-
},
|
|
120
|
-
children: [
|
|
121
|
-
{
|
|
122
|
-
className: 'fixturePallet',
|
|
123
|
-
tag: 'Box',
|
|
124
|
-
visible: currentFixture !== 'cutter',
|
|
125
|
-
width: 30,
|
|
126
|
-
height: 16,
|
|
127
|
-
x: 26,
|
|
128
|
-
y: 0,
|
|
129
|
-
around: 'left',
|
|
130
|
-
cornerRadius: [8, 2, 2, 8],
|
|
131
|
-
fill: '#424242'
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
className: 'fixtureCutter',
|
|
135
|
-
tag: 'Box',
|
|
136
|
-
visible: currentFixture === 'cutter',
|
|
137
|
-
width: 20,
|
|
138
|
-
height: 8,
|
|
139
|
-
x: 26,
|
|
140
|
-
y: 4,
|
|
141
|
-
around: 'left',
|
|
142
|
-
cornerRadius: 4,
|
|
143
|
-
fill: '#333'
|
|
144
|
-
}
|
|
145
|
-
]
|
|
146
|
-
}
|
|
147
|
-
]
|
|
148
|
-
}
|
|
149
|
-
]
|
|
150
|
-
})
|
|
151
|
-
setCursor(main, this.config)
|
|
152
|
-
if (nameplate) {
|
|
153
|
-
main.add(
|
|
154
|
-
NamePlate({
|
|
155
|
-
title: nameplate,
|
|
156
|
-
x: width / 2,
|
|
157
|
-
y: height - 12,
|
|
158
|
-
height: 16
|
|
159
|
-
})
|
|
160
|
-
)
|
|
161
|
-
}
|
|
162
|
-
return main
|
|
163
|
-
}
|
|
164
|
-
operating(data) {
|
|
165
|
-
if (data.light) this.handleLight(data.light)
|
|
166
|
-
if (typeof data.x === 'number') this.moveX(data.x)
|
|
167
|
-
if (typeof data.r === 'number') this.handleRotate(data.r)
|
|
168
|
-
if (data.currentFixture) this.switchFixture(data.currentFixture)
|
|
169
|
-
}
|
|
170
|
-
// 二级基座与摆臂联动旋转
|
|
171
|
-
handleRotate(r) {
|
|
172
|
-
if (!Number.isFinite(r)) return
|
|
173
|
-
this.armRotation = r
|
|
174
|
-
this.ui.findOne('.bigArm')?.animate({ rotation: -r, duration: 0.5 })
|
|
175
|
-
this.ui.findOne('.smallArm')?.animate({ rotation: r, duration: 0.5 })
|
|
176
|
-
this.ui.findOne('.secondBase')?.animate({ offsetX: Math.abs(r / 9) - 10, duration: 0.5 })
|
|
177
|
-
}
|
|
178
|
-
// 在轨道上沿 X 轴移动
|
|
179
|
-
moveX(x) {
|
|
180
|
-
if (!Number.isFinite(x)) return
|
|
181
|
-
this.ui.animate({ x, duration: 0.5 })
|
|
182
|
-
}
|
|
183
|
-
// 状态灯闪烁
|
|
184
|
-
handleLight(val) {
|
|
185
|
-
if (!val) return
|
|
186
|
-
const lights = [this.ui.findOne('.statusLightTop'), this.ui.findOne('.statusLightBottom')]
|
|
187
|
-
lights.forEach((light) => {
|
|
188
|
-
light?.set({
|
|
189
|
-
animation: {
|
|
190
|
-
keyframes: [{ fill: val.color }, { fill: this.defaultLightColor }, { fill: val.color }],
|
|
191
|
-
duration: 0.5,
|
|
192
|
-
loop: Boolean(val.blinking)
|
|
193
|
-
}
|
|
194
|
-
})
|
|
195
|
-
})
|
|
196
|
-
}
|
|
197
|
-
// 切换夹具显示状态
|
|
198
|
-
switchFixture(type) {
|
|
199
|
-
this.ui.findOne('.fixturePallet')?.set({ visible: type === 'pallet' })
|
|
200
|
-
this.ui.findOne('.fixtureCutter')?.set({ visible: type === 'cutter' })
|
|
201
|
-
}
|
|
202
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { ISingleJointRobotConfig, ISingleGripperRobotOperating } from '@/types'
|
|
2
|
-
import { Box } from 'leafer'
|
|
3
|
-
import { ModelAbs } from '../abstract/ModelAbs'
|
|
4
|
-
/**
|
|
5
|
-
* 单关节机器人(SingleJointRobot)
|
|
6
|
-
* 基于 ModelAbs 重构,保留 Bot.js 核心运行行为:状态灯、沿 X 移动、手臂旋转、夹具切换。
|
|
7
|
-
*/
|
|
8
|
-
export declare class SingleJointRobot 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
|
-
protected createUi(): Box
|
|
14
|
-
protected operating(data: ISingleGripperRobotOperating): void
|
|
15
|
-
private handleRotate
|
|
16
|
-
private moveX
|
|
17
|
-
private handleLight
|
|
18
|
-
private switchFixture
|
|
19
|
-
}
|
|
@@ -1,272 +0,0 @@
|
|
|
1
|
-
import { Box } from 'leafer'
|
|
2
|
-
import { ModelAbs } from '../abstract/ModelAbs'
|
|
3
|
-
import { setCursor } from '../utils/attr'
|
|
4
|
-
/**
|
|
5
|
-
* 单关节机器人(SingleJointRobot)
|
|
6
|
-
* 基于 ModelAbs 重构,保留 Bot.js 核心运行行为:状态灯、沿 X 移动、手臂旋转、夹具切换。
|
|
7
|
-
*/
|
|
8
|
-
export class SingleJointRobot extends ModelAbs {
|
|
9
|
-
static DEFAULT_WIDTH = 90
|
|
10
|
-
static DEFAULT_HEIGHT = 76
|
|
11
|
-
static DEFAULT_LIGHT_COLOR = 'rgba(255,255,255,0.2)'
|
|
12
|
-
defaultLightColor = SingleJointRobot.DEFAULT_LIGHT_COLOR
|
|
13
|
-
createUi() {
|
|
14
|
-
const {
|
|
15
|
-
uuid,
|
|
16
|
-
className,
|
|
17
|
-
width = SingleJointRobot.DEFAULT_WIDTH,
|
|
18
|
-
height = SingleJointRobot.DEFAULT_HEIGHT,
|
|
19
|
-
x,
|
|
20
|
-
y,
|
|
21
|
-
zIndex,
|
|
22
|
-
rotation,
|
|
23
|
-
scale,
|
|
24
|
-
visible,
|
|
25
|
-
editable,
|
|
26
|
-
draggable,
|
|
27
|
-
currentFixture
|
|
28
|
-
} = this.config
|
|
29
|
-
const main = new Box({
|
|
30
|
-
id: uuid,
|
|
31
|
-
className,
|
|
32
|
-
data: this.config,
|
|
33
|
-
width,
|
|
34
|
-
height,
|
|
35
|
-
x,
|
|
36
|
-
y,
|
|
37
|
-
zIndex,
|
|
38
|
-
rotation,
|
|
39
|
-
scale,
|
|
40
|
-
visible,
|
|
41
|
-
editable,
|
|
42
|
-
draggable,
|
|
43
|
-
cornerRadius: 10,
|
|
44
|
-
fill: '#FF9933',
|
|
45
|
-
origin: 'center',
|
|
46
|
-
around: 'center',
|
|
47
|
-
children: [
|
|
48
|
-
{
|
|
49
|
-
tag: 'Rect',
|
|
50
|
-
x: 5,
|
|
51
|
-
y: 4,
|
|
52
|
-
width,
|
|
53
|
-
height,
|
|
54
|
-
fill: {
|
|
55
|
-
type: 'linear',
|
|
56
|
-
from: 'left',
|
|
57
|
-
to: 'right',
|
|
58
|
-
stops: [
|
|
59
|
-
{ offset: 0, color: '#666' },
|
|
60
|
-
{ offset: 1, color: '#555' }
|
|
61
|
-
]
|
|
62
|
-
},
|
|
63
|
-
cornerRadius: 10,
|
|
64
|
-
zIndex: -1
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
tag: 'Rect',
|
|
68
|
-
width,
|
|
69
|
-
height,
|
|
70
|
-
fill: '#FF9933',
|
|
71
|
-
cornerRadius: 10,
|
|
72
|
-
zIndex: -1
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
className: 'statusLightTop',
|
|
76
|
-
tag: 'Box',
|
|
77
|
-
width: 30,
|
|
78
|
-
height: 4,
|
|
79
|
-
x: width / 2,
|
|
80
|
-
y: 4,
|
|
81
|
-
fill: this.defaultLightColor,
|
|
82
|
-
around: 'center',
|
|
83
|
-
cornerRadius: 4
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
className: 'statusLightBottom',
|
|
87
|
-
tag: 'Box',
|
|
88
|
-
width: 30,
|
|
89
|
-
height: 4,
|
|
90
|
-
x: width / 2,
|
|
91
|
-
y: height - 4,
|
|
92
|
-
fill: this.defaultLightColor,
|
|
93
|
-
around: 'center',
|
|
94
|
-
cornerRadius: 4
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
className: 'secondBase',
|
|
98
|
-
tag: 'Box',
|
|
99
|
-
width: 70,
|
|
100
|
-
height: 60,
|
|
101
|
-
x: width / 2,
|
|
102
|
-
y: height / 2 + 8,
|
|
103
|
-
around: 'center',
|
|
104
|
-
cornerRadius: 10,
|
|
105
|
-
fill: {
|
|
106
|
-
type: 'radial',
|
|
107
|
-
stops: [
|
|
108
|
-
{ offset: 0.3, color: '#FFcc00' },
|
|
109
|
-
{ offset: 1, color: '#FF6600' }
|
|
110
|
-
]
|
|
111
|
-
},
|
|
112
|
-
children: [
|
|
113
|
-
{
|
|
114
|
-
className: 'bigArm',
|
|
115
|
-
tag: 'Box',
|
|
116
|
-
width: 50,
|
|
117
|
-
height: 30,
|
|
118
|
-
x: 0,
|
|
119
|
-
y: -8,
|
|
120
|
-
around: 'center',
|
|
121
|
-
cornerRadius: [15, 3, 3, 15],
|
|
122
|
-
fill: {
|
|
123
|
-
type: 'radial',
|
|
124
|
-
stops: [
|
|
125
|
-
{ offset: 0, color: '#FFcc00' },
|
|
126
|
-
{ offset: 1, color: '#FF6600' }
|
|
127
|
-
]
|
|
128
|
-
}
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
className: 'smallArm',
|
|
132
|
-
tag: 'Box',
|
|
133
|
-
width: 36,
|
|
134
|
-
height: 16,
|
|
135
|
-
x: 2,
|
|
136
|
-
y: -8,
|
|
137
|
-
around: 'left',
|
|
138
|
-
cornerRadius: [16, 0, 0, 16],
|
|
139
|
-
fill: {
|
|
140
|
-
type: 'linear',
|
|
141
|
-
stops: ['#FF6600', '#FFbb00', '#FF6600']
|
|
142
|
-
},
|
|
143
|
-
children: [
|
|
144
|
-
{
|
|
145
|
-
tag: 'Rect',
|
|
146
|
-
width: 12,
|
|
147
|
-
height: 16,
|
|
148
|
-
fill: '#424242',
|
|
149
|
-
cornerRadius: [26, 10, 10, 26]
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
tag: 'Rect',
|
|
153
|
-
x: 36,
|
|
154
|
-
width: 5,
|
|
155
|
-
height: 16,
|
|
156
|
-
fill: '#424242',
|
|
157
|
-
cornerRadius: [0, 16, 16, 0]
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
className: 'fixturePallet',
|
|
161
|
-
tag: 'Box',
|
|
162
|
-
visible: currentFixture !== 'cutter',
|
|
163
|
-
width: 65,
|
|
164
|
-
height: 50,
|
|
165
|
-
x: 26,
|
|
166
|
-
y: -17,
|
|
167
|
-
around: 'left',
|
|
168
|
-
cornerRadius: [15, 0, 0, 15],
|
|
169
|
-
strokeWidth: 4,
|
|
170
|
-
stroke: {
|
|
171
|
-
type: 'linear',
|
|
172
|
-
from: 'left',
|
|
173
|
-
to: 'right',
|
|
174
|
-
stops: [
|
|
175
|
-
{ offset: 0, color: '#424242' },
|
|
176
|
-
{ offset: 0.9, color: '#000' },
|
|
177
|
-
{ offset: 0.9, color: 'rgba(255,0,0,0)' },
|
|
178
|
-
{ offset: 1, color: 'rgba(255,0,0,0)' }
|
|
179
|
-
]
|
|
180
|
-
},
|
|
181
|
-
fill: 'rgba(0,0,0,0)',
|
|
182
|
-
animation: {
|
|
183
|
-
keyframes: [
|
|
184
|
-
{ opacity: 0, scaleX: 0 },
|
|
185
|
-
{ opacity: 1, scaleX: 1 }
|
|
186
|
-
],
|
|
187
|
-
duration: 0.3
|
|
188
|
-
}
|
|
189
|
-
},
|
|
190
|
-
{
|
|
191
|
-
className: 'fixtureCutter',
|
|
192
|
-
tag: 'Box',
|
|
193
|
-
visible: currentFixture === 'cutter',
|
|
194
|
-
width: 40,
|
|
195
|
-
height: 12,
|
|
196
|
-
x: 26,
|
|
197
|
-
y: 2,
|
|
198
|
-
around: 'left',
|
|
199
|
-
cornerRadius: 4,
|
|
200
|
-
fill: {
|
|
201
|
-
type: 'linear',
|
|
202
|
-
from: 'left',
|
|
203
|
-
to: 'right',
|
|
204
|
-
stops: [
|
|
205
|
-
{ offset: 0, color: '#424242' },
|
|
206
|
-
{ offset: 0.75, color: '#666' },
|
|
207
|
-
{ offset: 0.75, color: '#333' },
|
|
208
|
-
{ offset: 1, color: '#333' }
|
|
209
|
-
]
|
|
210
|
-
},
|
|
211
|
-
children: [
|
|
212
|
-
{
|
|
213
|
-
tag: 'Box',
|
|
214
|
-
width: 6,
|
|
215
|
-
height: 2,
|
|
216
|
-
x: 34,
|
|
217
|
-
y: 2,
|
|
218
|
-
fill: '#666'
|
|
219
|
-
},
|
|
220
|
-
{
|
|
221
|
-
tag: 'Box',
|
|
222
|
-
width: 6,
|
|
223
|
-
height: 2,
|
|
224
|
-
x: 34,
|
|
225
|
-
y: 8,
|
|
226
|
-
fill: '#666'
|
|
227
|
-
}
|
|
228
|
-
]
|
|
229
|
-
}
|
|
230
|
-
]
|
|
231
|
-
}
|
|
232
|
-
]
|
|
233
|
-
}
|
|
234
|
-
]
|
|
235
|
-
})
|
|
236
|
-
setCursor(main, this.config)
|
|
237
|
-
return main
|
|
238
|
-
}
|
|
239
|
-
operating(data) {
|
|
240
|
-
if (data.light) this.handleLight(data.light)
|
|
241
|
-
if (typeof data.x === 'number') this.moveX(data.x)
|
|
242
|
-
if (typeof data.r === 'number') this.handleRotate(data.r)
|
|
243
|
-
if (data.currentFixture) this.switchFixture(data.currentFixture)
|
|
244
|
-
}
|
|
245
|
-
handleRotate(r) {
|
|
246
|
-
if (!Number.isFinite(r)) return
|
|
247
|
-
this.ui.findOne('.bigArm')?.animate({ rotation: -r, duration: 0.5 })
|
|
248
|
-
this.ui.findOne('.smallArm')?.animate({ rotation: r, duration: 0.5 })
|
|
249
|
-
this.ui.findOne('.secondBase')?.animate({ offsetX: Math.abs(r / 9) - 10, duration: 0.5 })
|
|
250
|
-
}
|
|
251
|
-
moveX(x) {
|
|
252
|
-
if (!Number.isFinite(x)) return
|
|
253
|
-
this.ui.animate({ x, duration: 0.5 })
|
|
254
|
-
}
|
|
255
|
-
handleLight(val) {
|
|
256
|
-
if (!val) return
|
|
257
|
-
const lights = [this.ui.findOne('.statusLightTop'), this.ui.findOne('.statusLightBottom')]
|
|
258
|
-
lights.forEach((light) => {
|
|
259
|
-
light?.set({
|
|
260
|
-
animation: {
|
|
261
|
-
keyframes: [{ fill: val.color }, { fill: this.defaultLightColor }, { fill: val.color }],
|
|
262
|
-
duration: 0.5,
|
|
263
|
-
loop: Boolean(val.blinking)
|
|
264
|
-
}
|
|
265
|
-
})
|
|
266
|
-
})
|
|
267
|
-
}
|
|
268
|
-
switchFixture(type) {
|
|
269
|
-
this.ui.findOne('.fixturePallet')?.set({ visible: type === 'pallet' })
|
|
270
|
-
this.ui.findOne('.fixtureCutter')?.set({ visible: type === 'cutter' })
|
|
271
|
-
}
|
|
272
|
-
}
|