VirtuaPlant 项目使用教程
1. 项目的目录结构及介绍
VirtuaPlant 项目的目录结构如下:
virtuaplant/
├── plants/
│ └── bottle-filling/
│ ├── hmi.py
│ ├── start.sh
│ └── world.py
├── attacks/
├── LICENSE
├── README.md
└── requirements.txt
目录结构介绍
plants/
: 包含不同工厂模拟的子目录,目前只有一个bottle-filling
目录。bottle-filling/
: 瓶装工厂模拟。hmi.py
: 人机界面脚本。start.sh
: 启动脚本。world.py
: 世界模拟器脚本。
attacks/
: 包含攻击脚本的子目录。LICENSE
: 项目许可证文件。README.md
: 项目说明文件。requirements.txt
: 项目依赖文件。
2. 项目的启动文件介绍
启动脚本 start.sh
start.sh
脚本位于 plants/bottle-filling/
目录下,用于启动世界模拟器和人机界面。
#!/bin/bash
# 启动世界模拟器
python world.py &
# 启动人机界面
python hmi.py &
世界模拟器 world.py
world.py
脚本位于 plants/bottle-filling/
目录下,负责模拟工厂的物理世界。
人机界面 hmi.py
hmi.py
脚本位于 plants/bottle-filling/
目录下,负责提供用户界面,显示工厂的运行状态。
3. 项目的配置文件介绍
依赖文件 requirements.txt
requirements.txt
文件列出了项目运行所需的 Python 包。
pymunk
pymodbus
pyasn1
pycrypto
许可证文件 LICENSE
LICENSE
文件包含了项目的许可证信息,VirtuaPlant 项目使用 MIT 许可证。
项目说明文件 README.md
README.md
文件提供了项目的详细说明,包括项目的目的、使用方法和注意事项。
# VirtuaPlant
VirtuaPlant 是一个工业控制系统模拟器,增加了与现实世界控制逻辑相似的功能。它结合了一个游戏库和2D物理引擎,能够呈现控制系统的“世界视图”,让用户能够看到控制系统的潜在动作。所有软件都是用 Python 编写的。
## 安装
使用以下命令安装所需的包:
```bash
pip install -r requirements.txt
运行
进入 plants
目录,选择你想要的工厂(目前只有一个可用),然后使用 start.sh
脚本启动世界模拟器和人机界面。
cd plants/bottle-filling
./start.sh
攻击脚本
所有攻击脚本都位于 attacks
子目录下。
未来计划
以下工厂场景正在考虑中:
- 炼油厂
- 锅炉
- 核电站反应堆
- 钢铁厂高炉
以下协议正在考虑中:
- DNP3(基于 OpenDNP3)
- S7
以上是 VirtuaPlant 项目的详细使用教程,希望对你有所帮助。