- 安装scoop
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression
2. 安装pipx
scoop install pipx pipx ensurepath
- 安装poetry
pipx install poetry
[Poetry 使用指南](docs\Poetry 使用指南 (版本 1.8.2).md)
# 加载环境
poetry install --no-root
win/loadWin.py
为加载页面运行:
python load_test.py
win/mainWin.py
为反无人机操作页面运行:
python main_test.py
run.py
为系统启动入口运行:
python run.py
- 使用
run.py
启动win/loadWin.py
,然后通过class loadWin
再开启class mainWin
【2024.3.28 done】 thr/socketThread.py
数据传输模块测试 【2024.3.30 done】- 添加一个实时显示下位机云台状态的动画
- 实现与下位机交互(坐标、置信度、框框大小)
- 模式切换,基本实现完整能
但目前还有bug,问题是:
- 主线程的子线程里,貌似不能再启动子线程【还未解决】
# 报错1.
QObject::setParent: Cannot set parent, new parent is in a different thread
QBasicTimer::stop: Failed. Possibly trying to stop from a different thread
QBasicTimer::stop: Failed. Possibly trying to stop from a different thread
QBasicTimer::stop: Failed. Possibly trying to stop from a different thread
QBasicTimer::stop: Failed. Possibly trying to stop from a different thread
# 报错2
Traceback (most recent call last):
File "/home/clint/workspace/dev/pyside6Projcet/thr/mainWinThread.py", line 25, in run
self.main.exec()
AttributeError: 'MainWin' object has no attribute 'exec'
QBasicTimer::start: Timers cannot be started from another thread
QObject::startTimer: Timers can only be used with threads started with QThread
QBasicTimer::start: Timers cannot be started from another thread
QObject::killTimer: Timers cannot be stopped from another thread
QBasicTimer::start: Timers cannot be started from another thread
- 放弃模块化的并行设计,只对特定耗时的任务上使用多线程
- [实现快,可复用性差,可行性高]
- 尝试Multiprocessing模块,使用进程管理
- [实现慢,可复用性高,可行性一般]
- 使用stalkless版本的python ,利用协程来解决这个问题
- [专为并行而设计的Python版本,可以后期了解一下]
只在主页面中写GUI,然后在子页面中启动线程,用于各种需要等待的耗时操作。