@jnrs/lingshu-smart 2.2.14 → 2.2.15

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/index.js CHANGED
@@ -1,24 +1,28 @@
1
- var R = /* @__PURE__ */ ((O) => (O.UNDO = "Undo", O.REDO = "Redo", O))(R || {}), a = /* @__PURE__ */ ((O) => (O.TRANSPORT = "搬运设备", O.MACHINE = "机床", O.CLEANING = "清洗机", O.STATION = "装载站", O.STORAGE = "库", O.OTHER = "其他", O))(a || {}), N = /* @__PURE__ */ ((O) => (O.SINGLE_JOINT_ROBOT = "SingleJointRobot", O.DOUBLE_JOINT_ROBOT = "DoubleJointRobot", O.RGV = "Rgv", O.MACHINE_TOOL = "MachineTool", O.MARKING_MACHINE = "MarkingMachine", O.CLEANING_MACHINE = "CleaningMachine", O.LOADING_STATION = "LoadingStation", O.PALLET_STORAGE = "PalletStorage", O.TOOL_STORAGE = "ToolStorage", O.BUFFER_DOCK = "BufferDock", O.GROUND_RAIL = "GroundRail", O.FOLLOWING_TUGGER = "FollowingTugger", O.RAIL = "Rail", O.RESOURCE_STORE = "ResourceStore", O))(N || {}), T = /* @__PURE__ */ ((O) => (O.STATION_SLOT = "StationSlot", O.RESOURCE = "Resource", O))(T || {}), t = /* @__PURE__ */ ((O) => (O.PALLET = "Pallet", O.TOOL = "Tool", O))(t || {});
1
+ var R = /* @__PURE__ */ ((O) => (O.UNDO = "Undo", O.REDO = "Redo", O))(R || {}), a = /* @__PURE__ */ ((O) => (O.TRANSPORT = "搬运设备", O.MACHINE = "机床", O.CLEANING = "清洗机", O.STATION = "装载站", O.STORAGE = "库", O.OTHER = "其他", O))(a || {}), N = /* @__PURE__ */ ((O) => (O.SINGLE_JOINT_ROBOT = "SingleJointRobot", O.DOUBLE_JOINT_ROBOT = "DoubleJointRobot", O.RGV = "Rgv", O.MACHINE_TOOL = "MachineTool", O.MARKING_MACHINE = "MarkingMachine", O.CLEANING_MACHINE = "CleaningMachine", O.LOADING_STATION = "LoadingStation", O.PALLET_STORAGE = "PalletStorage", O.TOOL_STORAGE = "ToolStorage", O.BUFFER_DOCK = "BufferDock", O.GROUND_RAIL = "GroundRail", O.FOLLOWING_TUGGER = "FollowingTugger", O.RAIL = "Rail", O.RESOURCE_STORE = "ResourceStore", O))(N || {}), t = /* @__PURE__ */ ((O) => (O.STATION_SLOT = "StationSlot", O.RESOURCE = "Resource", O))(t || {}), T = /* @__PURE__ */ ((O) => (O.PALLET = "Pallet", O.TOOL = "Tool", O))(T || {});
2
2
  function r(O) {
3
3
  return O?.className === N.MACHINE_TOOL;
4
4
  }
5
5
  function I(O) {
6
- return O?.className === N.MACHINE_TOOL || O?.className === N.MARKING_MACHINE || O?.className === N.CLEANING_MACHINE || O?.className === N.LOADING_STATION || O?.className === N.RESOURCE_STORE;
6
+ return O?.className === N.MACHINE_TOOL || O?.className === N.MARKING_MACHINE || O?.className === N.CLEANING_MACHINE || O?.className === N.LOADING_STATION;
7
7
  }
8
8
  function A(O) {
9
+ return O?.className === N.RESOURCE_STORE || O?.className === N.SINGLE_JOINT_ROBOT;
10
+ }
11
+ function i(O) {
9
12
  return O?.className === N.SINGLE_JOINT_ROBOT || O?.className === N.DOUBLE_JOINT_ROBOT;
10
13
  }
