webapp/src/types/task.ts

31 lines
914 B
TypeScript
Raw Normal View History

// 机器人的具体动作,可以定义为枚举或联合类型
export type RobotAction =
| 'PICKUP'
| 'DROPOFF'
| 'TRANSPORT'
| 'WAIT'
| 'CHARGE'
| 'CLEAN';
// 任务的状态
export type TaskStatus = 'IDLE' | 'RUNNING' | 'COMPLETED' | 'ERROR';
// 任务参数
export interface TaskParameters {
startLocation: string; // 起点
endLocation: string; // 终点
waypoint?: string; // 途经点 (可选)
robotAction: RobotAction; // 机器人动作
payload: string; // 载荷,比如 '空料架' 或具体的物料ID
locationBay?: string; // 库位 (可选)
}
// 核心任务对象
export interface Task {
id: string; // 唯一ID例如使用 uuid
name: string; // 任务名称, e.g., "炉前缓存区到热处理上料交接区运输"
status: TaskStatus; // 任务当前状态
parameters: TaskParameters; // 任务的具体执行参数
createdAt: string; // 创建时间
}