#!D:\IDE\Anaconda3\envs\Microscope_Scan python
# -*- coding: UTF-8 -*-
"""
 @Author: Administrator
 @FileName: logInterface.py
 @DateTime: 2025/6/21 21:06
 @SoftWare: PyCharm
 @Author  ：xsh
"""
from PyQt5 import Qt

class logInterface:
    m_Info      : str
    m_Name      : str
    m_Control   : Qt.QObject
    m_Parent    : Qt.QObject

    def Initialization(self, info: str, control: Qt.QObject, parent: Qt.QObject) -> None:
        self.m_Name = f"{self.__class__.__name__}"
        self.m_Info     = info
        self.SetupUi(control, parent)
        self.initialize()

    def SetupUi(self, control: Qt.QObject, parent: Qt.QObject):
        self.m_Control = control
        self.m_ParentControl = parent
        if not isinstance(self.m_Control, Qt.QObject):
            return
        if self.m_Control.objectName() != self.m_Name:
            self.m_Control.setObjectName(self.m_Name)
        if self.m_Control.parent() != self.m_ParentControl and isinstance(self.m_ParentControl, Qt.QObject):
            self.m_Control.setParent(self.m_ParentControl)
        Qt.QMetaObject.connectSlotsByName(self.m_Control)


    def initData(self):
        pass

    def initValue(self):
        pass

    def deleData(self):
        pass

    def deleValue(self):
        pass

    def initialize(self):
        self.initData   ()
        self.initValue  ()

    def deinitialize(self):
        self.deleValue  ()
        self.deleData   ()
