From e7e669379845d6c0946dc6d72274bdc1b7aa4154 Mon Sep 17 00:00:00 2001 From: pengqi Date: Wed, 4 Mar 2026 20:39:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=91=84=E5=83=8F=E5=A4=B4IP?= =?UTF-8?q?+3D=E6=98=BE=E7=A4=BA=E6=B7=BB=E5=8A=A0=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E6=98=BE=E7=A4=BA=E7=BA=BF=E6=9D=A1=E5=A4=87?= =?UTF-8?q?=E6=B3=A8=E7=9A=84=E5=BD=A2=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- UI/ui_3d.py | 13 ++++++++----- readme.md | 2 ++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/UI/ui_3d.py b/UI/ui_3d.py index 206026a..107ba90 100644 --- a/UI/ui_3d.py +++ b/UI/ui_3d.py @@ -6,6 +6,7 @@ # @File : 3D.py # @Desc : 界面上的线条3D显示 ''' +from re import T import sys from PySide6.QtWidgets import QApplication, QWidget, QVBoxLayout @@ -85,9 +86,10 @@ class Target3DWidget(QWidget): ("f", 100, 2.75, 1, 'purple') ] - def __init__(self, index: int = 0, parent=None): + def __init__(self, anno: bool, index: int = 0, parent=None): super().__init__(parent) self._index = index + self._anno = anno self.setWindowFlags(Qt.Window | Qt.FramelessWindowHint) # 无边框窗口 self.setAttribute(Qt.WA_TranslucentBackground) # 设置背景为透明 @@ -109,7 +111,8 @@ class Target3DWidget(QWidget): # 绘制3D形状 self.draw_target_shape() # 添加标注 - self.add_annotations() + if self._anno: + self.add_annotations() # ========== 核心修改:X/Y/Z轴统一为1cm单位 ========== self.ax.set_xlabel('X') @@ -165,7 +168,7 @@ def show(x: int, y: int, w: int, h: int, index: int): raise ValueError("index must be 0 or 1") app = QApplication(sys.argv) - window = Target3DWidget(index) + window = Target3DWidget(anno=True, index=index) window.setGeometry(x, y, w, h) window.show() sys.exit(app.exec()) @@ -173,5 +176,5 @@ def show(x: int, y: int, w: int, h: int, index: int): # ----------测试接口---------- if __name__ == '__main__': - show(100, 100, 700, 700, 0) # 显示A视图窗口 - # show(100, 100, 700, 700, 1) # 显示B视图窗口 + # show(100, 100, 700, 700, 0) # 显示A视图窗口 + show(100, 100, 700, 700, 1) # 显示B视图窗口 diff --git a/readme.md b/readme.md index 2a2b05a..9e859af 100644 --- a/readme.md +++ b/readme.md @@ -21,6 +21,8 @@ sudo chmod 666 /dev/ttyACM0 笔记本:192.168.5.105 网络继电器:192.168.5.18 RK1106:192.168.5.100 +相机1:192.168.5.10 +相机2:192.168.5.11 # 网络继电器传感器: 1、传感器1:DI5