11
- function L(O) {
14
+ function o(O) {
12
15
  return O?.className === N.RAIL;
13
16
  }
14
17
  export {
15
- T as EnumComponent,
18
+ t as EnumComponent,
16
19
  N as EnumModel,
17
- t as EnumResourceType,
20
+ T as EnumResourceType,
18
21
  R as EnumStepType,
19
22
  a as EnumTag,
20
- A as hasFixtureChange,
23
+ i as hasFixtureChange,
21
24
  I as hasStationSlotGroup,
22
25
  r as isMachineTool,
23
- L as isRail
26
+ o as isRail,
27
+ A as isStationSlotGroupBoth
24
28
  };
@@ -0,0 +1,27 @@
1
+ /**
2
+ * @Author : TanRui
3
+ * @WeChat : Tan578853789
4
+ * @File : mockWebSocketData.ts
5
+ * @Date : 2026/04/27
6
+ * @Desc. : WebSocket 模拟测试数据
7
+ */
8
+ /**
9
+ * 第一批测试数据(1.5秒后发送)
10
+ */
11
+ export declare const firstBatchMessages: {
12
+ traceId: string;
13
+ type: string;
14
+ payload: any;
15
+ }[];
16
+ /**
17
+ * 第二批测试数据(3秒后发送)
18
+ */
19
+ export declare const secondBatchMessages: {
20
+ traceId: string;
21
+ type: string;
22
+ payload: any;
23
+ }[];
24
+ /**
25
+ * 注释掉的测试数据(备用)
26
+ */
27
+ export declare const commentedMessages: never[];
@@ -1,82 +1,79 @@
1
- import { IRowData, IBaseConfig, IInteractiveState } from '../base.types'
2
- import { EnumResourceType, EnumComponent } from '../enums'
3
- export type IOriginAround = 'center' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'
1
+ import { IRowData, IBaseConfig, IInteractiveState } from '../base.types';
2
+ import { EnumResourceType, EnumComponent } from '../enums';
3
+ export type IOriginAround = 'center' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
4
4
  /**
5
5
  * 工位
6
6
  */
7
7
  export interface IStationSlotConfig extends IBaseConfig, IInteractiveState {
8
- className?: EnumComponent.STATION_SLOT
9
- resourceType: EnumResourceType
10
- index: number
11
- name?: string
12
- rotation?: number
13
- parentRotation?: number
14
- disabled?: boolean
15
- origin?: IOriginAround
16
- around?: IOriginAround
17
- hideBounds?: boolean // 是否隐藏边界
8
+ className?: EnumComponent.STATION_SLOT;
9
+ resourceType: EnumResourceType;
10
+ index: number;
11
+ name?: string;
12
+ rotation?: number;
13
+ parentRotation?: number;
14
+ disabled?: boolean;
15
+ origin?: IOriginAround;
16
+ around?: IOriginAround;
17
+ hideBounds?: boolean;
18
18
  }
19
19
  /**
20
20
  * 布局选项
21
21
  */
22
22
  export interface IFlowConfig {
23
- flow: 'x' | 'y' | 'x-reverse' | 'y-reverse'
24
- flowWrap: boolean | 'reverse'
25
- oneDirectionMaxQuantity: number
26
- gap: number
23
+ flow: 'x' | 'y' | 'x-reverse' | 'y-reverse';
24
+ flowWrap: boolean | 'reverse';
25
+ oneDirectionMaxQuantity: number;
26
+ gap: number;
27
+ width: number;
28
+ height: number;
27
29
  }
28
30
  /**
29
31
  * 工位组
30
32
  */
31
- export interface IStationSlotGroupConfig extends IBaseConfig {
32
- parentRotation?: number
33
- origin?: IOriginAround
34
- around?: IOriginAround
35
- stationSlots: IStationSlotConfig[]
36
- flowOptions: IFlowConfig
37
- hittable?: boolean
33
+ export interface IStationSlotGroupConfig extends Omit<IBaseConfig, 'width' | 'height'>, IInteractiveState {
34
+ width?: number;
35
+ height?: number;
36
+ parentRotation?: number;
37
+ origin?: IOriginAround;
38
+ around?: IOriginAround;
39
+ stationSlots: IStationSlotConfig[];
40
+ flowOptions: IFlowConfig;
38
41
  }
39
42
  /**
40
43
  * 资源
41
44
  */
42
45
  export interface IResourceConfig extends IBaseConfig, IInteractiveState {
43
- className?: EnumComponent.RESOURCE
44
- resourceType: EnumResourceType
45
- name?: string
46
- color?: string
47
- rawData: IRowData
46
+ className?: EnumComponent.RESOURCE;
47
+ resourceType: EnumResourceType;
48
+ name?: string;
49
+ color?: string;
50
+ rawData: IRowData;
48
51
  }
49
52
  /**
50
53
  * 状态灯
51
54
  */
52
55
  export interface ILightConfig extends IBaseConfig {
53
- color?: string
54
- strokeColor?: string
55
- strokeWidth?: number
56
- cornerRadius?: number | number[]
57
- showShadow?: boolean
56
+ color?: string;
57
+ strokeColor?: string;
58
+ strokeWidth?: number;
59
+ cornerRadius?: number | number[];
60
+ showShadow?: boolean;
58
61
  }
59
62
  /**
60
63
  * 进度条
61
64
  */
62
65
  export interface IProgressConfig extends IBaseConfig {
63
- progress: number
64
- fill?: string
65
- textContent?: string
66
- textShow?: boolean
67
- textPosition?: 'left' | 'center' | 'right'
66
+ progress: number;
67
+ fill?: string;
68
+ textContent?: string;
69
+ textShow?: boolean;
70
+ textPosition?: 'left' | 'center' | 'right';
68
71
  }
69
72
  /**
70
73
  * 出入口
71
74
  */
72
75
  export interface IEntranceConfig extends IBaseConfig {
73
- isIn: boolean
74
- isOut: boolean
76
+ isIn: boolean;
77
+ isOut: boolean;
75
78
  }
76
- export type IComponent =
77
- | IStationSlotConfig
78
- | IResourceConfig
79
- | IStationSlotGroupConfig
80
- | IProgressConfig
81
- | ILightConfig
82
- | IEntranceConfig
79
+ export type IComponent = IStationSlotConfig | IResourceConfig | IStationSlotGroupConfig | IProgressConfig | ILightConfig | IEntranceConfig;
@@ -1,5 +1,11 @@
1
1
  import { ILayer } from './index';
2
2
  export declare function isMachineTool(layer: ILayer | null): layer is import('./index').IMachineToolConfig;
3
- export declare function hasStationSlotGroup(layer: ILayer | null): layer is import('./index').IMachineToolConfig | import('./index').ILoadingStationConfig | import('./index').IMarkingMachineConfig | import('./index').ICleaningMachineConfig | import('./index').IResourceStoreConfig;
3
+ export declare function hasStationSlotGroup(layer: ILayer | null): layer is Extract<ILayer, {
4
+ stationSlotGroup?: any;
5
+ }>;
6
+ export declare function isStationSlotGroupBoth(layer: ILayer | null): layer is Extract<ILayer, {
7
+ stationSlotGroupPallet?: any;
8
+ stationSlotGroupTool?: any;
9
+ }>;
4
10
  export declare function hasFixtureChange(layer: ILayer | null): layer is import('./index').ISingleJointRobotConfig | import('./index').IDoubleJointRobotConfig;
5
11
  export declare function isRail(layer: ILayer | null): layer is import('./index').IRailConfig;
@@ -1,6 +1,6 @@
1
1
  import { EnumModel, EnumTag, EnumResourceType } from '../enums';
2
2
  import { IRowData, IBaseConfig, IEventState } from '../base.types';
3
- import { IStationSlotGroupConfig } from '../components/config.types';
3
+ import { IStationSlotGroupConfig, IFlowConfig } from '../components/config.types';
4
4
  /**
5
5
  * 设备模型基类
6
6
  */
@@ -12,6 +12,8 @@ export interface IModel extends IBaseConfig, IEventState {
12
12
  manufacturer?: string;
13
13
  group?: string;
14
14
  tags?: EnumTag[];
15
+ offsetX?: number;
16
+ offsetY?: number;
15
17
  x: number;
16
18
  y: number;
17
19
  percentX: number;
@@ -61,6 +63,9 @@ export interface ISingleJointRobotConfig extends IModel {
61
63
  currentFixture: EnumResourceType;
62
64
  linkRailId?: string;
63
65
  linkTrailerId?: string;
66
+ flowOptions?: IFlowConfig;
67
+ stationSlotGroupPallet?: IStationSlotGroupConfig;
68
+ stationSlotGroupTool?: IStationSlotGroupConfig;
64
69
  }
65
70
  /**
66
71
  * 双关节机器人
@@ -84,7 +89,9 @@ export interface IRailConfig extends IModel {
84
89
  */
85
90
  export interface IResourceStoreConfig extends IModel {
86
91
  className: EnumModel.RESOURCE_STORE;
87
- stationSlotGroup?: IStationSlotGroupConfig;
92
+ flowOptions?: IFlowConfig;
93
+ stationSlotGroupPallet?: IStationSlotGroupConfig;
94
+ stationSlotGroupTool?: IStationSlotGroupConfig;
88
95
  }
89
96
  /**
90
97
  * 设备层联合类型
@@ -93,6 +93,8 @@ export interface IRailOperating extends IModelOperating {
93
93
  export interface IResourceStoreOperating extends IModelOperating {
94
94
  className: EnumModel.RESOURCE_STORE;
95
95
  light?: ILightOperating;
96
+ x?: number;
97
+ resource?: IResourceOperating;
96
98
  }
97
99
  /**
98
100
  * 设备层运转状态的联合类型
@@ -16,6 +16,7 @@ export declare class StationSlotGroup extends ComponentAbs<IStationSlotGroupConf
16
16
  height: number;
17
17
  };
18
18
  protected createUi(): Flow;
19
+ toggleVisible(visible: boolean | 0): void;
19
20
  /**
20
21
  * 操作方法:处理资源新增/移除
21
22
  */
@@ -1,6 +1,6 @@
1
1
  import { Text } from 'leafer';
2
2
  export interface CreateTextOptions {
3
- name?: string;
3
+ name?: string | number;
4
4
  width: number;
5
5
  height: number;
6
6
  className?: string;
@@ -5,8 +5,11 @@ import { ModelAbs } from '../abstract/ModelAbs';
5
5
  * 资源库
6
6
  */
7
7
  export declare class ResourceStore extends ModelAbs<IResourceStoreConfig> {
8
+ private static readonly CORNER_RADIUS;
8
9
  private light;
9
- private stationSlotGroup;
10
+ private stationSlotGroupPallet;
11
+ private stationSlotGroupTool;
10
12
  protected createUi(): Box;
13
+ private moveX;
11
14
  protected operating(data: IResourceStoreOperating): void;
12
15
  }
@@ -3,7 +3,6 @@ import { Box } from 'leafer';
3
3
  import { ModelAbs } from '../abstract/ModelAbs';
4
4
  /**
5
5
  * 单关节机器人
6
- * 基于 ModelAbs 重构,保留 Bot.js 核心运行行为:状态灯、沿 X 移动、手臂旋转、夹具切换。
7
6
  */
8
7
  export declare class SingleJointRobot extends ModelAbs<ISingleJointRobotConfig> {
9
8
  private static readonly DEFAULT_WIDTH;
@@ -12,8 +11,8 @@ export declare class SingleJointRobot extends ModelAbs<ISingleJointRobotConfig>
12
11
  private light1;
13
12
  private light2;
14
13
  private defaultLightColor;
15
- private palletStationSlot;
16
- private cutterStationSlot;
14
+ private stationSlotGroupPallet;
15
+ private stationSlotGroupTool;
17
16
  protected createUi(): Box;
18
17
  protected operating(data: ISingleJointRobotOperating): void;
19
18
  private handleRotate;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jnrs/lingshu-smart",
3
- "version": "2.2.14",
3
+ "version": "2.2.15",
4
4
  "description": "LingShu Smart 2D Digital Twin System.",
5
5
  "keywords": [
6
6
  "jnrs",