实验性功能:新增了<数据预处理>使用vispy绘图时的参考图例显示
This commit is contained in:
@ -20,6 +20,7 @@ from func.utils.PublicFunc import PublicFunc
|
||||
from func.utils.Constants import Constants
|
||||
from func.Filters.Preprocessing import Butterworth_for_BCG_PreProcess, Butterworth_for_ECG_PreProcess
|
||||
from func.utils.Result import Result
|
||||
from func.utils.FloatingImagePanel import add_floating_image_panel
|
||||
|
||||
from ui.MainWindow.MainWindow_preprocess import Ui_MainWindow_preprocess
|
||||
from ui.setting.preprocess_input_setting import Ui_MainWindow_preprocess_input_setting
|
||||
@ -187,6 +188,12 @@ class MainWindow_preprocess(QMainWindow):
|
||||
self.progressbar = None
|
||||
PublicFunc.add_progressbar(self)
|
||||
|
||||
self.image_overlay = add_floating_image_panel(
|
||||
self.centralWidget(),
|
||||
title="参考图例",
|
||||
img_path=r"image\legend_preprocess.png"
|
||||
)
|
||||
|
||||
self.plot_mode = plot_mode
|
||||
if self.plot_mode == "matplotlib":
|
||||
#初始化画框
|
||||
@ -492,6 +499,18 @@ class MainWindow_preprocess(QMainWindow):
|
||||
self.ax0.grid(True)
|
||||
self.ax0.xaxis.set_major_formatter(Params.FORMATTER)
|
||||
|
||||
def update_overlay_position(self):
|
||||
"""手动定位函数"""
|
||||
margin = 20
|
||||
x = self.width() - self.image_overlay.width() - margin
|
||||
y = margin
|
||||
self.image_overlay.move(x, y)
|
||||
|
||||
def resizeEvent(self, event):
|
||||
"""确保窗口变大小时,悬浮窗依然在右上角"""
|
||||
super().resizeEvent(event)
|
||||
self.update_overlay_position()
|
||||
|
||||
|
||||
class Data:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user