@jnrs/lingshu-smart 2.2.35 → 2.2.37

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 (35) hide show
  1. package/AGENTS.md +35 -12
  2. package/README.md +10 -10
  3. package/dist/assets/data/editor_preset_menu.d.ts +8 -0
  4. package/dist/components/debug/DebugPanel.vue.d.ts +1 -60
  5. package/dist/components/debug/WsProxy/ConnPanel.vue.d.ts +13 -4
  6. package/dist/components/debug/WsProxy/index.vue.d.ts +3 -6
  7. package/dist/components/debug/WsProxy/proxy.d.ts +16 -4
  8. package/dist/components/editor/ControlBar/CaseTitleEdit.vue.d.ts +87 -87
  9. package/dist/components/editor/OptionCard/Equipment/models/Pallet.vue.d.ts +2 -0
  10. package/dist/components/editor/OptionCard/Equipment/stationSlot/StationSlotGroupDialog.vue.d.ts +8 -0
  11. package/dist/components/editor/OptionCard/Equipment/stationSlot/StationSlotGroupLayers.vue.d.ts +2 -0
  12. package/dist/components/index.d.ts +1 -2
  13. package/dist/components/index.js +6452 -31974
  14. package/dist/components/preview/index.vue.d.ts +504 -0
  15. package/dist/composables/useCaseLoading.d.ts +10 -0
  16. package/dist/index-YxSpi9Af.js +131 -0
  17. package/dist/index.js +41 -145
  18. package/dist/lingshu-smart/wsProxyConfig.json +30 -0
  19. package/dist/locales/index.js +2 -2
  20. package/dist/playground/ViewPageDemo.vue.d.ts +1107 -103
  21. package/dist/stores/index.js +7 -0
  22. package/dist/stores/useAppStore.d.ts +1651 -139
  23. package/dist/stores/useDataStore.d.ts +1651 -139
  24. package/dist/stores/useDebugStore.d.ts +30 -12
  25. package/dist/types/components/config.types.d.ts +5 -0
  26. package/dist/types/enums.d.ts +2 -1
  27. package/dist/types/guards.d.ts +7 -1
  28. package/dist/types/models/config.types.d.ts +29 -1
  29. package/dist/types/models/operating.types.d.ts +15 -1
  30. package/dist/ui/models/Pallet.d.ts +25 -0
  31. package/dist/ui/models/ShuttleStation.d.ts +17 -4
  32. package/dist/useAppStore-DQI1btcH.js +26123 -0
  33. package/package.json +6 -2
  34. package/dist/components/debug/WsProxy/WsProxyPage.vue.d.ts +0 -14
  35. package/dist/components/debug/WsProxy/broadcast.d.ts +0 -31
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @Author : TanRui
3
+ * @File : useCaseLoading.ts
4
+ * @Desc. : 方案操作全局 Loading(切换/新增/删除/导入等操作的服务级 Loading)
5
+ */
6
+ /**
7
+ * 展示全局"方案加载中..." Loading(服务方式调用)
8
+ * 同一 Loading 实例复用,连续触发时仅重置关闭计时,避免闪烁
9
+ */
10
+ export declare const showCaseLoading: () => void;
@@ -0,0 +1,131 @@
1
+ var T = /* @__PURE__ */ ((r) => (r.UNDO = "Undo", r.REDO = "Redo", r))(T || {}), b = /* @__PURE__ */ ((r) => (r.TRANSPORT = "搬运设备", r.MACHINE = "机床", r.CLEANING = "清洗机", r.STATION = "装载站", r.STORAGE = "库", r.OTHER = "其他", r))(b || {}), w = /* @__PURE__ */ ((r) => (r.SINGLE_JOINT_ROBOT = "SingleJointRobot", r.DOUBLE_JOINT_ROBOT = "DoubleJointRobot", r.RGV = "Rgv", r.MACHINE_TOOL = "MachineTool", r.MARKING_MACHINE = "MarkingMachine", r.CLEANING_MACHINE = "CleaningMachine", r.LOADING_STATION = "LoadingStation", r.SHUTTLE_STATION = "ShuttleStation", r.RAIL = "Rail", r.RESOURCE_STORE = "ResourceStore", r.PALLET = "Pallet", r))(w || {}), A = /* @__PURE__ */ ((r) => (r.STATION_SLOT = "StationSlot", r.RESOURCE = "Resource", r))(A || {}), S = /* @__PURE__ */ ((r) => (r.PALLET = "Pallet", r.TOOL = "Tool", r))(S || {});
2
+ const g = {
3
+ none: 0,
4
+ error: 1,
5
+ warn: 2,
6
+ info: 3,
7
+ log: 4,
8
+ operating: 5
9
+ }, I = {
10
+ log: "LOG",
11
+ info: "INFO",
12
+ warn: "WARN",
13
+ error: "ERROR",
14
+ operating: "OPERATING"
15
+ };
16
+ let c = "warn";
17
+ function F(r) {
18
+ c = r;
19
+ }
20
+ function C() {
21
+ return c;
22
+ }
23
+ const h = {
24
+ log: "background: #6c8eef; color: #fff; padding: 2px 5px; border-radius: 3px; font-weight: bold; font-size: 11px",
25
+ info: "background: #4CA56E; color: #fff; padding: 2px 5px; border-radius: 3px; font-weight: bold; font-size: 11px",
26
+ warn: "background: #e6a23c; color: #fff; padding: 2px 5px; border-radius: 3px; font-weight: bold; font-size: 11px",
27
+ error: "background: #f56c6c; color: #fff; padding: 2px 5px; border-radius: 3px; font-weight: bold; font-size: 11px",
28
+ operating: "background: #009866; color: #fff; padding: 2px 5px; border-radius: 3px; font-weight: bold; font-size: 11px"
29
+ }, p = "color: inherit; background: transparent; padding: 0; margin-left: 4px";
30
+ function _(r) {
31
+ return c === "operating-only" ? r === "operating" || r === "error" : r === "operating" ? c === "operating" : g[r] <= g[c];
32
+ }
33
+ const E = {
34
+ log: "log",
35
+ info: "info",
36
+ warn: "warn",
37
+ error: "error",
38
+ operating: "log"
39
+ };
40
+ function a(r, o, ...t) {
41
+ if (!_(r)) return;
42
+ const e = r === "log" || r === "info" || r === "operating", i = I[r], n = E[r];
43
+ o && e ? t.length > 0 && typeof t[0] == "string" ? console[n](`%c${i}:${o}%c ${t[0]}`, h[r], p, ...t.slice(1)) : console[n](`%c${i}:${o}%c`, h[r], p, ...t) : o ? t.length > 0 && typeof t[0] == "string" ? console[n](`[${i}:${o}] ${t[0]}`, ...t.slice(1)) : console[n](`[${i}:${o}]`, ...t) : console[n](...t);
44
+ }
45
+ function P(r = "") {
46
+ return {
47
+ log: (...o) => a("log", r, ...o),
48
+ info: (...o) => a("info", r, ...o),
49
+ warn: (...o) => a("warn", r, ...o),
50
+ error: (...o) => a("error", r, ...o),
51
+ operating: (...o) => a("operating", r, ...o)
52
+ };
53
+ }
54
+ const G = P("LingshuSmart");
55
+ function* $(r, o, t = !1) {
56
+ let e = r;
57
+ for (; ; ) {
58
+ if (e > o)
59
+ if (t)
60
+ e = r;
61
+ else
62
+ return;
63
+ yield e++;
64
+ }
65
+ }
66
+ const H = (r = 0, o = 100, t = 3, e = 300, i) => i ? new Promise((n) => {
67
+ const f = r, l = o, L = t * 1e3, O = performance.now();
68
+ let s = 0;
69
+ const u = (x) => {
70
+ const N = x - O, d = Math.min(N / L, 1), R = f + (l - f) * d;
71
+ if (i(R.toFixed(2)), d >= 1) {
72
+ cancelAnimationFrame(s), n();
73
+ return;
74
+ }
75
+ s = requestAnimationFrame(u);
76
+ };
77
+ s = requestAnimationFrame(u);
78
+ }) : !1;
79
+ function k(r, o, t = 3, e) {
80
+ return r === void 0 || o === void 0 ? 0 : e ? o > 0 ? Number((r / o).toFixed(3)) : 0 : Number((o * r).toFixed(t));
81
+ }
82
+ function D(r, o) {
83
+ return r === void 0 || o === void 0 ? 0 : o > 0 ? Number((r / o).toFixed(3)) : r;
84
+ }
85
+ function U(r, o, t, e) {
86
+ if (r === void 0) return NaN;
87
+ let i = 0;
88
+ if (e === "width") {
89
+ const n = o?.width || 0, f = o?.runtime_width || 0;
90
+ if (n === 0 || f === 0) return 0;
91
+ i = n / f;
92
+ }
93
+ if (e === "height") {
94
+ const n = o?.height || 0, f = o?.runtime_height || 0;
95
+ if (n === 0 || f === 0) return 0;
96
+ i = n / f;
97
+ }
98
+ return Number((r * i).toFixed(t));
99
+ }
100
+ function m(r, o, t, e) {
101
+ if (r === void 0) return NaN;
102
+ let i = 0;
103
+ if (e === "width") {
104
+ const n = o?.width || 0;
105
+ if (n === 0) return r;
106
+ i = n * r;
107
+ }
108
+ if (e === "height") {
109
+ const n = o?.height || 0;
110
+ if (n === 0) return r;
111
+ i = n * r;
112
+ }
113
+ return Number(i.toFixed(t));
114
+ }
115
+ export {
116
+ S as E,
117
+ b as a,
118
+ T as b,
119
+ P as c,
120
+ w as d,
121
+ A as e,
122
+ m as f,
123
+ U as g,
124
+ C as h,
125
+ H as i,
126
+ D as j,
127
+ G as l,
128
+ $ as n,
129
+ F as s,
130
+ k as t
131
+ };
package/dist/index.js CHANGED
@@ -1,155 +1,51 @@
1
- var S = /* @__PURE__ */ ((r) => (r.UNDO = "Undo", r.REDO = "Redo", r))(S || {}), _ = /* @__PURE__ */ ((r) => (r.TRANSPORT = "搬运设备", r.MACHINE = "机床", r.CLEANING = "清洗机", r.STATION = "装载站", r.STORAGE = "库", r.OTHER = "其他", r))(_ || {}), c = /* @__PURE__ */ ((r) => (r.SINGLE_JOINT_ROBOT = "SingleJointRobot", r.DOUBLE_JOINT_ROBOT = "DoubleJointRobot", r.RGV = "Rgv", r.MACHINE_TOOL = "MachineTool", r.MARKING_MACHINE = "MarkingMachine", r.CLEANING_MACHINE = "CleaningMachine", r.LOADING_STATION = "LoadingStation", r.SHUTTLE_STATION = "ShuttleStation", r.RAIL = "Rail", r.RESOURCE_STORE = "ResourceStore", r))(c || {}), A = /* @__PURE__ */ ((r) => (r.STATION_SLOT = "StationSlot", r.RESOURCE = "Resource", r))(A || {}), x = /* @__PURE__ */ ((r) => (r.PALLET = "Pallet", r.TOOL = "Tool", r))(x || {});
2
- function G(r) {
3
- return r?.className === c.MACHINE_TOOL;
1
+ import { d as a } from "./index-YxSpi9Af.js";
2
+ import { e as l, E as O, b as E, a as L, c as I, h as S, i as _, l as A, n as R, s as f, j as g, t as p, f as G, g as h } from "./index-YxSpi9Af.js";
3
+ function n(s) {
4
+ return s?.className === a.MACHINE_TOOL;
4
5
  }
5
- function C(r) {
6
- return r?.className === c.MACHINE_TOOL || r?.className === c.MARKING_MACHINE || r?.className === c.CLEANING_MACHINE || r?.className === c.LOADING_STATION;
6
+ function t(s) {
7
+ return s?.className === a.MACHINE_TOOL || s?.className === a.MARKING_MACHINE || s?.className === a.CLEANING_MACHINE || s?.className === a.LOADING_STATION;
7
8
  }
8
- function F(r) {
9
- return r?.className === c.RESOURCE_STORE || r?.className === c.SINGLE_JOINT_ROBOT || r?.className === c.DOUBLE_JOINT_ROBOT || r?.className === c.RGV;
9
+ function o(s) {
10
+ return s?.className === a.RESOURCE_STORE || s?.className === a.SINGLE_JOINT_ROBOT || s?.className === a.DOUBLE_JOINT_ROBOT || s?.className === a.RGV || s?.className === a.PALLET;
10
11
  }
11
- function B(r) {
12
- return r?.className === c.SINGLE_JOINT_ROBOT || r?.className === c.DOUBLE_JOINT_ROBOT;
12
+ function r(s) {
13
+ return s?.className === a.SHUTTLE_STATION;
13
14
  }
14
- function H(r) {
15
- return r?.className === c.RAIL;
15
+ function N(s) {
16
+ return s?.className === a.SINGLE_JOINT_ROBOT || s?.className === a.DOUBLE_JOINT_ROBOT;
16
17
  }
17
- function P(r) {
18
- return r?.className === c.SHUTTLE_STATION;
18
+ function c(s) {
19
+ return s?.className === a.RAIL;
19
20
  }
20
- const d = {
21
- none: 0,
22
- error: 1,
23
- warn: 2,
24
- info: 3,
25
- log: 4,
26
- operating: 5
27
- }, E = {
28
- log: "LOG",
29
- info: "INFO",
30
- warn: "WARN",
31
- error: "ERROR",
32
- operating: "OPERATING"
33
- };
34
- let s = "warn";
35
- function U(r) {
36
- s = r;
37
- }
38
- function $() {
39
- return s;
40
- }
41
- const h = {
42
- log: "background: #6c8eef; color: #fff; padding: 2px 5px; border-radius: 3px; font-weight: bold; font-size: 11px",
43
- info: "background: #4CA56E; color: #fff; padding: 2px 5px; border-radius: 3px; font-weight: bold; font-size: 11px",
44
- warn: "background: #e6a23c; color: #fff; padding: 2px 5px; border-radius: 3px; font-weight: bold; font-size: 11px",
45
- error: "background: #f56c6c; color: #fff; padding: 2px 5px; border-radius: 3px; font-weight: bold; font-size: 11px",
46
- operating: "background: #009866; color: #fff; padding: 2px 5px; border-radius: 3px; font-weight: bold; font-size: 11px"
47
- }, l = "color: inherit; background: transparent; padding: 0; margin-left: 4px";
48
- function b(r) {
49
- return s === "operating-only" ? r === "operating" || r === "error" : r === "operating" ? s === "operating" : d[r] <= d[s];
50
- }
51
- const w = {
52
- log: "log",
53
- info: "info",
54
- warn: "warn",
55
- error: "error",
56
- operating: "log"
57
- };
58
- function f(r, t, ...n) {
59
- if (!b(r)) return;
60
- const e = r === "log" || r === "info" || r === "operating", i = E[r], o = w[r];
61
- t && e ? n.length > 0 && typeof n[0] == "string" ? console[o](`%c${i}:${t}%c ${n[0]}`, h[r], l, ...n.slice(1)) : console[o](`%c${i}:${t}%c`, h[r], l, ...n) : t ? n.length > 0 && typeof n[0] == "string" ? console[o](`[${i}:${t}] ${n[0]}`, ...n.slice(1)) : console[o](`[${i}:${t}]`, ...n) : console[o](...n);
62
- }
63
- function m(r = "") {
64
- return {
65
- log: (...t) => f("log", r, ...t),
66
- info: (...t) => f("info", r, ...t),
67
- warn: (...t) => f("warn", r, ...t),
68
- error: (...t) => f("error", r, ...t),
69
- operating: (...t) => f("operating", r, ...t)
70
- };
71
- }
72
- const D = m("LingshuSmart");
73
- function* J(r, t, n = !1) {
74
- let e = r;
75
- for (; ; ) {
76
- if (e > t)
77
- if (n)
78
- e = r;
79
- else
80
- return;
81
- yield e++;
82
- }
83
- }
84
- const M = (r = 0, t = 100, n = 3, e = 300, i) => i ? new Promise((o) => {
85
- const a = r, T = t, L = n * 1e3, g = performance.now();
86
- let u = 0;
87
- const N = (p) => {
88
- const R = p - g, O = Math.min(R / L, 1), I = a + (T - a) * O;
89
- if (i(I.toFixed(2)), O >= 1) {
90
- cancelAnimationFrame(u), o();
91
- return;
92
- }
93
- u = requestAnimationFrame(N);
94
- };
95
- u = requestAnimationFrame(N);
96
- }) : !1;
97
- function k(r, t, n = 3, e) {
98
- return r === void 0 || t === void 0 ? 0 : e ? t > 0 ? Number((r / t).toFixed(3)) : 0 : Number((t * r).toFixed(n));
99
- }
100
- function V(r, t) {
101
- return r === void 0 || t === void 0 ? 0 : t > 0 ? Number((r / t).toFixed(3)) : r;
102
- }
103
- function Y(r, t, n, e) {
104
- if (r === void 0) return NaN;
105
- let i = 0;
106
- if (e === "width") {
107
- const o = t?.width || 0, a = t?.runtime_width || 0;
108
- if (o === 0 || a === 0) return 0;
109
- i = o / a;
110
- }
111
- if (e === "height") {
112
- const o = t?.height || 0, a = t?.runtime_height || 0;
113
- if (o === 0 || a === 0) return 0;
114
- i = o / a;
115
- }
116
- return Number((r * i).toFixed(n));
21
+ function T(s) {
22
+ return s?.className === a.SHUTTLE_STATION;
117
23
  }
118
- function q(r, t, n, e) {
119
- if (r === void 0) return NaN;
120
- let i = 0;
121
- if (e === "width") {
122
- const o = t?.width || 0;
123
- if (o === 0) return r;
124
- i = o * r;
125
- }
126
- if (e === "height") {
127
- const o = t?.height || 0;
128
- if (o === 0) return r;
129
- i = o * r;
130
- }
131
- return Number(i.toFixed(n));
24
+ function i(s) {
25
+ return s?.className === a.PALLET;
132
26
  }
133
27
  export {
134
- A as EnumComponent,
135
- c as EnumModel,
136
- x as EnumResourceType,
137
- S as EnumStepType,
138
- _ as EnumTag,
139
- m as createLogger,
140
- $ as getLogLevel,
141
- B as hasFixtureChange,
142
- C as hasStationSlotGroup,
143
- G as isMachineTool,
144
- H as isRail,
145
- P as isShuttleStation,
146
- F as isStationSlotGroupBoth,
147
- M as linearIncrease,
148
- D as logger,
149
- J as numberLoopGenerator,
150
- U as setLogLevel,
151
- V as transFraction,
152
- k as transPercentAndPixel,
153
- q as transPercentToPixel,
154
- Y as transRuntimeToPixel
28
+ l as EnumComponent,
29
+ a as EnumModel,
30
+ O as EnumResourceType,
31
+ E as EnumStepType,
32
+ L as EnumTag,
33
+ I as createLogger,
34
+ S as getLogLevel,
35
+ N as hasFixtureChange,
36
+ t as hasStationSlotGroup,
37
+ r as hasStationSlotLayers,
38
+ n as isMachineTool,
39
+ i as isPallet,
40
+ c as isRail,
41
+ T as isShuttleStation,
42
+ o as isStationSlotGroupBoth,
43
+ _ as linearIncrease,
44
+ A as logger,
45
+ R as numberLoopGenerator,
46
+ f as setLogLevel,
47
+ g as transFraction,
48
+ p as transPercentAndPixel,
49
+ G as transPercentToPixel,
50
+ h as transRuntimeToPixel
155
51
  };
@@ -1,7 +1,10 @@
1
1
  {
2
2
  "name": "lingshu-smart/wsProxyConfig",
3
3
  "version": 1,
4
+ "dataSource": "builtin",
4
5
  "wsUrl": "ws://192.168.0.1:8080",
6
+ "requestMode": "direct",
7
+ "autoConnect": true,
5
8
  "payloadKey": "data",
6
9
  "sourceTypeField": "data.type",
7
10
  "heartbeatInterval": 0,
@@ -231,6 +234,33 @@
231
234
  { "target": "botId", "source": "botId" }
232
235
  ]
233
236
  },
237
+ {
238
+ "sourceType": "Pallet",
239
+ "className": "Pallet",
240
+ "equipmentName": "托盘",
241
+ "enabled": true,
242
+ "operate": "single",
243
+ "mappings": [
244
+ { "target": "id", "source": "id", "defaultValue": "" },
245
+ { "target": "light.color", "source": "displayColor", "defaultValue": "#424242" },
246
+ { "target": "light.rotating", "source": "status", "valueMap": { "1": true }, "defaultValue": false },
247
+ { "target": "light.blinking", "source": "status", "valueMap": { "2": true }, "defaultValue": false },
248
+ {
249
+ "target": "x",
250
+ "source": "x",
251
+ "transform": "percentToPixel",
252
+ "transformType": "width",
253
+ "transformPrecision": 2
254
+ },
255
+ {
256
+ "target": "y",
257
+ "source": "y",
258
+ "transform": "percentToPixel",
259
+ "transformType": "height",
260
+ "transformPrecision": 2
261
+ }
262
+ ]
263
+ },
234
264
  {
235
265
  "sourceType": "LoadingStation",
236
266
  "className": "LoadingStation",
@@ -14,7 +14,7 @@ const e = {
14
14
  reset: "恢复默认",
15
15
  close: "关闭",
16
16
  triggerTitle: "调试模式",
17
- triggerMessage: "检测到调试模式触发指令,请选择要显示的调试组件",
17
+ triggerMessage: "检测到调试模式触发指令,是否打开调试模式?",
18
18
  triggerConfirm: "打开",
19
19
  triggerCancel: "取消",
20
20
  logLevels: {
@@ -63,7 +63,7 @@ const e = {
63
63
  reset: "Reset",
64
64
  close: "Close",
65
65
  triggerTitle: "Debug Mode",
66
- triggerMessage: "Debug mode trigger detected. Please select the debug component to display.",
66
+ triggerMessage: "Debug mode trigger detected. Would you like to open debug mode?",
67
67
  triggerConfirm: "Open",
68
68
  triggerCancel: "Cancel",
69
69
  logLevels: {