@jnrs/lingshu-smart 2.2.8 → 2.2.9

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.
Files changed (176) hide show
  1. package/dist/App.vue.d.ts +1 -2
  2. package/dist/assets/data/editor_default_setting.d.ts +1 -8
  3. package/dist/assets/data/editor_preset_menu.d.ts +1 -8
  4. package/dist/components/editor/ControlBar/CaseManger.vue.d.ts +15 -3
  5. package/dist/components/editor/ControlBar/CaseTitleEdit.vue.d.ts +411 -2
  6. package/dist/components/editor/ControlBar/ExportImportDialog.vue.d.ts +2 -3
  7. package/dist/components/editor/ControlBar/MainButton.vue.d.ts +2 -3
  8. package/dist/components/editor/ControlBar/StepButton.vue.d.ts +1 -2
  9. package/dist/components/editor/ControlBar/StepRecordVisualizer.vue.d.ts +1 -2
  10. package/dist/components/editor/DrawingBoard.vue.d.ts +1 -2
  11. package/dist/components/editor/MenuCard/Equipments.vue.d.ts +1 -2
  12. package/dist/components/editor/MenuCard/Layers.vue.d.ts +1 -2
  13. package/dist/components/editor/MenuCard/index.vue.d.ts +1 -2
  14. package/dist/components/editor/OptionCard/Equipment/Base.vue.d.ts +1 -2
  15. package/dist/components/editor/OptionCard/Equipment/DataSets.vue.d.ts +1 -2
  16. package/dist/components/editor/OptionCard/Equipment/Interaction.vue.d.ts +1 -2
  17. package/dist/components/editor/OptionCard/Equipment/Position.vue.d.ts +1 -2
  18. package/dist/components/editor/OptionCard/Equipment/StationSlotGroup.vue.d.ts +1 -2
  19. package/dist/components/editor/OptionCard/Equipment/index.vue.d.ts +1 -2
  20. package/dist/components/editor/OptionCard/Equipment/models/MachineTool.vue.d.ts +1 -2
  21. package/dist/components/editor/OptionCard/Equipment/models/Rail.vue.d.ts +1 -2
  22. package/dist/components/editor/OptionCard/Equipment/models/SingleJointRobot.vue.d.ts +2 -0
  23. package/dist/components/editor/OptionCard/Scene/Background.vue.d.ts +1 -2
  24. package/dist/components/editor/OptionCard/Scene/index.vue.d.ts +1 -2
  25. package/dist/components/editor/OptionCard/index.vue.d.ts +1 -2
  26. package/dist/components/editor/index.vue.d.ts +13 -4
  27. package/dist/components/index.d.ts +2 -2
  28. package/dist/components/index.js +27281 -4
  29. package/dist/components/preview/index.vue.d.ts +5 -6
  30. package/dist/composables/useStepRecord.d.ts +4 -12
  31. package/dist/constants/options.d.ts +1 -8
  32. package/dist/controller/AppController.d.ts +3 -10
  33. package/dist/controller/EditorController.d.ts +2 -9
  34. package/dist/index.js +1 -1
  35. package/dist/json/cases.json +577 -20
  36. package/dist/locales/i18next.d.ts +1 -1
  37. package/dist/locales/index.d.ts +2 -2
  38. package/dist/locales/index.js +13 -3
  39. package/dist/main.d.ts +0 -3
  40. package/dist/playground/EditPageDemo.vue.d.ts +1 -2
  41. package/dist/playground/ViewPageDemo.vue.d.ts +27 -2
  42. package/dist/stores/useAppStore.d.ts +5 -12
  43. package/dist/stores/useDataStore.d.ts +11 -18
  44. package/dist/stores/useEditorStore.d.ts +20 -27
  45. package/dist/types/app.types.d.ts +1 -1
  46. package/dist/types/base.types.d.ts +1 -1
  47. package/dist/types/components/config.types.d.ts +1 -1
  48. package/dist/types/components/operating.types.d.ts +1 -1
  49. package/dist/types/enums.d.ts +1 -1
  50. package/dist/types/guards.d.ts +5 -12
  51. package/dist/types/index.d.ts +2 -2
  52. package/dist/types/models/config.types.d.ts +49 -47
  53. package/dist/types/models/operating.types.d.ts +53 -53
  54. package/dist/ui/abstract/ComponentAbs.d.ts +2 -9
  55. package/dist/ui/abstract/ModelAbs.d.ts +2 -10
  56. package/dist/ui/components/Entrance.d.ts +1 -8
  57. package/dist/ui/components/Light.d.ts +1 -8
  58. package/dist/ui/components/Progress.d.ts +1 -8
  59. package/dist/ui/components/Resource.d.ts +1 -8
  60. package/dist/ui/components/StationSlot.d.ts +1 -23
  61. package/dist/ui/components/StationSlotGroup.d.ts +1 -8
  62. package/dist/ui/factories/createGlass.d.ts +0 -6
  63. package/dist/ui/factories/createModel.d.ts +2 -9
  64. package/dist/ui/factories/createShadow.d.ts +1 -9
  65. package/dist/ui/factories/createText.d.ts +0 -7
  66. package/dist/ui/models/CleaningMachine.d.ts +1 -1
  67. package/dist/ui/models/DoubleJointRobot.d.ts +19 -20
  68. package/dist/ui/models/LoadingStation.d.ts +1 -1
  69. package/dist/ui/models/MachineTool.d.ts +1 -1
  70. package/dist/ui/models/MarkingMachine.d.ts +1 -1
  71. package/dist/ui/models/Rail.d.ts +1 -1
  72. package/dist/ui/models/ResourceStore.d.ts +1 -1
  73. package/dist/ui/models/SingleJointRobot.d.ts +3 -3
  74. package/dist/ui/shapes/NamePlate.d.ts +0 -7
  75. package/dist/ui/shapes/ScrewHole.d.ts +0 -7
  76. package/dist/ui/shapes/Texture.d.ts +1 -8
  77. package/dist/ui/utils/attr.d.ts +2 -9
  78. package/dist/utils/type-guards.d.ts +1 -1
  79. package/package.json +3 -3
  80. package/dist/App.vue.js +0 -30
  81. package/dist/assets/data/editor_default.d.ts +0 -16
  82. package/dist/assets/data/editor_default.js +0 -59
  83. package/dist/assets/data/editor_default_setting.js +0 -58
  84. package/dist/assets/data/editor_preset.d.ts +0 -9
  85. package/dist/assets/data/editor_preset.js +0 -51
  86. package/dist/assets/data/editor_preset_menu.js +0 -290
  87. package/dist/components/editor/ControlBar/CaseManger.vue.js +0 -465
  88. package/dist/components/editor/ControlBar/CaseTitleEdit.vue.js +0 -108
  89. package/dist/components/editor/ControlBar/ExportImportDialog.vue.js +0 -280
  90. package/dist/components/editor/ControlBar/MainButton.vue.js +0 -183
  91. package/dist/components/editor/ControlBar/StepButton.vue.js +0 -147
  92. package/dist/components/editor/ControlBar/StepRecordVisualizer.vue.js +0 -98
  93. package/dist/components/editor/DrawingBoard.vue.js +0 -31
  94. package/dist/components/editor/MenuCard/Equipments.vue.js +0 -129
  95. package/dist/components/editor/MenuCard/Layers.vue.js +0 -201
  96. package/dist/components/editor/MenuCard/index.vue.js +0 -84
  97. package/dist/components/editor/OptionCard/Equipment/Base.vue.js +0 -96
  98. package/dist/components/editor/OptionCard/Equipment/Binds.vue.d.ts +0 -3
  99. package/dist/components/editor/OptionCard/Equipment/Binds.vue.js +0 -443
  100. package/dist/components/editor/OptionCard/Equipment/Bot.vue.d.ts +0 -3
  101. package/dist/components/editor/OptionCard/Equipment/Bot.vue.js +0 -81
  102. package/dist/components/editor/OptionCard/Equipment/DataSets.vue.js +0 -304
  103. package/dist/components/editor/OptionCard/Equipment/DockStore.vue.d.ts +0 -3
  104. package/dist/components/editor/OptionCard/Equipment/DockStore.vue.js +0 -597
  105. package/dist/components/editor/OptionCard/Equipment/Interaction.vue.js +0 -287
  106. package/dist/components/editor/OptionCard/Equipment/Position.backup.vue.d.ts +0 -3
  107. package/dist/components/editor/OptionCard/Equipment/Position.backup.vue.js +0 -440
  108. package/dist/components/editor/OptionCard/Equipment/Position.vue.js +0 -436
  109. package/dist/components/editor/OptionCard/Equipment/StationSlotGroup.vue.js +0 -1131
  110. package/dist/components/editor/OptionCard/Equipment/Store.vue.d.ts +0 -3
  111. package/dist/components/editor/OptionCard/Equipment/Store.vue.js +0 -453
  112. package/dist/components/editor/OptionCard/Equipment/Trailer.vue.d.ts +0 -3
  113. package/dist/components/editor/OptionCard/Equipment/Trailer.vue.js +0 -1109
  114. package/dist/components/editor/OptionCard/Equipment/index.vue.js +0 -100
  115. package/dist/components/editor/OptionCard/Equipment/models/MachineTool.vue.js +0 -99
  116. package/dist/components/editor/OptionCard/Equipment/models/Rail.vue.js +0 -225
  117. package/dist/components/editor/OptionCard/Equipment/models/SingleGripperRobot.vue.d.ts +0 -3
  118. package/dist/components/editor/OptionCard/Equipment/models/SingleGripperRobot.vue.js +0 -99
  119. package/dist/components/editor/OptionCard/Scene/Background.vue.js +0 -543
  120. package/dist/components/editor/OptionCard/Scene/index.vue.js +0 -200
  121. package/dist/components/editor/OptionCard/index.vue.js +0 -73
  122. package/dist/components/editor/index.vue.js +0 -156
  123. package/dist/components/preview/index.vue.js +0 -104
  124. package/dist/composables/useStepRecord.js +0 -135
  125. package/dist/constants/options.js +0 -55
  126. package/dist/controller/AppController.js +0 -168
  127. package/dist/controller/EditorController.js +0 -173
  128. package/dist/locales/en.js +0 -5
  129. package/dist/locales/i18next.js +0 -6
  130. package/dist/locales/zhCn.js +0 -5
  131. package/dist/main.js +0 -13
  132. package/dist/playground/EditPageDemo.vue.js +0 -57
  133. package/dist/playground/ViewPageDemo.vue.js +0 -277
  134. package/dist/stores/index.js +0 -3
  135. package/dist/stores/useAppStore.js +0 -78
  136. package/dist/stores/useDataStore.js +0 -116
  137. package/dist/stores/useEditorStore.js +0 -263
  138. package/dist/types/app.types.js +0 -2
  139. package/dist/types/base.types.js +0 -1
  140. package/dist/types/components/config.types.js +0 -1
  141. package/dist/types/components/operating.types.js +0 -1
  142. package/dist/types/enums.js +0 -46
  143. package/dist/types/guards.js +0 -28
  144. package/dist/types/index.js +0 -8
  145. package/dist/types/models/config.types.js +0 -1
  146. package/dist/types/models/operating.types.js +0 -1
  147. package/dist/ui/abstract/ComponentAbs.js +0 -64
  148. package/dist/ui/abstract/ModelAbs.js +0 -119
  149. package/dist/ui/components/Entrance.js +0 -83
  150. package/dist/ui/components/Light.js +0 -167
  151. package/dist/ui/components/Progress.js +0 -84
  152. package/dist/ui/components/Resource.js +0 -70
  153. package/dist/ui/components/StationSlot.js +0 -207
  154. package/dist/ui/components/StationSlotGroup.js +0 -110
  155. package/dist/ui/factories/createGlass.js +0 -51
  156. package/dist/ui/factories/createModel.js +0 -35
  157. package/dist/ui/factories/createShadow.js +0 -52
  158. package/dist/ui/factories/createText.js +0 -46
  159. package/dist/ui/models/CleaningMachine.js +0 -141
  160. package/dist/ui/models/DoubleJointRobot.js +0 -545
  161. package/dist/ui/models/LoadingStation.js +0 -167
  162. package/dist/ui/models/MachineTool.js +0 -184
  163. package/dist/ui/models/MarkingMachine.js +0 -148
  164. package/dist/ui/models/Rail.js +0 -117
  165. package/dist/ui/models/ResourceStore.js +0 -101
  166. package/dist/ui/models/SingleBot.d.ts +0 -20
  167. package/dist/ui/models/SingleBot.js +0 -202
  168. package/dist/ui/models/SingleGripperRobot.d.ts +0 -19
  169. package/dist/ui/models/SingleGripperRobot.js +0 -272
  170. package/dist/ui/models/SingleJointRobot.js +0 -346
  171. package/dist/ui/shapes/NamePlate.js +0 -85
  172. package/dist/ui/shapes/ScrewHole.js +0 -57
  173. package/dist/ui/shapes/Texture.js +0 -51
  174. package/dist/ui/utils/attr.js +0 -50
  175. package/dist/utils/index.js +0 -92
  176. package/dist/utils/type-guards.js +0 -105
