wanshenmean
2026-03-13 58376d519aeb76ef78d38b737c0c57f8d982fb52
分支
用户 wanshenmean <cathay_xy@163.com>
星期五, 三月 13, 2026 14:29 +0800
提交者 wanshenmean <cathay_xy@163.com>
星期五, 三月 13, 2026 14:29 +0800
提交58376d519aeb76ef78d38b737c0c57f8d982fb52
目录 a2a2e74e3ac9ce773d20ccf088a0178ecd5002ce 目录 | zip | gz
上一版本 efbfb630f60f6663deba83ec12c1fbf2f9bab183 查看 | 对比
feat: 完成S7 PLC模拟器完整实现

实现基于HSL Communication库的西门子S7 PLC模拟器系统,用于WCS开发测试。

核心功能:
- 多实例管理:支持创建和管理多个独立的S7服务器实例
- 内存模拟:支持M/DB/I/Q/T/C所有常用地址区域
- 地址解析:支持"M100"、"DB1.DBD0"、"I0.0"、"T1"、"C1"等S7地址格式
- 数据持久化:配置和内存数据自动保存到本地文件
- Web管理界面:提供直观的Web UI进行实例管理
- 实时监控:显示连接状态、请求数、客户端信息等

项目结构:
- WIDESEAWCS_S7Simulator.Core - 核心领域层
* Memory/ - 内存区域实现(I/Q/T/C/M/DB regions)
* Persistence/ - 文件持久化服务
* Server/ - S7服务器实例(HSL集成)
* Manager/ - 实例管理器
- WIDESEAWCS_S7Simulator.Server - Web API服务器
* Controllers/ - REST API控制器
- WIDESEAWCS_S7Simulator.Web - Web管理界面
* Pages/ - Razor Pages(列表/创建/编辑/详情)
- WIDESEAWCS_S7Simulator.UnitTests - 单元测试

技术细节:
- 线程安全的内存操作(ReaderWriterLockSlim)
- 大端字节序(S7 PLC规范)
- 完整的Dispose模式
- 原子性写入操作(文件持久化)
- 异步API设计
- Bootstrap 5 + Alpine.js 前端

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
已添加13个文件
已修改7个文件
3567 ■■■■■ 文件已修改
Code/WCS/WIDESEAWCS_S7Simulator/WIDESEAWCS_S7Simulator.Core/Interfaces/IS7ServerInstance.cs 66 ●●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_S7Simulator/WIDESEAWCS_S7Simulator.Core/Interfaces/ISimulatorInstanceManager.cs 133 ●●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_S7Simulator/WIDESEAWCS_S7Simulator.Core/Manager/SimulatorInstanceManager.cs 474 ●●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_S7Simulator/WIDESEAWCS_S7Simulator.Core/Server/S7ServerInstance.cs 444 ●●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_S7Simulator/WIDESEAWCS_S7Simulator.Server/Controllers/ClientsController.cs 110 ●●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_S7Simulator/WIDESEAWCS_S7Simulator.Server/Controllers/MemoryController.cs 219 ●●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_S7Simulator/WIDESEAWCS_S7Simulator.Server/Controllers/SimulatorInstancesController.cs 375 ●●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_S7Simulator/WIDESEAWCS_S7Simulator.Web/Pages/Create.cshtml 160 ●●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_S7Simulator/WIDESEAWCS_S7Simulator.Web/Pages/Create.cshtml.cs 141 ●●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_S7Simulator/WIDESEAWCS_S7Simulator.Web/Pages/Details.cshtml 338 ●●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_S7Simulator/WIDESEAWCS_S7Simulator.Web/Pages/Details.cshtml.cs 61 ●●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_S7Simulator/WIDESEAWCS_S7Simulator.Web/Pages/Edit.cshtml 245 ●●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_S7Simulator/WIDESEAWCS_S7Simulator.Web/Pages/Edit.cshtml.cs 182 ●●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_S7Simulator/WIDESEAWCS_S7Simulator.Web/Pages/Index.cshtml 224 ●●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_S7Simulator/WIDESEAWCS_S7Simulator.Web/Pages/Index.cshtml.cs 8 ●●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_S7Simulator/WIDESEAWCS_S7Simulator.Web/Pages/Shared/_Layout.cshtml 51 ●●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_S7Simulator/WIDESEAWCS_S7Simulator.Web/Pages/Shared/_ValidationScriptsPartial.cshtml 16 ●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_S7Simulator/WIDESEAWCS_S7Simulator.Web/Pages/_ViewImports.cshtml 2 ●●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_S7Simulator/WIDESEAWCS_S7Simulator.Web/wwwroot/css/site.css 128 ●●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_S7Simulator/WIDESEAWCS_S7Simulator.Web/wwwroot/js/site.js 190 ●●●●● 对比 | 查看 | 原始文档 | blame | 历史