@jnrs/lingshu-smart 3.1.0 → 3.1.1
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/AGENTS.md +37 -37
- package/dist/components/index.js +17 -21
- package/dist/components/preview/index.vue.d.ts +130 -0
- package/dist/controller/AppController.d.ts +6 -1
- package/dist/playground/ViewPageDemo.vue.d.ts +260 -0
- package/dist/stores/index.js +1 -1
- package/dist/stores/useAppStore.d.ts +390 -0
- package/dist/stores/useDataStore.d.ts +390 -0
- package/dist/types/models/operating.types.d.ts +7 -0
- package/dist/ui/abstract/ModelAbs.d.ts +15 -1
- package/dist/ui/models/DoubleJointRobot.d.ts +0 -1
- package/dist/ui/models/Pallet.d.ts +0 -1
- package/dist/ui/models/Rail.d.ts +4 -2
- package/dist/ui/models/ResourceStore.d.ts +0 -1
- package/dist/ui/models/Rgv.d.ts +0 -1
- package/dist/ui/models/SingleJointRobot.d.ts +0 -1
- package/dist/ui/utils/railLocal.d.ts +36 -0
- package/dist/{useAppStore-DWFfsey0.js → useAppStore-C-k9P93v.js} +875 -811
- package/package.json +1 -1
|
@@ -11,6 +11,13 @@ export interface IPositionOperating {
|
|
|
11
11
|
x?: number;
|
|
12
12
|
y?: number;
|
|
13
13
|
z?: number;
|
|
14
|
+
/**
|
|
15
|
+
* 画布内部字段:协议 `position.x` 的**原始值**(SocketDispatcher 换算像素时附带,不入协议)。
|
|
16
|
+
* 设备绑定轨道(linkRailId)时用于沿轨定位:≤ 1 视为沿轨道长度的比例(0 = 轨道起点端、1 = 终点端);
|
|
17
|
+
* > 1 视为自轨道起点端算起的沿轨像素距离(代理已配置「像素转换」特殊处理的情形)。
|
|
18
|
+
* 未绑定轨道时不参与定位(仍用 x 的场景像素值)
|
|
19
|
+
*/
|
|
20
|
+
rawX?: number;
|
|
14
21
|
j1?: number;
|
|
15
22
|
j2?: number;
|
|
16
23
|
fork_xy?: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ILayer, InteractiveUi, IEventHandler, ILayerOperating, EnumResourceType } from '../../types';
|
|
1
|
+
import { ILayer, InteractiveUi, IEventHandler, ILayerOperating, IRailConfig, EnumResourceType } from '../../types';
|
|
2
2
|
import { StationSlotGroup } from '../components/StationSlotGroup';
|
|
3
3
|
import { AppController } from '../../controller/AppController';
|
|
4
4
|
import { BaseAbs } from './BaseAbs';
|
|
@@ -15,6 +15,20 @@ export declare abstract class ModelAbs<T extends ILayer = ILayer> extends BaseAb
|
|
|
15
15
|
* 托盘跟随等联动使用该值保持动画同步;子类可覆盖(如双关节机器人 0.5s)
|
|
16
16
|
*/
|
|
17
17
|
get moveDuration(): number;
|
|
18
|
+
/**
|
|
19
|
+
* 沿 x 位移(搬运设备通用)
|
|
20
|
+
* - 未绑定轨道(linkRailId):按场景绝对坐标位移(原行为,x 为像素)
|
|
21
|
+
* - 已绑定轨道:按「沿轨距离」定位——rawX ≤ 1 为沿轨道长度的比例(0 = 轨道起点端、1 = 终点端),
|
|
22
|
+
* rawX > 1 为自轨道起点端算起的沿轨像素距离(代理已配置「像素转换」的情形);
|
|
23
|
+
* 横向沿用编辑期设计的「相对轨道偏移」(不消费协议 y),朝向 = 编辑期 rotation + 轨道 rotation
|
|
24
|
+
* @param x 场景绝对 x(像素,由协议比例按场景宽度换算;> 1 的代理像素值原样透传)
|
|
25
|
+
* @param rawX 协议 position.x 原始值(画布内部字段,绑定轨道时使用)
|
|
26
|
+
*/
|
|
27
|
+
protected moveX(x?: number, rawX?: number): void;
|
|
28
|
+
/** 绑定轨道(linkRailId,或轨道侧 linkEquipIdArray 反查)的轨道配置;未绑定或轨道未加载时返回 null */
|
|
29
|
+
protected get boundRailConfig(): IRailConfig | null;
|
|
30
|
+
/** 沿轨定位:协议值 → 沿轨局部距离 → 场景坐标;越出轨道长度收敛到 [0, 轨道长度] */
|
|
31
|
+
private moveXAlongRail;
|
|
18
32
|
handleOperation: (data: ILayerOperating) => void;
|
|
19
33
|
/**
|
|
20
34
|
* 更新设备铭牌文本(铭牌宽度、文字宽度与两端螺钉孔位置同步重算)
|
|
@@ -31,7 +31,6 @@ export declare class DoubleJointRobot extends ModelAbs<IDoubleJointRobotConfig>
|
|
|
31
31
|
protected collectStationSlotGroups(): StationSlotGroup[];
|
|
32
32
|
private handleRotateR1;
|
|
33
33
|
private handleRotateR2;
|
|
34
|
-
private moveX;
|
|
35
34
|
private switchFork;
|
|
36
35
|
/** 设置托盘夹具状态:辅料夹具沿用工件夹具造型,压扁 + 直角 + 描边补偿,并补偿 y 使垂直中心对齐手抓关节 */
|
|
37
36
|
private setPalletFixture;
|
|
@@ -17,7 +17,6 @@ export declare class Pallet extends ModelAbs<IPalletConfig> {
|
|
|
17
17
|
private resolveLayers;
|
|
18
18
|
private buildLayers;
|
|
19
19
|
protected createUi(): Box;
|
|
20
|
-
private moveX;
|
|
21
20
|
private moveY;
|
|
22
21
|
protected operating(data: IPalletOperating): void;
|
|
23
22
|
/** 资源增删:data.resource 提供 device_layer(>0) 时定位到该层;缺省时默认识别为第一层 */
|
package/dist/ui/models/Rail.d.ts
CHANGED
|
@@ -12,10 +12,12 @@ export declare class Rail extends ModelAbs<IRailConfig> {
|
|
|
12
12
|
* (设备移动时 AppController 逐帧调用 followChain,保证拖链与设备相对静止) */
|
|
13
13
|
protected operating(_data: ILayerOperating): void;
|
|
14
14
|
/**
|
|
15
|
-
* 逐帧跟随(AppController
|
|
15
|
+
* 逐帧跟随(AppController 拖链联动调用):
|
|
16
16
|
* 以设备实时位置直接驱动拖链,保证拖链与设备移动时相对静止
|
|
17
|
+
* @param botId 设备业务 id
|
|
18
|
+
* @param along 设备在「轨道局部坐标系」下的沿轨距离(0 = 轨道起点端,未缩放局部单位)
|
|
17
19
|
*/
|
|
18
|
-
followChain(botId: string,
|
|
20
|
+
followChain(botId: string, along: number): void;
|
|
19
21
|
private initChains;
|
|
20
22
|
private createChain;
|
|
21
23
|
private moveChain;
|
|
@@ -21,7 +21,6 @@ export declare class ResourceStore extends ModelAbs<IResourceStoreConfig> {
|
|
|
21
21
|
containsStationIndex(index: number): boolean;
|
|
22
22
|
/** 定位资源所在的工位组:优先按 device_layer 层号,其次按工位序号在工作位组中匹配,缺省回退资源类型 */
|
|
23
23
|
private findGroupForResource;
|
|
24
|
-
private moveX;
|
|
25
24
|
protected operating(data: IResourceStoreOperating): void;
|
|
26
25
|
protected collectStationSlotGroups(): StationSlotGroup[];
|
|
27
26
|
}
|
package/dist/ui/models/Rgv.d.ts
CHANGED
|
@@ -20,7 +20,6 @@ export declare class Rgv extends ModelAbs<IRGVConfig> {
|
|
|
20
20
|
private findGroupForResource;
|
|
21
21
|
protected collectStationSlotGroups(): StationSlotGroup[];
|
|
22
22
|
private handleRotate;
|
|
23
|
-
private moveX;
|
|
24
23
|
/**
|
|
25
24
|
* forks 前后移动(直接赋值,高频移动不走动画)
|
|
26
25
|
* @param percent 移动比例,[-1,1]
|
|
@@ -30,7 +30,6 @@ export declare class SingleJointRobot extends ModelAbs<ISingleJointRobotConfig>
|
|
|
30
30
|
private applyFixtureBindingVisibility;
|
|
31
31
|
protected collectStationSlotGroups(): StationSlotGroup[];
|
|
32
32
|
private handleRotate;
|
|
33
|
-
private moveX;
|
|
34
33
|
private switchFork;
|
|
35
34
|
/** 设置托盘夹具状态:辅料夹具沿用工件夹具造型,压扁 + 直角 + 描边补偿,并补偿 y 使垂直中心对齐手抓关节 */
|
|
36
35
|
private setPalletFixture;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { IRailConfig } from '../../types';
|
|
2
|
+
/** 轨道坐标系参数(由轨道配置一次性解析) */
|
|
3
|
+
export interface IRailFrame {
|
|
4
|
+
/** 轨道中心场景坐标 x */
|
|
5
|
+
cx: number;
|
|
6
|
+
/** 轨道中心场景坐标 y */
|
|
7
|
+
cy: number;
|
|
8
|
+
/** 轨道旋转角余弦 */
|
|
9
|
+
cos: number;
|
|
10
|
+
/** 轨道旋转角正弦 */
|
|
11
|
+
sin: number;
|
|
12
|
+
/** 轨道缩放系数 */
|
|
13
|
+
scale: number;
|
|
14
|
+
/** 轨道长度(局部单位,= width) */
|
|
15
|
+
length: number;
|
|
16
|
+
/** 轨道厚度(局部单位,= height) */
|
|
17
|
+
thickness: number;
|
|
18
|
+
}
|
|
19
|
+
/** 解析轨道坐标系参数(rotation / scale 缺省按 0 / 1 处理;兼容编辑器序列化出的空串等非数值) */
|
|
20
|
+
export declare function createRailFrame(rail: IRailConfig): IRailFrame;
|
|
21
|
+
/**
|
|
22
|
+
* 协议值 → 沿轨局部距离(未缩放的轨道局部单位)
|
|
23
|
+
* - source ≤ 1:协议比例 [0,1](0 = 轨道起点端、1 = 终点端)→ 比例 × 轨道长度
|
|
24
|
+
* - source > 1:已被代理「像素转换」特殊处理成的像素值 → 视为自轨道起点端算起的沿轨像素距离(除以轨道 scale 换算为局部单位)
|
|
25
|
+
*/
|
|
26
|
+
export declare function resolveRailAlong(frame: IRailFrame, source: number): number;
|
|
27
|
+
/** 场景坐标 → 轨道局部坐标(along 沿轨方向、lateral 垂直轨道方向,均为未缩放的轨道局部单位) */
|
|
28
|
+
export declare function sceneToRailLocal(frame: IRailFrame, x: number, y: number): {
|
|
29
|
+
along: number;
|
|
30
|
+
lateral: number;
|
|
31
|
+
};
|
|
32
|
+
/** 轨道局部坐标 → 场景坐标(先平移到以轨道中心为原点,再缩放、旋转) */
|
|
33
|
+
export declare function railLocalToScene(frame: IRailFrame, along: number, lateral: number): {
|
|
34
|
+
x: number;
|
|
35
|
+
y: number;
|
|
36
|
+
};
|