1 Star 4 Fork 1

3988263@qq.com/thingspanel_simulation_python

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

1. 关于本项目

为了使用ThingsPanel,模拟数据仿真测试,也可以改造为压力测试使用

当前还有很多功能未开发,待完善中.

2. 使用方法

前提需求:python3

2.1 安装ThingsPanel

创建租户用户和密码,并配置到本项目的配置文件config.ini

2.2. 运行本程序

2.2.1 配置config.ini

参见详细说明docs/config.md

2.2.2 安装程序依赖库

pip freeze > requirements.txt pip install -r requirements.txt

2.2.3 运行程序

test_services.py 是测试用例,可以生成report_test.html报告

thingspanel_simulation.py 是运行主程序

2.2.4 停止运行

运行窗口中按 CTRL+C 终止运行

3. 其他说明

docs下有配置文件等说明

bin目录下有两个小脚本,用来测试api和返回结果

测试使用的 http://tungwaiyip.info/software/HTMLTestRunner.html

HTMLTestReportCN.py 可以复制到sys.path下长期使用

3.1 测试效果

设备id: '053deb2f-e69a-4cfc-584a-23148b85c9c8',发送: {'二氧化碳(CO2': '152.2268', '甲烷(CH4)': '85.5303', '氧化亚氮(N2O)': '112.4436', '电池电量': '13.4274'}
.
Time Elapsed: 0:00:00.196334
Call 'connect_mqtt'
设备id: '1fcb3295-22fb-5454-5f66-a4de1160952b',发送: {'二氧化碳(CO2': '241.3795', '甲烷(CH4)': '68.9240', '氧化亚氮(N2O)': '158.7078', '电池电量': '14.8405'}
Call 'connect_mqtt'
设备id: 'cefc712a-fd7e-b417-e5e5-658a4e81873a',发送: {'二氧化碳(CO2': '193.3639', '甲烷(CH4)': '51.0097', '氧化亚氮(N2O)': '121.1389', '电池电量': '85.7233'}
设备id: '717fd669-f1ee-bedf-41f6-838712e01d12',发送: {'二氧化碳(CO2': '206.7909', '甲烷(CH4)': '73.2421', '氧化亚氮(N2O)': '188.5137', '电池电量': '11.0637'}
设备id: '9f772ff1-e933-e1ab-8f88-8cbd41ee3676',发送: {'二氧化碳(CO2': '221.6497', '甲烷(CH4)': '73.7895', '氧化亚氮(N2O)': '113.6067', '电池电量': '69.8545'}
设备id: '8626074a-9d74-5913-7301-c75eed30acb9',发送: {'二氧化碳(CO2': '178.8170', '甲烷(CH4)': '53.6320', '氧化亚氮(N2O)': '157.1029', '电池电量': '90.1932'}
设备id: 'e855deca-8c3a-a5e7-79ff-e29a6dc6707b',发送: {'二氧化碳(CO2': '182.4323', '甲烷(CH4)': '75.2532', '氧化亚氮(N2O)': '177.2785', '电池电量': '64.7693'}
^CCall 'disconnect'
Call 'disconnect'
Call 'disconnect'
Call 'disconnect'
Call 'disconnect'
Call 'disconnect'
接收终止命令,键盘信号 (ID: 2)         停止和清理子线程..
Call 'disconnect'
Call 'disconnect'
Call 'disconnect'
Call 'disconnect'
Call 'disconnect'
Call 'disconnect'
关闭线程: 'MqttManager-555c370d-7979-f983-2d1a-6ed3f355f98e'
关闭线程: 'MqttManager-9dcb141b-c14c-85e9-2723-8452b973cfd4'
关闭线程: 'MqttManager-d229ed99-5151-2496-02ef-0975f2b809c4'
关闭线程: 'MqttManager-053deb2f-e69a-4cfc-584a-23148b85c9c8'
关闭线程: 'MqttManager-a24aded8-9ade-832b-0e7f-be575002ac6a'
关闭线程: 'MqttManager-1fcb3295-22fb-5454-5f66-a4de1160952b'
关闭线程: 'MqttManager-cefc712a-fd7e-b417-e5e5-658a4e81873a'
关闭线程: 'MqttManager-2123571c-48b2-2edb-8382-cb9d9c1ed0be'
关闭线程: 'MqttManager-717fd669-f1ee-bedf-41f6-838712e01d12'
关闭线程: 'MqttManager-9f772ff1-e933-e1ab-8f88-8cbd41ee3676'
关闭线程: 'MqttManager-8626074a-9d74-5913-7301-c75eed30acb9'
关闭线程: 'MqttManager-e855deca-8c3a-a5e7-79ff-e29a6dc6707b'
MIT License Copyright (c) 2023 3988263@qq.com Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

针对thingspanel项目的模拟仿真数据测试 展开 收起
Python 等 2 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/paddy235/thingspanel_simulation_python.git
git@gitee.com:paddy235/thingspanel_simulation_python.git
paddy235
thingspanel_simulation_python
thingspanel_simulation_python
master

搜索帮助

Dd8185d8 1850385 E526c682 1850385