Files
n8n_Demo/web_frontend/exhibition-demo/src/data/terminalSimulations/intelligentManufacturing.ts
Yep_Q b50d700a2e feat: 添加交通物流、智能制造、智能开发终端模拟并优化食品订单班
主要更新:
- 新增3个订单班终端模拟数据 (交通物流、智能制造、智能开发)
- 交通物流: 图片重命名(9张UUID图片→描述性中文名)
- 智能制造: 图片重命名(7张UUID图片→描述性中文名)
- 食品订单班: 完成React应用架构和设计系统
- 新增4个Serena记忆文档 (终端模拟开发指南、订单班命名规范等)
- 优化模态框和工作流页面交互逻辑

文件变更:
- 新增: transportation.ts, intelligentManufacturing.ts, developer.ts
- 新增: 食品订单班完整React应用 (Vite + TypeScript + Tailwind)
- 修改: RequirementModal.tsx, ResultModal.tsx, WorkflowPageV4.tsx
- 图片: 交通物流9张 + 智能制造7张重命名为中文描述性名称
2025-10-02 20:29:01 +08:00

341 lines
21 KiB
TypeScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { Agent } from '@/store/demoStore';
import { SimulationData, TerminalLine } from './index';
// 智能制造订单班专属Agent配置
const intelligentManufacturingAgents: Agent[] = [
{
id: 'manufacturing_control_engineer',
name: '自动化控制工程师',
icon: '⚙️',
avatar: '/data/订单班文档资料/智能制造/agent头像/自动化控制工程师.jpg',
model: 'GPT-4',
role: '系统架构与控制逻辑设计',
status: 'waiting',
},
{
id: 'manufacturing_plc_engineer',
name: 'PLC工程师',
icon: '🔌',
avatar: '/data/订单班文档资料/智能制造/agent头像/PLC工程师.jpg',
model: 'GPT-4',
role: 'PLC编程与梯形图开发',
status: 'waiting',
},
{
id: 'manufacturing_robot_engineer',
name: '机器人调试工程师',
icon: '🤖',
avatar: '/data/订单班文档资料/智能制造/agent头像/机器人调试工程师.jpg',
model: 'GPT-4',
role: 'RAPID编程与机器人调试',
status: 'waiting',
},
{
id: 'manufacturing_data_technician',
name: '数据采集自动化技术员',
icon: '📊',
avatar: '/data/订单班文档资料/智能制造/agent头像/数据采集自动化技术员.jpg',
model: 'GPT-4',
role: 'I/O配置与通信调试',
status: 'waiting',
},
];
export const intelligentManufacturingSimulation = (): SimulationData => {
const agents = intelligentManufacturingAgents;
return {
orderClassId: 'intelligent_manufacturing',
orderClassName: '智能制造',
projectTitle: '物流输送线节拍优化的PLC与机器人联合调试',
agents,
startupSequence: [
{ type: 'info', content: '🚀 启动汽车零部件智能分拣系统...' },
{ type: 'system', content: '初始化多Agent协作框架' },
{ type: 'success', content: '✓ 系统核心加载完成' },
{ type: 'system', content: '加载专业知识库: PLC控制/工业机器人/Profinet通信/节拍优化' },
{ type: 'progress', content: '████████████████████ 100%', duration: 1500 },
{ type: 'success', content: '✓ 知识库加载完成' },
{ type: 'info', content: '连接工业设备...' },
{ type: 'system', content: '├─ 西门子 S7-1500 PLC (Profinet Controller)' },
{ type: 'system', content: '├─ ABB IRB 2600 工业机器人 (12-20kg负载)' },
{ type: 'system', content: '├─ 输送带驱动系统 (伺服控制)' },
{ type: 'system', content: '└─ 传感器网络 (光电/安全门/急停)' },
{ type: 'success', content: '✓ 设备连接成功' },
{ type: 'warning', content: '⚡ 检测到需求: 汽车零部件自动分拣' },
{ type: 'info', content: '核心目标: 输送带与机器人节拍同步优化' },
{ type: 'info', content: '技术挑战: PLC-机器人握手协议 + 节拍≥3600件/h' },
{ type: 'info', content: '正在分配4位工业自动化专家Agent...' },
] as TerminalLine[],
agentSequence: [
// Agent 1: 自动化控制工程师
{
agent: () => agents[0],
outputs: [
{ type: 'system', content: '⚙️ 自动化控制工程师 正在设计系统架构...' },
{ type: 'info', content: '任务: 整体控制逻辑设计与设备选型' },
{ type: 'progress', content: '分析生产节拍需求...', duration: 1200 },
{
type: 'image',
content: '🏭 汽车物流产线运输场景',
imageSrc: '/data/订单班文档资料/智能制造/notion文稿/image/汽车物流产线运输图.jpg',
imageAlt: '汽车零部件物流产线运输示意图'
},
{ type: 'success', content: '✓ 系统架构设计完成' },
{ type: 'info', content: '系统组成:' },
{ type: 'output', content: ' • 输送带系统: 连续输送 + 定位停止' },
{ type: 'output', content: ' • PLC控制系统: 西门子 S7-1500 (CPU 1512C-1 PN)' },
{ type: 'output', content: ' • 工业机器人: ABB IRB 2600 (负载12-20kg, 精度±0.04mm)' },
{ type: 'output', content: ' • 通信协议: Profinet I/O (PLC ↔ Robot)' },
{
type: 'image',
content: '🔧 汽车零部件展示',
imageSrc: '/data/订单班文档资料/智能制造/notion文稿/image/汽车零部件展示.jpg',
imageAlt: '待分拣的汽车零部件'
},
{ type: 'success', content: '✓ 6大控制逻辑模块设计:' },
{ type: 'output', content: ' 1⃣ 启停与安全联锁 (急停/安全门/过载保护)' },
{ type: 'output', content: ' 2⃣ 输送带运行控制 (定位光电触发即停)' },
{ type: 'output', content: ' 3⃣ 零件就位信号 (PartReady握手)' },
{ type: 'output', content: ' 4⃣ 启动允许信号 (StartAllow三条件联锁)' },
{ type: 'output', content: ' 5⃣ 机器人动作反馈 (PickDone完成信号)' },
{ type: 'output', content: ' 6⃣ 故障处理与复位 (报警优先级 + 复位机制)' },
{ type: 'success', content: '✓ 节拍优化策略:' },
{ type: 'output', content: ' • 输送带速度与机器人抓取周期匹配' },
{ type: 'output', content: ' • 三条件联锁保证同步 (RobotReady + PartReady + StartAllow)' },
{ type: 'output', content: ' • 完成信号触发续行 (PickDone → 清握手 → 输送带重启)' },
{ type: 'output', content: ' • 目标节拍: ≥3600件/h (单件周期≤1秒)' },
{ type: 'success', content: '✓ 系统架构设计文档已生成' },
]
},
// Agent 2: PLC工程师
{
agent: () => agents[1],
outputs: [
{ type: 'system', content: '🔌 PLC工程师 正在编写控制程序...' },
{ type: 'info', content: '任务: S7-1500 PLC编程与梯形图开发' },
{ type: 'progress', content: '配置I/O点位分配表...', duration: 1000 },
{
type: 'image',
content: '🖥️ 西门子 S7-1500 PLC控制器',
imageSrc: '/data/订单班文档资料/智能制造/notion文稿/image/PLC控制器.jpg',
imageAlt: '西门子 SIMATIC S7-1500 PLC'
},
{ type: 'success', content: '✓ I/O分配表配置完成:' },
{ type: 'info', content: '输入点位 (11点):' },
{ type: 'output', content: ' • I0.0: SB1 启动按钮' },
{ type: 'output', content: ' • I0.1: SB2 停止按钮 (常闭)' },
{ type: 'output', content: ' • I0.2: ES 急停 (常闭)' },
{ type: 'output', content: ' • I0.3: GS 安全门 (常闭)' },
{ type: 'output', content: ' • I0.4: FR 过载保护 (常闭)' },
{ type: 'output', content: ' • I0.5: PE1 入口光电 (来料检测)' },
{ type: 'output', content: ' • I0.6: PE2 定位光电 (取料位到位)' },
{ type: 'output', content: ' • I0.7: SB3 复位按钮' },
{ type: 'output', content: ' • I1.0: RobotReady (机器人就绪反馈)' },
{ type: 'output', content: ' • I1.1: PickDone (分拣完成反馈)' },
{ type: 'output', content: ' • I1.2: RobotFault (机器人故障报警)' },
{ type: 'info', content: '输出点位 (6点):' },
{ type: 'output', content: ' • Q0.0: KM1 输送带接触器' },
{ type: 'output', content: ' • Q0.1: HL1 报警指示灯' },
{ type: 'output', content: ' • Q0.2: HL2 运行指示灯' },
{ type: 'output', content: ' • Q0.3: StartAllow → Robot (启动允许握手)' },
{ type: 'output', content: ' • Q0.4: PartReady → Robot (零件就位握手)' },
{ type: 'output', content: ' • Q0.5: PLC_Reset → Robot (复位命令握手)' },
{ type: 'success', content: '✓ 梯形图程序编制完成 (6个网络):' },
{ type: 'output', content: ' 网络1: 运行允许与自保持 (RUN_EN + 运行灯)' },
{ type: 'output', content: ' 网络2: 输送带控制 (定位即停逻辑)' },
{ type: 'output', content: ' 网络3: PartReady输出 (零件就位信号)' },
{ type: 'output', content: ' 网络4: StartAllow输出 (三条件联锁)' },
{ type: 'output', content: ' 网络5: 分拣完成处理 (清握手 + 续行)' },
{ type: 'output', content: ' 网络6: 报警与复位 (故障优先 + 复位脉冲0.7s)' },
{
type: 'image',
content: '📋 Mermaid控制流程图',
imageSrc: '/data/订单班文档资料/智能制造/notion文稿/image/Mermaid流程图.jpg',
imageAlt: 'PLC与机器人联合调试控制流程图'
},
{ type: 'success', content: '✓ 安全联锁逻辑:' },
{ type: 'output', content: ' • 五合一安全联锁: SB2(停止) + ES(急停) + GS(安全门) + FR(过载) + RobotFault' },
{ type: 'output', content: ' • 任一条件异常 → RUN_EN复位 → 输送带停止 + 握手信号清除' },
{ type: 'output', content: ' • 报警灯HL1点亮 → 必须复位后才能重启' },
{ type: 'success', content: '✓ PLC程序下载至S7-1500控制器' },
]
},
// Agent 3: 机器人调试工程师
{
agent: () => agents[2],
outputs: [
{ type: 'system', content: '🤖 机器人调试工程师 正在编写RAPID程序...' },
{ type: 'info', content: '任务: ABB IRB 2600 机器人编程与路径调试' },
{ type: 'progress', content: '配置I/O映射与坐标系统...', duration: 1100 },
{
type: 'image',
content: '🦾 ABB IRB 2600 工业机器人',
imageSrc: '/data/订单班文档资料/智能制造/notion文稿/image/工业机器人.jpg',
imageAlt: 'ABB IRB 2600 六轴工业机器人'
},
{ type: 'success', content: '✓ 机器人参数:' },
{ type: 'output', content: ' • 型号: ABB IRB 2600' },
{ type: 'output', content: ' • 负载: 12-20 kg' },
{ type: 'output', content: ' • 工作半径: 1.65 m' },
{ type: 'output', content: ' • 重复精度: ±0.04 mm' },
{ type: 'output', content: ' • 控制器: ABB IRC5' },
{ type: 'output', content: ' • 编程语言: RAPID' },
{ type: 'success', content: '✓ I/O信号映射 (Profinet Device):' },
{ type: 'info', content: '输入信号 (从PLC接收):' },
{ type: 'output', content: ' • DI1: diStartAllow ← PLC.Q0.3' },
{ type: 'output', content: ' • DI2: diPartReady ← PLC.Q0.4' },
{ type: 'output', content: ' • DI3: diPLC_Reset ← PLC.Q0.5' },
{ type: 'info', content: '输出信号 (发送给PLC):' },
{ type: 'output', content: ' • DO1: doRobotReady → PLC.I1.0' },
{ type: 'output', content: ' • DO2: doPickDone → PLC.I1.1' },
{ type: 'output', content: ' • DO3: doRobotFault → PLC.I1.2' },
{ type: 'success', content: '✓ RAPID程序结构:' },
{ type: 'output', content: ' PROC main():' },
{ type: 'output', content: ' 1. 上电初始化 → doRobotReady=1' },
{ type: 'output', content: ' 2. 移动至Home位 (待机位)' },
{ type: 'output', content: ' 3. WHILE循环:' },
{ type: 'output', content: ' - 检测PLC复位信号 (diPLC_Reset)' },
{ type: 'output', content: ' - 等待启动条件 (diStartAllow AND diPartReady)' },
{ type: 'output', content: ' - 执行取件流程 (MoveJ pPick)' },
{ type: 'output', content: ' - 执行放置流程 (MoveJ pDrop)' },
{ type: 'output', content: ' - 发送完成信号 (doPickDone脉冲0.2s)' },
{ type: 'output', content: ' - 返回Home位' },
{ type: 'output', content: ' 4. 故障陷阱 TRAP TrapSetFault' },
{
type: 'image',
content: '🔄 传送带上的零部件流转',
imageSrc: '/data/订单班文档资料/智能制造/notion文稿/image/传送带上的汽车零部件.jpg',
imageAlt: '输送带上的汽车零部件等待机器人抓取'
},
{ type: 'success', content: '✓ 关键点位定义 (robtarget):' },
{ type: 'output', content: ' • pHome: [0, 0, 500] - 待机位(安全高度)' },
{ type: 'output', content: ' • pPick: [300, 0, 100] - 取件位(输送带上方)' },
{ type: 'output', content: ' • pDrop: [600, 200, 100] - 放置位(分拣仓)' },
{ type: 'success', content: '✓ 握手时序协同:' },
{ type: 'output', content: ' • PLC检测到零件就位 → PartReady=1' },
{ type: 'output', content: ' • PLC确认安全条件 → StartAllow=1' },
{ type: 'output', content: ' • Robot检测双信号 → 开始抓取动作' },
{ type: 'output', content: ' • Robot完成抓取 → PickDone脉冲' },
{ type: 'output', content: ' • PLC收到脉冲 → 清握手 + 输送带续行' },
{ type: 'success', content: '✓ RAPID程序下载至IRC5控制器' },
]
},
// Agent 4: 数据采集自动化技术员
{
agent: () => agents[3],
outputs: [
{ type: 'system', content: '📊 数据采集自动化技术员 正在配置通信与调试...' },
{ type: 'info', content: '任务: Profinet通信配置与系统联调' },
{ type: 'progress', content: '配置TIA Portal GSDML文件...', duration: 1000 },
{
type: 'image',
content: '🌐 Profinet通信程序配置',
imageSrc: '/data/订单班文档资料/智能制造/notion文稿/image/通信程序示意图.jpg',
imageAlt: 'PLC与机器人Profinet通信架构示意图'
},
{ type: 'success', content: '✓ Profinet网络架构:' },
{ type: 'output', content: ' • PLC S7-1500: Profinet Controller (主站)' },
{ type: 'output', content: ' • ABB IRC5: Profinet Device (从站)' },
{ type: 'output', content: ' • 循环周期: 10ms (高速I/O更新)' },
{ type: 'output', content: ' • 数据帧: 6字节输出 + 3字节输入' },
{ type: 'success', content: '✓ TIA Portal配置步骤:' },
{ type: 'output', content: ' 1. 导入ABB IRC5的GSDML设备描述文件' },
{ type: 'output', content: ' 2. 在硬件组态中添加Profinet Device' },
{ type: 'output', content: ' 3. 映射I/O地址 (Q0.3-Q0.5 → Robot输入, I1.0-I1.2 ← Robot输出)' },
{ type: 'output', content: ' 4. 配置设备IP地址 (192.168.1.10)' },
{ type: 'output', content: ' 5. 编译并下载硬件组态到PLC' },
{ type: 'success', content: '✓ 系统联调测试:' },
{ type: 'info', content: '阶段1: 通信链路测试' },
{ type: 'output', content: ' • Profinet连接状态: ✓ 绿灯 (连接正常)' },
{ type: 'output', content: ' • I/O数据交换: ✓ 循环更新10ms周期' },
{ type: 'output', content: ' • 诊断缓冲区: ✓ 无通信错误' },
{ type: 'info', content: '阶段2: 握手逻辑验证' },
{ type: 'output', content: ' • 测试1: RobotReady信号 → ✓ PLC正确接收' },
{ type: 'output', content: ' • 测试2: PartReady + StartAllow → ✓ Robot正确响应' },
{ type: 'output', content: ' • 测试3: PickDone脉冲 → ✓ PLC清握手并续行' },
{ type: 'output', content: ' • 测试4: PLC_Reset信号 → ✓ Robot故障清除' },
{ type: 'info', content: '阶段3: 节拍性能测试' },
{ type: 'output', content: ' • 单件周期: 0.95s (取件0.3s + 放置0.4s + 返回0.25s)' },
{ type: 'output', content: ' • 实测节拍: 3789件/h ✓ (目标≥3600件/h)' },
{ type: 'output', content: ' • 同步误差: ±15ms (握手时延控制良好)' },
{ type: 'success', content: '✓ 数据记录与追溯:' },
{ type: 'output', content: ' • 累计分拣数量: DB1.DBD0 (双字计数器)' },
{ type: 'output', content: ' • 故障代码记录: DB2.DBB0 (报警历史)' },
{ type: 'output', content: ' • 节拍时间戳: DB3 (周期统计)' },
{ type: 'success', content: '✓ 安全逻辑验证:' },
{ type: 'output', content: ' • 急停测试: ✓ 输送带+机器人立即停止' },
{ type: 'output', content: ' • 安全门测试: ✓ 联锁触发,握手信号清除' },
{ type: 'output', content: ' • 过载保护测试: ✓ 报警灯点亮,系统停机' },
{ type: 'output', content: ' • 复位流程测试: ✓ 故障清除后可正常重启' },
{ type: 'success', content: '✓ 系统联调完成,满足生产节拍要求' },
]
},
],
completionSequence: [
{ type: 'system', content: '=' + '='.repeat(69) },
{ type: 'success', content: '🎉 汽车零部件智能分拣系统调试完成!' },
{ type: 'system', content: '=' + '='.repeat(69) },
{ type: 'info', content: '' },
{ type: 'info', content: '🎯 系统核心指标:' },
{ type: 'success', content: '✓ 实测节拍: 3789件/h (超出目标3600件/h 5.3%)' },
{ type: 'success', content: '✓ 单件周期: 0.95s (取件+放置+返回)' },
{ type: 'success', content: '✓ 定位精度: ±0.04mm (ABB IRB 2600重复精度)' },
{ type: 'success', content: '✓ 同步误差: ±15ms (PLC-Robot握手时延)' },
{ type: 'success', content: '✓ 通信周期: 10ms (Profinet高速I/O更新)' },
{ type: 'info', content: '' },
{ type: 'info', content: '⚙️ 技术架构亮点:' },
{ type: 'output', content: ' • PLC主控: 西门子 S7-1500 (CPU 1512C-1 PN)' },
{ type: 'output', content: ' • 工业机器人: ABB IRB 2600 (12-20kg负载, 1.65m半径)' },
{ type: 'output', content: ' • 通信协议: Profinet I/O (Controller ↔ Device)' },
{ type: 'output', content: ' • 控制语言: 梯形图(PLC) + RAPID(Robot)' },
{ type: 'output', content: ' • 安全联锁: 五合一联锁(急停/安全门/过载/停止/机器人故障)' },
{ type: 'info', content: '' },
{ type: 'info', content: '🔄 节拍优化策略:' },
{ type: 'output', content: ' 1. 三条件联锁同步: RobotReady + PartReady + StartAllow' },
{ type: 'output', content: ' 2. 定位即停逻辑: 光电触发 → 输送带精准停止' },
{ type: 'output', content: ' 3. 完成信号续行: PickDone脉冲 → 清握手 → 输送带重启' },
{ type: 'output', content: ' 4. 速度匹配机制: 输送带速度 = 机器人周期 × 零件间距' },
{ type: 'info', content: '' },
{ type: 'info', content: '🛡️ 安全保护机制:' },
{ type: 'output', content: ' • 故障优先级: 急停 > 安全门 > 过载 > 机器人故障' },
{ type: 'output', content: ' • 联锁响应时间: <50ms (符合安全SIL2标准)' },
{ type: 'output', content: ' • 报警与复位: 故障锁存 + 复位确认 + 清除反馈' },
{ type: 'output', content: ' • 防呆设计: 三条件同时满足才允许机器人动作' },
{ type: 'info', content: '' },
{ type: 'info', content: '📋 交付物清单:' },
{ type: 'output', content: ' 1. PLC程序 (TIA Portal项目文件 + 梯形图源码)' },
{ type: 'output', content: ' 2. Robot程序 (RAPID源码 + 点位数据备份)' },
{ type: 'output', content: ' 3. Profinet配置 (GSDML文件 + 硬件组态)' },
{ type: 'output', content: ' 4. I/O分配表 (输入11点 + 输出6点)' },
{ type: 'output', content: ' 5. 控制流程图 (Mermaid图 + 逻辑说明文档)' },
{ type: 'output', content: ' 6. 调试报告 (通信测试 + 握手验证 + 节拍测试)' },
{ type: 'output', content: ' 7. 操作手册 (启停流程 + 故障处理 + 日常维护)' },
{ type: 'info', content: '' },
{ type: 'info', content: '🎓 技术创新点:' },
{ type: 'output', content: ' • Profinet高速通信: 10ms周期实现PLC-Robot无缝协同' },
{ type: 'output', content: ' • 智能握手协议: 三信号联锁确保节拍同步与安全' },
{ type: 'output', content: ' • 定位即停技术: 光电传感器 + 伺服控制实现±2mm定位精度' },
{ type: 'output', content: ' • 故障自恢复: PLC复位信号 + Robot错误清除 + 自动回Home位' },
{ type: 'info', content: '' },
{ type: 'success', content: '✅ 完整方案已保存至: /projects/intelligent_manufacturing/logistics_sorting.pdf' },
{ type: 'info', content: '📄 附件包含: PLC程序/Robot程序/Profinet配置/I/O表/调试报告' },
{ type: 'system', content: '' },
{ type: 'success', content: '🏭 系统已具备量产条件,可投入24小时连续生产!' },
] as TerminalLine[]
};
};