@@ -1,545 +0,0 @@
1
- /**
2
- * 双关节机器人
3
- */
4
- export class DoubleJointRobot extends Sprite {
5
- constructor({ width = 90, height = 76, linkRailId, linkTrailerId, currentFixture = 'pallet' } = {}) {
6
- super(...arguments);
7
- this.width = width;
8
- this.height = height;
9
- this.linkRailId = linkRailId; // 链接轨道的id
10
- this.linkTrailerId = linkTrailerId; // 绑定的随行托的id
11
- this.currentFixture = currentFixture; // 当前手抓的夹具: pallet/cutter
12
- this.defaultLightColor = 'rgba(255,255,255,0.2)';
13
- this.init();
14
- // this.handleRotateR1(90)
15
- // this.handleRotateR2(90)
16
- }
17
- init() {
18
- //设备状态灯
19
- const light = {
20
- tag: 'Box',
21
- width: this.width,
22
- height: this.height,
23
- x: 0,
24
- y: 0,
25
- cornerRadius: 10,
26
- zIndex: -1,
27
- children: [
28
- {
29
- className: 'statusLight',
30
- tag: 'Box',
31
- width: 30,
32
- height: 4,
33
- x: 45,
34
- y: 4,
35
- fill: this.defaultLightColor,
36
- around: 'center',
37
- cornerRadius: 4
38
- },
39
- {
40
- className: 'statusLight',
41
- tag: 'Box',
42
- width: 30,
43
- height: 4,
44
- x: 45,
45
- y: this.height - 4,
46
- fill: this.defaultLightColor,
47
- around: 'center',
48
- cornerRadius: 4
49
- }
50
- ]
51
- };
52
- const statusLight = new Box(light);
53
- //小摆臂 - R2
54
- const smallArm = new Box({
55
- // animation: {
56
- // style: { rotation: 360 },
57
- // duration: 1,
58
- // loop: true,
59
- // easing: 'linear'
60
- // },
61
- id: 'smallArm',
62
- x: 32,
63
- y: 5,
64
- zIndex: 1,
65
- origin: {
66
- x: 8,
67
- y: 27.5
68
- },
69
- children: [
70
- {
71
- tag: 'Box',
72
- width: 36,
73
- height: 16,
74
- stroke: 'rgba(0,0,0,0.1)',
75
- strokeWidth: 0.5,
76
- fill: {
77
- type: 'linear',
78
- stops: ['#FF6600', '#FFbb00', '#FF6600']
79
- },
80
- cornerRadius: [16, 0, 0, 16],
81
- children: [
82
- new Shadow({
83
- width: 36,
84
- height: 16,
85
- cornerRadius: [16, 0, 0, 16],
86
- fill: null,
87
- innerShadow: null,
88
- shadow: {
89
- x: 0,
90
- y: 0,
91
- blur: 3,
92
- color: 'rgba(0,0,0,0.5)'
93
- }
94
- })
95
- ]
96
- },
97
- {
98
- tag: 'Rect',
99
- width: 12,
100
- height: 12,
101
- x: 2,
102
- y: 2,
103
- fill: '#424242',
104
- cornerRadius: 16
105
- },
106
- {
107
- tag: 'Rect',
108
- x: 36,
109
- width: 5,
110
- height: 16,
111
- fill: '#424242',
112
- cornerRadius: [0, 16, 16, 0]
113
- },
114
- // 叉子
115
- {
116
- id: 'fork',
117
- tag: 'Box',
118
- x: 30,
119
- y: -17,
120
- zIndex: -1,
121
- children: [
122
- {
123
- id: 'fixture',
124
- tag: 'Box',
125
- state: this.currentFixture,
126
- states: {
127
- // 托盘夹具
128
- pallet: {
129
- width: 65,
130
- height: 50,
131
- cornerRadius: [15, 0, 0, 15],
132
- strokeWidth: 4,
133
- stroke: {
134
- type: 'linear',
135
- from: 'left',
136
- to: 'right',
137
- stops: [
138
- { offset: 0, color: '#424242' },
139
- { offset: 0.9, color: '#000' },
140
- { offset: 0.9, color: 'rgba(255, 0, 0, 0)' }, //通过透明色实现叉子右边框不显示
141
- { offset: 1, color: 'rgba(255, 0, 0, 0)' } //通过透明色实现叉子右边框不显示
142
- ]
143
- },
144
- animation: {
145
- keyframes: [
146
- { opacity: 0, scaleX: 0 },
147
- { opacity: 1, scaleX: 1 }
148
- ],
149
- duration: 0.3
150
- }
151
- },
152
- // 刀具夹具
153
- cutter: {
154
- tag: 'Box',
155
- width: 40,
156
- height: 12,
157
- y: 19,
158
- fill: {
159
- type: 'linear',
160
- from: 'left',
161
- to: 'right',
162
- stops: [
163
- { offset: 0, color: '#424242' },
164
- { offset: 0.75, color: '#666' },
165
- { offset: 0.75, color: '#333' },
166
- { offset: 1, color: '#333' }
167
- ]
168
- },
169
- children: [
170
- {
171
- tag: 'Box',
172
- width: 6,
173
- height: 2,
174
- x: 34,
175
- y: 2,
176
- fill: '#666'
177
- },
178
- {
179
- tag: 'Box',
180
- width: 6,
181
- height: 2,
182
- x: 34,
183
- y: 8,
184
- fill: '#666'
185
- }
186
- ]
187
- }
188
- }
189
- }
190
- ]
191
- }
192
- ]
193
- });
194
- //大摆臂 - R1
195
- const bigArm = new Box({
196
- // animation: {
197
- // style: { rotation: 390 },
198
- // duration: 1.7,
199
- // loop: true,
200
- // swing: true
201
- // },
202
- id: 'bigArm',
203
- tag: 'Box',
204
- width: 52,
205
- height: 28,
206
- x: 21,
207
- y: 16,
208
- cornerRadius: [15, 15, 15, 15],
209
- origin: {
210
- x: 14,
211
- y: 14
212
- },
213
- fill: {
214
- type: 'radial',
215
- stops: [
216
- {
217
- offset: 0,
218
- color: '#FFcc00'
219
- },
220
- { offset: 1, color: '#FF6600' }
221
- ]
222
- },
223
- children: [
224
- new Shadow({
225
- width: 52,
226
- height: 28,
227
- cornerRadius: [15, 15, 15, 15],
228
- fill: null,
229
- innerShadow: null,
230
- shadow: {
231
- x: 0,
232
- y: 0,
233
- blur: 3,
234
- color: 'rgba(0,0,0,0.5)'
235
- }
236
- })
237
- ]
238
- });
239
- //二级基座
240
- const secondBase = new Box({
241
- id: 'secondBase',
242
- tag: 'Box',
243
- width: 70,
244
- height: 60,
245
- x: 45, //35~55
246
- y: 38,
247
- cornerRadius: 10,
248
- around: 'center',
249
- fill: {
250
- type: 'radial',
251
- stops: [
252
- {
253
- offset: 0.3,
254
- color: '#FFcc00'
255
- },
256
- { offset: 1, color: '#FF6600' }
257
- ]
258
- },
259
- children: [
260
- new Shadow({
261
- width: 70,
262
- height: 60,
263
- cornerRadius: 10,
264
- innerShadow: null
265
- }),
266
- new ScrewHole({ x: 10, y: 10, fill: '#dd6600', innerShadow: true, shadow: false }).self,
267
- new ScrewHole({ x: 62, y: 10, fill: '#dd6600', innerShadow: true, shadow: false }).self,
268
- new ScrewHole({ x: 62, y: 50, fill: '#dd6600', innerShadow: true, shadow: false }).self,
269
- new ScrewHole({ x: 10, y: 50, fill: '#dd6600', innerShadow: true, shadow: false }).self,
270
- {
271
- rotation: -this.rotation,
272
- tag: 'Box',
273
- width: 50,
274
- height: 50,
275
- around: 'center',
276
- x: 35,
277
- y: 30,
278
- fill: '#ee6600',
279
- cornerRadius: 50,
280
- strokeWidth: 1,
281
- stroke: 'rgba(255,255,255,0.65)',
282
- children: [
283
- new Shadow({
284
- width: 50,
285
- height: 50,
286
- cornerRadius: 50,
287
- shadow: null,
288
- innerShadow: [
289
- {
290
- x: 4,
291
- y: 2,
292
- blur: 4,
293
- color: 'rgba(0,0,0,0.5)'
294
- },
295
- {
296
- x: -3,
297
- y: -1,
298
- blur: 3,
299
- color: 'rgba(255, 255, 255, 0.4)'
300
- }
301
- ]
302
- })
303
- ]
304
- }
305
- ]
306
- });
307
- bigArm.add(smallArm);
308
- secondBase.add(bigArm);
309
- //主体
310
- const self = new Group({
311
- className: 'SingleBot',
312
- rotation: this.rotation,
313
- children: [
314
- {
315
- tag: 'Rect',
316
- x: 5,
317
- y: 4,
318
- width: this.width,
319
- height: this.height,
320
- fill: {
321
- type: 'linear',
322
- from: 'left',
323
- to: 'right',
324
- stops: [
325
- { offset: 0, color: '#666' },
326
- { offset: 1, color: '#555' }
327
- ]
328
- },
329
- cornerRadius: 10,
330
- zIndex: -1
331
- },
332
- {
333
- tag: 'Rect',
334
- width: this.width,
335
- height: this.height,
336
- fill: '#FF9933',
337
- cornerRadius: 10,
338
- zIndex: -1
339
- }
340
- ]
341
- });
342
- self.add(secondBase);
343
- self.add(statusLight);
344
- //托盘坑位
345
- const palletSite = new PalletSite({
346
- x: 45,
347
- y: 25,
348
- rotation: -this.rotation,
349
- width: 55,
350
- height: 55,
351
- zIndex: 1,
352
- fill: 'rgba(255,255,255,0)',
353
- showSite: false,
354
- visible: this.currentFixture === 'pallet' ? 1 : 0,
355
- clickable: this.clickable,
356
- resData: {
357
- deviceId: this.resData.id,
358
- deviceType: this.resData.type,
359
- targetSiteNumber: 1
360
- }
361
- });
362
- this.childrenObj['palletSite'] = palletSite;
363
- self.findOne('#fork').add(palletSite.self);
364
- //刀具坑位
365
- const cutterSite = new CutterSite({
366
- x: 45,
367
- y: 25,
368
- rotation: -this.rotation,
369
- width: 50,
370
- height: 50,
371
- zIndex: 1,
372
- fill: 'rgba(255,255,255,0)',
373
- showSite: false,
374
- visible: this.currentFixture === 'cutter' ? 1 : 0
375
- });
376
- this.childrenObj['cutterSite'] = cutterSite;
377
- self.findOne('#fork').add(cutterSite.self);
378
- // if (this.clickable) {
379
- // self.on(PointerEvent.TAP, () => {
380
- // const { equipDetails } = useFmsVisualEditStore()
381
- // equipDetails({
382
- // id: this.resData.id,
383
- // title: this.resData.title,
384
- // nameplate: this.resData.nameplate
385
- // })
386
- // })
387
- // }
388
- this.initLeaferObj(self);
389
- }
390
- //二级基座、R1 - 移动
391
- handleRotateR1(r) {
392
- if (Number.isFinite(r)) {
393
- let secondBaseX = Math.abs(r / 9) - 10;
394
- this.self.findOne('#secondBase').animate({
395
- style: {
396
- offsetX: secondBaseX
397
- },
398
- duration: 0.5
399
- });
400
- let bigArmRotate = r;
401
- this.self.findOne('#bigArm').animate({
402
- style: {
403
- rotation: bigArmRotate
404
- },
405
- duration: 0.5
406
- });
407
- }
408
- }
409
- //R2 - 移动
410
- handleRotateR2(r) {
411
- if (Number.isFinite(r)) {
412
- this.self.findOne('#smallArm').animate({
413
- style: {
414
- rotation: r
415
- },
416
- duration: 0.5
417
- });
418
- }
419
- }
420
- //在轨道上移动
421
- moveX(x) {
422
- if (Number.isFinite(x)) {
423
- this.self.animate({
424
- style: {
425
- x
426
- },
427
- duration: 0.5
428
- });
429
- }
430
- }
431
- //状态灯闪动
432
- handleLight(val) {
433
- const box = this.self.find('.statusLight');
434
- box.forEach((element) => {
435
- element.set({
436
- animation: {
437
- keyframes: [{ fill: val.color }, { fill: this.defaultLightColor }, { fill: val.color }],
438
- duration: 0.5,
439
- loop: val.blink
440
- }
441
- });
442
- });
443
- }
444
- //手抓切换夹具
445
- switchFork(type = 'pallet') {
446
- if (type === 'pallet') {
447
- this.childrenObj['palletSite'].self.visible = 1;
448
- this.childrenObj['cutterSite'].self.visible = 0;
449
- }
450
- if (type === 'cutter') {
451
- this.childrenObj['cutterSite'].self.visible = 1;
452
- this.childrenObj['palletSite'].self.visible = 0;
453
- }
454
- const fixture = this.self.findOne('#fixture');
455
- fixture.state = type;
456
- }
457
- //添加托盘
458
- addPallet(d) {
459
- this.switchFork('pallet');
460
- this.forkAnimationIn();
461
- setTimeout(() => {
462
- this.childrenObj['palletSite'].addPallet(d);
463
- }, 300);
464
- }
465
- //移除托盘
466
- removeAllPallet(d) {
467
- this.forkAnimationOut();
468
- setTimeout(() => {
469
- this.childrenObj['palletSite'].removeAllPallet(d);
470
- }, 300);
471
- }
472
- //添加刀具
473
- addCutter(d) {
474
- this.switchFork('cutter');
475
- this.forkAnimationIn();
476
- setTimeout(() => {
477
- this.childrenObj['cutterSite'].addPallet(d);
478
- }, 300);
479
- }
480
- //移除刀具
481
- removeAllCutter(d) {
482
- this.forkAnimationOut();
483
- setTimeout(() => {
484
- this.childrenObj['cutterSite'].removeAllPallet(d);
485
- }, 300);
486
- }
487
- //叉子上料动画
488
- forkAnimationIn() {
489
- this.self.findOne('#fork').animate([
490
- {
491
- style: { scaleX: 1 }
492
- },
493
- {
494
- style: { scaleX: 0.8 },
495
- duration: 0.2
496
- },
497
- { style: { scaleX: 1.3 }, duration: 0.2 },
498
- { style: { scaleX: 1 }, duration: 0.6 }
499
- ], {
500
- reverse: true
501
- });
502
- }
503
- //叉子下料动画
504
- forkAnimationOut() {
505
- this.self.findOne('#fork').animate([
506
- {
507
- style: { scaleX: 1 }
508
- },
509
- {
510
- style: { scaleX: 0.8 },
511
- duration: 0.2
512
- },
513
- { style: { scaleX: 1.3 }, duration: 0.2 },
514
- { style: { scaleX: 1 }, duration: 0.6 }
515
- ], {
516
- reverse: false
517
- });
518
- }
519
- //设备运行
520
- run(d) {
521
- const temp = [
522
- {
523
- prop: 'light',
524
- fn: (d) => this.handleLight(d)
525
- },
526
- {
527
- prop: 'x',
528
- fn: (x) => this.moveX(x)
529
- },
530
- {
531
- prop: 'j1',
532
- fn: (j) => this.handleRotateR1(j)
533
- },
534
- {
535
- prop: 'j2',
536
- fn: (j) => this.handleRotateR2(j)
537
- }
538
- ];
539
- temp.forEach((tp) => {
540
- if (Object.hasOwn(d, tp.prop)) {
541
- tp.fn(d[tp.prop]);
542
- }
543
- });
544
- }
545
- }
@@ -1,167 +0,0 @@
1
- import { Box, Ellipse } 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
- * 装载站(LoadingStation)
12
- */
13
- export class LoadingStation extends ModelAbs {
14
- static PROGRESS_Y_OFFSET = 45;
15
- static NAME_PLATE_Y_OFFSET = 20;
16
- light = null;
17
- progress = null;
18
- entrance = null;
19
- stationSlotGroup = null;
20
- createUi() {
21
- const { uuid, className, nameplate, stationSlotGroup, width, height, x, y, zIndex, rotation, scale, visible, editable, draggable } = this.config;
22
- const cornerRadius = [4, 4, this.width_05, this.width_05];
23
- this.entrance = new Entrance({
24
- x: this.width_05,
25
- y: -2,
26
- width,
27
- height: this.width_02,
28
- isIn: false,
29
- isOut: false
30
- }).init();
31
- this.light = new EllipseLight({
32
- x: this.width_05,
33
- y: 24,
34
- width: this.width_02,
35
- height: this.width_02,
36
- strokeWidth: 6,
37
- strokeColor: '#D5DAE3'
38
- }).init();
39
- this.progress = new Progress({
40
- x: this.width_05,
41
- y: height - LoadingStation.PROGRESS_Y_OFFSET,
42
- width: this.width_05,
43
- height: 20,
44
- progress: 0
45
- }).init();
46
- const stationContainer = new Box({
47
- className: 'StationContainer',
48
- x: this.width_05,
49
- y: this.height_05,
50
- width: this.width_05,
51
- height: this.width_05,
52
- around: 'center',
53
- children: [
54
- createGlass({
55
- around: 'top-left',
56
- width: this.width_05,
57
- height: this.width_05,
58
- cornerRadius: this.width_05
59
- })
60
- ]
61
- });
62
- const main = new Box({
63
- data: this.config,
64
- id: uuid,
65
- className,
66
- x,
67
- y,
68
- width,
69
- height,
70
- zIndex,
71
- rotation,
72
- scale,
73
- visible,
74
- editable,
75
- draggable,
76
- origin: 'center',
77
- around: 'center',
78
- cornerRadius,
79
- fill: {
80
- type: 'linear',
81
- from: 'left',
82
- to: 'right',
83
- stops: [
84
- { offset: 0, color: '#999' },
85
- { offset: 1, color: '#555' }
86
- ]
87
- },
88
- shadow: {
89
- spread: 1,
90
- blur: 4,
91
- color: 'rgba(0,0,0,0.5)'
92
- },
93
- children: [
94
- new Box({
95
- hittable: false,
96
- width,
97
- height,
98
- fill: {
99
- type: 'linear',
100
- from: 'left',
101
- to: 'right',
102
- stops: ['#bbb', '#fff', '#fff', '#bbb']
103
- },
104
- cornerRadius,
105
- zIndex: -1
106
- }),
107
- new Box({
108
- hittable: false,
109
- width: 16,
110
- height: 70,
111
- fill: '#D5DAE3',
112
- x: this.width_05,
113
- around: 'top'
114
- }),
115
- new Ellipse({
116
- hittable: false,
117
- fill: '#D5DAE3',
118
- x: this.width_05,
119
- y: 24,
120
- width: this.width_02 + 4,
121
- height: this.width_02 + 4,
122
- around: 'center'
123
- }),
124
- stationContainer,
125
- this.entrance.ui,
126
- this.light.ui,
127
- this.progress.ui
128
- ]
129
- });
130
- if (stationSlotGroup) {
131
- this.stationSlotGroup = new StationSlotGroup({
132
- ...stationSlotGroup,
133
- x: this.width_05,
134
- y: this.height_05,
135
- width: this.width_05,
136
- height: this.width_05,
137
- hittable: this.config.hittable
138
- }, this.config.rotation).init();
139
- main.add(this.stationSlotGroup.ui);
140
- }
141
- if (nameplate) {
142
- main.add(NamePlate({
143
- title: nameplate,
144
- x: this.width_05,
145
- y: height - LoadingStation.NAME_PLATE_Y_OFFSET,
146
- stroke: 'rgba(0,0,0,0.05)'
147
- }));
148
- }
149
- setCursor(main, this.config);
150
- return main;
151
- }
152
- // 操作
153
- operating(data) {
154
- if (data.light && this.light) {
155
- this.light.operating(data.light);
156
- }
157
- if (data.progress && this.progress) {
158
- this.progress.operating(data.progress);
159
- }
160
- if (data.entrance && this.entrance) {
161
- this.entrance.operating(data.entrance);
162
- }
163
- if (data.resource && this.stationSlotGroup) {
164
- this.stationSlotGroup.operating(data.resource);
165
- }
166
- }
167
- }