#!D:/IDE/anaconda3/envs/Microscope_Scan python
# -*- coding: UTF-8 -*-
"""
@FileName：HookController.py
@Description：
@Author：XSH
@Time：2025/11/16 13:44
@Department：研发部
@Copyright：©2025 乐辰生物
"""
import sys
import os
from PyQt5                      import Qt
from AppSettings.Settings       import *
from AppInterfaces.utils        import *
from AppCore.Levels             import *
from AppUtils.UiUtils           import UiUtils
from AppUtils.utils                     import *
from AppInterfaces.UiInterface          import UiInterface


class HookController(Qt.QWidget, UiInterface):

    def __init__(self, parent: Qt.QWidget = None):
        super(HookController, self).__init__(parent=parent)
        self.Initialization('HookController', self, parent)
        self.initWidgetStyle()

    def initWidgetStyle(self):
        from AppUtils.UiUtils import UiUtils
        self.setStyleSheet(UiUtils.getTransparentStyle())

    def getChamberNumber(self) -> int:
        chamber_number: int = 1
        if self.hasEditChamberNumber:
            number = int(self.EditChamberNumber.currentIndex() + 1)
            if 1 <= number <= 24:
                chamber_number = number
        return chamber_number

    @property
    def chamber_number(self) -> int:
        return self.getChamberNumber()


    def initValue(self):
        super(HookController, self).initValue()
        self.initStatusLabel                              ()
        self.initStatusEdit                               ()
        self.initStatusIcon                               ()
        self.initStatusButton                             ()
        self.initButton_HookClearZero                     ()
        self.initButton_ForceQuit                         ()
        self.initButton_PickTray                          ()
        self.initButton_DropTray                          ()
        self.initButton_Detector                          ()
        self.initButton_DetectorChamber                   ()
        self.initButton_ScanCodePick                      ()
        self.initButton_EmptyTrayReturn                   ()
        self.initButton_Forward                           ()
        self.initButton_Backward                          ()
        self.initButton_ScanCodeCompleteMove              ()
        self.initButton_HookReset                         ()
        self.initRead_Position                            ()
        self.initRead_Velocity                            ()
        self.initRead_SetLayerHoverHeight                 ()
        self.initRead_SetLayerDragHoverHeight             ()
        self.initRead_SetLayerSpacingHeight               ()
        self.initRead_SetAxisXPickPosition                ()
        self.initRead_SetAxisYPickPosition                ()
        self.initRead_SetScanCodePosition                 ()
        self.initRead_SetScanCodeSpacing                  ()
        self.initRead_SetAxisXDetectorPosition            ()
        self.initRead_SetAxisYDetectorPosition            ()
        self.initRead_SetLayerCount                       ()
        self.initRead_SetDetectorLayerPosition            ()
        self.initEdit_Position                            ()
        self.initEdit_Velocity                            ()
        self.initEdit_SetLayerHoverHeight                 ()
        self.initEdit_SetLayerDragHoverHeight             ()
        self.initEdit_SetLayerSpacingHeight               ()
        self.initEdit_SetAxisXPickPosition                ()
        self.initEdit_SetAxisYPickPosition                ()
        self.initEdit_SetScanCodePosition                 ()
        self.initEdit_SetScanCodeSpacing                  ()
        self.initEdit_SetAxisXDetectorPosition            ()
        self.initEdit_SetAxisYDetectorPosition            ()
        self.initEdit_SetLayerCount                       ()
        self.initEdit_SetDetectorLayerPosition            ()
        self.initSend_Position                            ()
        self.initSend_Velocity                            ()
        self.initSend_SetLayerHoverHeight                 ()
        self.initSend_SetLayerDragHoverHeight             ()
        self.initSend_SetLayerSpacingHeight               ()
        self.initSend_SetAxisXPickPosition                ()
        self.initSend_SetAxisYPickPosition                ()
        self.initSend_SetScanCodePosition                 ()
        self.initSend_SetScanCodeSpacing                  ()
        self.initSend_SetAxisXDetectorPosition            ()
        self.initSend_SetAxisYDetectorPosition            ()
        self.initSend_SetLayerCount                       ()
        self.initSend_SetDetectorLayerPosition            ()
        self.initLabels                                   ()
        self.initChamberStatusButton                      ()
        self.initInfoChamberNumber                        ()
        self.initEditChamberNumber                        ()

    def initProperty(self):
        super(HookController, self).initProperty()
        self.StatusLabel                              .setText('状态列表')#
        self.StatusEdit                               .addItems([
            '挂钩前面限位　　',
            '挂钩后面限位　　',
            '托盘到位状态　　',
            '检测托盘状态　　',
            '取片完成状态　　',
            '放片完成状态　　',
            '检测托盘完成状态',
            '扫描片仓完成状态',
            '扫码取片到位状态',
            '空挂退出完成状态',
            '挂钩前进故障状态',
            '挂钩后退故障状态',
        ]
                                                                )#
        self.InfoChamberNumber                        .setText("片仓序号")
        self.EditChamberNumber                        .addItems([f'{number}' for number in range(1, 25)])

        self.StatusButton                             .setText('读取状态')#
        self.Button_HookClearZero                     .setText('挂钩电机清零　　')#
        self.Button_ForceQuit                         .setText('设置强制退出功能')#
        self.Button_PickTray                          .setText('片仓取出托盘功能')#
        self.Button_DropTray                          .setText('托盘放回片仓功能')#
        self.Button_Detector                          .setText('检测指定托盘功能')#
        self.Button_DetectorChamber                   .setText('检测片仓托盘功能')#
        self.Button_ScanCodePick                      .setText('扫码托片功能　　')#
        self.Button_EmptyTrayReturn                   .setText('空挂返回功能　　')#
        self.Button_Forward                           .setText('挂钩电机前进功能')#
        self.Button_Backward                          .setText('挂钩电机后退功能')#
        self.Button_ScanCodeCompleteMove              .setText('扫码完成前进功能')#
        self.Read_Position                            .setText('当前挂钩位置　　')#
        self.Read_Velocity                            .setText('当前挂钩速度　　')#
        self.Read_SetLayerHoverHeight                 .setText('设置悬停高度功能')#
        self.Read_SetLayerDragHoverHeight             .setText('设置拖拽高度功能')#
        self.Read_SetLayerSpacingHeight               .setText('设置片仓间距功能')#
        self.Read_SetAxisXPickPosition                .setText('设置Ｘ轴取片位置')#
        self.Read_SetAxisYPickPosition                .setText('设置Ｙ轴取片位置')#
        self.Read_SetScanCodePosition                 .setText('设置扫码位置功能')#
        self.Read_SetScanCodeSpacing                  .setText('设置扫码间距功能')#
        self.Read_SetAxisXDetectorPosition            .setText('设置Ｘ轴检测位置')#
        self.Read_SetAxisYDetectorPosition            .setText('设置Ｙ轴检测位置')#
        self.Read_SetLayerCount                       .setText('设置片仓层数功能')#
        self.Read_SetDetectorLayerPosition            .setText('检测片仓Ｚ轴位置')#
        self.Edit_Position                            .setRange(0.0, 1000000.0)#
        self.Edit_Velocity                            .setRange(0.0, 1000000.0)#
        self.Edit_SetLayerHoverHeight                 .setRange(0.0, 1000000.0)#
        self.Edit_SetLayerDragHoverHeight             .setRange(0.0, 1000000.0)#
        self.Edit_SetLayerSpacingHeight               .setRange(0.0, 1000000.0)#
        self.Edit_SetAxisXPickPosition                .setRange(0.0, 1000000.0)#
        self.Edit_SetAxisYPickPosition                .setRange(0.0, 1000000.0)#
        self.Edit_SetScanCodePosition                 .setRange(0.0, 1000000.0)#
        self.Edit_SetScanCodeSpacing                  .setRange(0.0, 1000000.0)#
        self.Edit_SetAxisXDetectorPosition            .setRange(0.0, 1000000.0)#
        self.Edit_SetAxisYDetectorPosition            .setRange(0.0, 1000000.0)#
        self.Edit_SetLayerCount                       .setRange(1, 24)#
        self.Edit_SetDetectorLayerPosition            .setRange(0.0, 1000000.0)#
        self.Send_Position                            .setText('设置')#
        self.Send_Velocity                            .setText('设置')#
        self.Send_SetLayerHoverHeight                 .setText('设置')#
        self.Send_SetLayerDragHoverHeight             .setText('设置')#
        self.Send_SetLayerSpacingHeight               .setText('设置')#
        self.Send_SetAxisXPickPosition                .setText('设置')#
        self.Send_SetAxisYPickPosition                .setText('设置')#
        self.Send_SetScanCodePosition                 .setText('设置')#
        self.Send_SetScanCodeSpacing                  .setText('设置')#
        self.Send_SetAxisXDetectorPosition            .setText('设置')#
        self.Send_SetAxisYDetectorPosition            .setText('设置')#
        self.Send_SetLayerCount                       .setText('设置')#
        self.Send_SetDetectorLayerPosition            .setText('设置')#
        self.ChamberStatusButton                      .setText('片仓状态')
        self.StatusLabel                              .setFixedHeight(40)
        self.StatusEdit                               .setFixedHeight(40)
        self.StatusIcon                               .setFixedHeight(40)
        self.StatusButton                             .setFixedHeight(40)
        self.Button_HookClearZero                     .setFixedHeight(40)
        self.Button_ForceQuit                         .setFixedHeight(40)
        self.Button_PickTray                          .setFixedHeight(40)
        self.Button_DropTray                          .setFixedHeight(40)
        self.Button_Detector                          .setFixedHeight(40)
        self.Button_DetectorChamber                   .setFixedHeight(40)
        self.Button_ScanCodePick                      .setFixedHeight(40)
        self.Button_EmptyTrayReturn                   .setFixedHeight(40)
        self.Button_Forward                           .setFixedHeight(40)
        self.Button_Backward                          .setFixedHeight(40)
        self.Button_ScanCodeCompleteMove              .setFixedHeight(40)
        self.Button_HookReset                         .setFixedHeight(40)
        self.Read_Position                            .setFixedHeight(40)
        self.Read_Velocity                            .setFixedHeight(40)
        self.Read_SetLayerHoverHeight                 .setFixedHeight(40)
        self.Read_SetLayerDragHoverHeight             .setFixedHeight(40)
        self.Read_SetLayerSpacingHeight               .setFixedHeight(40)
        self.Read_SetAxisXPickPosition                .setFixedHeight(40)
        self.Read_SetAxisYPickPosition                .setFixedHeight(40)
        self.Read_SetScanCodePosition                 .setFixedHeight(40)
        self.Read_SetScanCodeSpacing                  .setFixedHeight(40)
        self.Read_SetAxisXDetectorPosition            .setFixedHeight(40)
        self.Read_SetAxisYDetectorPosition            .setFixedHeight(40)
        self.Read_SetLayerCount                       .setFixedHeight(40)
        self.Read_SetDetectorLayerPosition            .setFixedHeight(40)
        self.Edit_Position                            .setFixedHeight(40)
        self.Edit_Velocity                            .setFixedHeight(40)
        self.Edit_SetLayerHoverHeight                 .setFixedHeight(40)
        self.Edit_SetLayerDragHoverHeight             .setFixedHeight(40)
        self.Edit_SetLayerSpacingHeight               .setFixedHeight(40)
        self.Edit_SetAxisXPickPosition                .setFixedHeight(40)
        self.Edit_SetAxisYPickPosition                .setFixedHeight(40)
        self.Edit_SetScanCodePosition                 .setFixedHeight(40)
        self.Edit_SetScanCodeSpacing                  .setFixedHeight(40)
        self.Edit_SetAxisXDetectorPosition            .setFixedHeight(40)
        self.Edit_SetAxisYDetectorPosition            .setFixedHeight(40)
        self.Edit_SetLayerCount                       .setFixedHeight(40)
        self.Edit_SetDetectorLayerPosition            .setFixedHeight(40)
        self.Send_Position                            .setFixedHeight(40)
        self.Send_Velocity                            .setFixedHeight(40)
        self.Send_SetLayerHoverHeight                 .setFixedHeight(40)
        self.Send_SetLayerDragHoverHeight             .setFixedHeight(40)
        self.Send_SetLayerSpacingHeight               .setFixedHeight(40)
        self.Send_SetAxisXPickPosition                .setFixedHeight(40)
        self.Send_SetAxisYPickPosition                .setFixedHeight(40)
        self.Send_SetScanCodePosition                 .setFixedHeight(40)
        self.Send_SetScanCodeSpacing                  .setFixedHeight(40)
        self.Send_SetAxisXDetectorPosition            .setFixedHeight(40)
        self.Send_SetAxisYDetectorPosition            .setFixedHeight(40)
        self.Send_SetLayerCount                       .setFixedHeight(40)
        self.Send_SetDetectorLayerPosition            .setFixedHeight(40)
        self.ChamberStatusButton                      .setFixedHeight(40)
        self.InfoChamberNumber                        .setFixedHeight(40)
        self.EditChamberNumber                        .setFixedHeight(40)
        self.StatusLabel                              .setStyleSheet(UiUtils.getControlButtonStyle())
        self.StatusEdit                               .setStyleSheet(UiUtils.getControlButtonStyle())
        self.StatusIcon                               .setStyleSheet(UiUtils.getControlButtonStyle())
        self.StatusButton                             .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Button_HookClearZero                     .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Button_ForceQuit                         .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Button_PickTray                          .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Button_DropTray                          .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Button_Detector                          .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Button_DetectorChamber                   .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Button_ScanCodePick                      .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Button_EmptyTrayReturn                   .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Button_Forward                           .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Button_Backward                          .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Button_ScanCodeCompleteMove              .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Button_HookReset                         .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Read_Position                            .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Read_Velocity                            .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Read_SetLayerHoverHeight                 .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Read_SetLayerDragHoverHeight             .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Read_SetLayerSpacingHeight               .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Read_SetAxisXPickPosition                .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Read_SetAxisYPickPosition                .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Read_SetScanCodePosition                 .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Read_SetScanCodeSpacing                  .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Read_SetAxisXDetectorPosition            .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Read_SetAxisYDetectorPosition            .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Read_SetLayerCount                       .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Read_SetDetectorLayerPosition            .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Edit_Position                            .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Edit_Velocity                            .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Edit_SetLayerHoverHeight                 .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Edit_SetLayerDragHoverHeight             .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Edit_SetLayerSpacingHeight               .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Edit_SetAxisXPickPosition                .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Edit_SetAxisYPickPosition                .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Edit_SetScanCodePosition                 .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Edit_SetScanCodeSpacing                  .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Edit_SetAxisXDetectorPosition            .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Edit_SetAxisYDetectorPosition            .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Edit_SetLayerCount                       .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Edit_SetDetectorLayerPosition            .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Send_Position                            .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Send_Velocity                            .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Send_SetLayerHoverHeight                 .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Send_SetLayerDragHoverHeight             .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Send_SetLayerSpacingHeight               .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Send_SetAxisXPickPosition                .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Send_SetAxisYPickPosition                .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Send_SetScanCodePosition                 .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Send_SetScanCodeSpacing                  .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Send_SetAxisXDetectorPosition            .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Send_SetAxisYDetectorPosition            .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Send_SetLayerCount                       .setStyleSheet(UiUtils.getControlButtonStyle())
        self.Send_SetDetectorLayerPosition            .setStyleSheet(UiUtils.getControlButtonStyle())
        self.ChamberStatusButton                      .setStyleSheet(UiUtils.getControlButtonStyle())
        for label in self.Labels:
            label.setStyleSheet(UiUtils.getControlButtonStyle())
            UiUtils.setColorStyle(label, False)
            label.setFixedSize(40, 40)



    def initLayouts(self):
        super(HookController, self).initLayouts()
        if not self.hasControl or self.layout() is not None:
            return
























        # 创建主布局
        main_layout = Qt.QVBoxLayout()
        main_layout.setSpacing(5)  # 设置布局间距
        row_1   : Qt.QHBoxLayout = Qt.QHBoxLayout()
        row_2   : Qt.QHBoxLayout = Qt.QHBoxLayout()
        row_3   : Qt.QHBoxLayout = Qt.QHBoxLayout()
        row_4   : Qt.QHBoxLayout = Qt.QHBoxLayout()
        row_5   : Qt.QHBoxLayout = Qt.QHBoxLayout()
        row_6   : Qt.QHBoxLayout = Qt.QHBoxLayout()
        row_7   : Qt.QHBoxLayout = Qt.QHBoxLayout()
        row_8   : Qt.QHBoxLayout = Qt.QHBoxLayout()
        row_9   : Qt.QHBoxLayout = Qt.QHBoxLayout()
        row_10  : Qt.QHBoxLayout = Qt.QHBoxLayout()
        row_11  : Qt.QHBoxLayout = Qt.QHBoxLayout()
        row_12  : Qt.QHBoxLayout = Qt.QHBoxLayout()
        row_13  : Qt.QHBoxLayout = Qt.QHBoxLayout()
        row_14  : Qt.QHBoxLayout = Qt.QHBoxLayout()
        row_15  : Qt.QHBoxLayout = Qt.QHBoxLayout()
        row_16  : Qt.QHBoxLayout = Qt.QHBoxLayout()
        row_17  : Qt.QHBoxLayout = Qt.QHBoxLayout()
        row_18  : Qt.QHBoxLayout = Qt.QHBoxLayout()
        row_19  : Qt.QHBoxLayout = Qt.QHBoxLayout()
        row_20  : Qt.QHBoxLayout = Qt.QHBoxLayout()
        row_21  : Qt.QHBoxLayout = Qt.QHBoxLayout()
        row_22  : Qt.QHBoxLayout = Qt.QHBoxLayout()
        row_23  : Qt.QHBoxLayout = Qt.QHBoxLayout()
        row_24  : Qt.QHBoxLayout = Qt.QHBoxLayout()
        row_25  : Qt.QHBoxLayout = Qt.QHBoxLayout()
        row_26  : Qt.QHBoxLayout = Qt.QHBoxLayout()
        row_27  : Qt.QHBoxLayout = Qt.QHBoxLayout()
        row_28  : Qt.QHBoxLayout = Qt.QHBoxLayout()
        row_29  : Qt.QHBoxLayout = Qt.QHBoxLayout()
        row_30  : Qt.QHBoxLayout = Qt.QHBoxLayout()
        row_31  : Qt.QHBoxLayout = Qt.QHBoxLayout()
        row_32  : Qt.QHBoxLayout = Qt.QHBoxLayout()
        row_33  : Qt.QHBoxLayout = Qt.QHBoxLayout()
        row_34  : Qt.QHBoxLayout = Qt.QHBoxLayout()


        layouts: list[Qt.QHBoxLayout] = [row_1   ,row_2   ,row_3   ,row_4   ,row_5   ,row_6   ,row_7   ,row_8   ,row_9   ,row_10  ,
                                         row_11  ,row_12  ,row_13  ,row_14  ,row_15  ,row_16  ,row_17  ,row_18  ,row_19  ,row_20  ,
                                         row_21  ,row_22  ,row_23  ,row_24  ,row_25  ,row_26  ,row_27  ,row_28  ,row_29  ,row_30  ,
                                         row_31  ,row_32  ,row_33  ,row_34
                                         ]
        for layout in layouts:
            layout.setSpacing(1)
            layout.setContentsMargins(1, 1, 1, 1)
        row_1   .addWidget(self.InfoChamberNumber                        , 1)
        row_1   .addWidget(self.EditChamberNumber                        , 1)
        row_1   .addWidget(self.Button_PickTray                          , 1)
        row_1   .addWidget(self.Button_DropTray                          , 1)
        row_1   .addWidget(self.Button_Detector                          , 1)
        row_1   .addWidget(self.Button_DetectorChamber                   , 1)

        row_2   .addWidget(self.Button_ScanCodePick                      , 1)
        row_2   .addWidget(self.Button_ScanCodeCompleteMove              , 1)
        row_2   .addWidget(self.Button_Forward                           , 1)
        row_2   .addWidget(self.Button_Backward                          , 1)
        row_3   .addWidget(self.Button_EmptyTrayReturn                   , 1)
        row_3   .addWidget(self.Button_ForceQuit                         , 1)
        row_3   .addWidget(self.Button_HookReset                         , 1)
        row_3   .addWidget(self.Button_HookClearZero                     , 1)



        row_4   .addWidget(self.Read_Position                            , 1)
        row_4   .addWidget(self.Edit_Position                            , 2)
        row_4   .addWidget(self.Send_Position                            , 1)
        row_4   .addWidget(self.Read_Velocity                            , 1)
        row_4   .addWidget(self.Edit_Velocity                            , 2)
        row_4   .addWidget(self.Send_Velocity                            , 1)
        row_5   .addWidget(self.Read_SetLayerHoverHeight                 , 1)
        row_5   .addWidget(self.Edit_SetLayerHoverHeight                 , 2)
        row_5   .addWidget(self.Send_SetLayerHoverHeight                 , 1)
        row_5   .addWidget(self.Read_SetLayerDragHoverHeight             , 1)
        row_5   .addWidget(self.Edit_SetLayerDragHoverHeight             , 2)
        row_5   .addWidget(self.Send_SetLayerDragHoverHeight             , 1)
        row_6   .addWidget(self.Read_SetLayerSpacingHeight               , 1)
        row_6   .addWidget(self.Edit_SetLayerSpacingHeight               , 2)
        row_6   .addWidget(self.Send_SetLayerSpacingHeight               , 1)
        row_6   .addWidget(self.Read_SetAxisXPickPosition                , 1)
        row_6   .addWidget(self.Edit_SetAxisXPickPosition                , 2)
        row_6   .addWidget(self.Send_SetAxisXPickPosition                , 1)
        row_7   .addWidget(self.Read_SetAxisYPickPosition                , 1)
        row_7   .addWidget(self.Edit_SetAxisYPickPosition                , 2)
        row_7   .addWidget(self.Send_SetAxisYPickPosition                , 1)
        row_7   .addWidget(self.Read_SetScanCodePosition                 , 1)
        row_7   .addWidget(self.Edit_SetScanCodePosition                 , 2)
        row_7   .addWidget(self.Send_SetScanCodePosition                 , 1)
        row_8   .addWidget(self.Read_SetScanCodeSpacing                  , 1)
        row_8   .addWidget(self.Edit_SetScanCodeSpacing                  , 2)
        row_8   .addWidget(self.Send_SetScanCodeSpacing                  , 1)
        row_8   .addWidget(self.Read_SetAxisXDetectorPosition            , 1)
        row_8   .addWidget(self.Edit_SetAxisXDetectorPosition            , 2)
        row_8   .addWidget(self.Send_SetAxisXDetectorPosition            , 1)
        row_9   .addWidget(self.Read_SetAxisYDetectorPosition            , 1)
        row_9   .addWidget(self.Edit_SetAxisYDetectorPosition            , 2)
        row_9   .addWidget(self.Send_SetAxisYDetectorPosition            , 1)
        row_9   .addWidget(self.Read_SetLayerCount                       , 1)
        row_9   .addWidget(self.Edit_SetLayerCount                       , 2)
        row_9   .addWidget(self.Send_SetLayerCount                       , 1)
        row_10  .addWidget(self.Read_SetDetectorLayerPosition            , 1)
        row_10  .addWidget(self.Edit_SetDetectorLayerPosition            , 2)
        row_10  .addWidget(self.Send_SetDetectorLayerPosition            , 1)

        row_10  .addWidget(self.StatusLabel  , 1)
        row_10  .addWidget(self.StatusEdit   , 1)
        row_10  .addWidget(self.StatusIcon   , 1)
        row_10  .addWidget(self.StatusButton , 1)


        row_11.addWidget(self.Labels[0 ]  )
        row_11.addWidget(self.Labels[1 ]  )
        row_11.addWidget(self.Labels[2 ]  )
        row_11.addWidget(self.Labels[3 ]  )
        row_11.addWidget(self.Labels[4 ]  )
        row_11.addWidget(self.Labels[5 ]  )
        row_11.addWidget(self.Labels[6 ]  )
        row_11.addWidget(self.Labels[7 ]  )
        row_11.addWidget(self.Labels[8 ]  )
        row_11.addWidget(self.Labels[9 ]  )
        row_11.addWidget(self.Labels[10]  )
        row_11.addWidget(self.Labels[11]  )
        row_12.addWidget(self.Labels[12]  )
        row_12.addWidget(self.Labels[13]  )
        row_12.addWidget(self.Labels[14]  )
        row_12.addWidget(self.Labels[15]  )
        row_12.addWidget(self.Labels[16]  )
        row_12.addWidget(self.Labels[17]  )
        row_12.addWidget(self.Labels[18]  )
        row_12.addWidget(self.Labels[19]  )
        row_12.addWidget(self.Labels[20]  )
        row_12.addWidget(self.Labels[21]  )
        row_12.addWidget(self.Labels[22]  )
        row_12.addWidget(self.Labels[23]  )

        row_13.addWidget(self.ChamberStatusButton)
        for layout in layouts:
            main_layout.addLayout(layout)

        self.setLayout(main_layout)
    def setStatus(self, enable: (int, bool)):
        UiUtils.setColorStyle(self.StatusIcon, True if isinstance(enable, (bool, int)) and enable else False)

    def setTrayStatus(self, index: int, status: (int, bool)):
        if 1 <= index <= 24:
            enable: bool = True if isinstance(status, (bool, int)) and status else False
            UiUtils.setColorStyle(self.Labels[index], enable)

    def setChamberStatus(self, status: list):
        if isinstance(status, (list, str)) and len(status) >= 24:
            label: Qt.QLabel
            for index, label in enumerate(self.Labels):
                enable: bool = True if isinstance(status[index], (bool, int)) and status[index] else False
                UiUtils.setColorStyle(label, enable)


    def initStatusLabel                              (self):
        if not self.hasStatusLabel                              :
            self.StatusLabel                               = Qt.QLabel                ()

    def initStatusEdit                               (self):
        if not self.hasStatusEdit                               :
            self.StatusEdit                                = Qt.QComboBox             ()

    def initStatusButton                             (self):
        if not self.hasStatusButton                             :
            self.StatusButton                              = Qt.QPushButton           ()

    def initButton_HookClearZero                     (self):
        if not self.hasButton_HookClearZero                     :
            self.Button_HookClearZero                      = Qt.QPushButton           ()

    def initButton_ForceQuit                         (self):
        if not self.hasButton_ForceQuit                         :
            self.Button_ForceQuit                          = Qt.QPushButton           ()

    def initButton_PickTray                          (self):
        if not self.hasButton_PickTray                          :
            self.Button_PickTray                           = Qt.QPushButton           ()

    def initButton_DropTray                          (self):
        if not self.hasButton_DropTray                          :
            self.Button_DropTray                           = Qt.QPushButton           ()

    def initButton_Detector                          (self):
        if not self.hasButton_Detector                          :
            self.Button_Detector                           = Qt.QPushButton           ()

    def initButton_DetectorChamber                   (self):
        if not self.hasButton_DetectorChamber                   :
            self.Button_DetectorChamber                    = Qt.QPushButton           ()

    def initButton_ScanCodePick                      (self):
        if not self.hasButton_ScanCodePick                      :
            self.Button_ScanCodePick                       = Qt.QPushButton           ()

    def initButton_EmptyTrayReturn                   (self):
        if not self.hasButton_EmptyTrayReturn                   :
            self.Button_EmptyTrayReturn                    = Qt.QPushButton           ()

    def initButton_Forward                           (self):
        if not self.hasButton_Forward                           :
            self.Button_Forward                            = Qt.QPushButton           ()

    def initButton_Backward                          (self):
        if not self.hasButton_Backward                          :
            self.Button_Backward                           = Qt.QPushButton           ()

    def initButton_ScanCodePlace                     (self):
        if not self.hasButton_ScanCodePlace                     :
            self.Button_ScanCodePlace                      = Qt.QPushButton           ()

    def initButton_ScanCodeCompleteMove              (self):
        if not self.hasButton_ScanCodeCompleteMove              :
            self.Button_ScanCodeCompleteMove               = Qt.QPushButton           ()

    def initButton_HookReset                         (self):
        if not self.hasButton_HookReset                         :
            self.Button_HookReset                          = Qt.QPushButton           ()

    def initRead_Position                            (self):
        if not self.hasRead_Position                            :
            self.Read_Position                             = Qt.QPushButton           ()

    def initRead_Velocity                            (self):
        if not self.hasRead_Velocity                            :
            self.Read_Velocity                             = Qt.QPushButton           ()

    def initRead_SetLayerHoverHeight                 (self):
        if not self.hasRead_SetLayerHoverHeight                 :
            self.Read_SetLayerHoverHeight                  = Qt.QPushButton           ()

    def initRead_SetLayerDragHoverHeight             (self):
        if not self.hasRead_SetLayerDragHoverHeight             :
            self.Read_SetLayerDragHoverHeight              = Qt.QPushButton           ()

    def initRead_SetLayerSpacingHeight               (self):
        if not self.hasRead_SetLayerSpacingHeight               :
            self.Read_SetLayerSpacingHeight                = Qt.QPushButton           ()

    def initRead_SetAxisXPickPosition                (self):
        if not self.hasRead_SetAxisXPickPosition                :
            self.Read_SetAxisXPickPosition                 = Qt.QPushButton           ()

    def initRead_SetAxisYPickPosition                (self):
        if not self.hasRead_SetAxisYPickPosition                :
            self.Read_SetAxisYPickPosition                 = Qt.QPushButton           ()

    def initRead_SetScanCodePosition                 (self):
        if not self.hasRead_SetScanCodePosition                 :
            self.Read_SetScanCodePosition                  = Qt.QPushButton           ()

    def initRead_SetScanCodeSpacing                  (self):
        if not self.hasRead_SetScanCodeSpacing                  :
            self.Read_SetScanCodeSpacing                   = Qt.QPushButton           ()

    def initRead_SetAxisXDetectorPosition            (self):
        if not self.hasRead_SetAxisXDetectorPosition            :
            self.Read_SetAxisXDetectorPosition             = Qt.QPushButton           ()

    def initRead_SetAxisYDetectorPosition            (self):
        if not self.hasRead_SetAxisYDetectorPosition            :
            self.Read_SetAxisYDetectorPosition             = Qt.QPushButton           ()

    def initRead_SetLayerCount                       (self):
        if not self.hasRead_SetLayerCount                       :
            self.Read_SetLayerCount                        = Qt.QPushButton           ()

    def initRead_SetDetectorLayerPosition            (self):
        if not self.hasRead_SetDetectorLayerPosition            :
            self.Read_SetDetectorLayerPosition             = Qt.QPushButton           ()

    def initEdit_Position                            (self):
        if not self.hasEdit_Position                            :
            self.Edit_Position                             = Qt.QDoubleSpinBox        ()

    def initEdit_Velocity                            (self):
        if not self.hasEdit_Velocity                            :
            self.Edit_Velocity                             = Qt.QDoubleSpinBox        ()

    def initEdit_SetLayerHoverHeight                 (self):
        if not self.hasEdit_SetLayerHoverHeight                 :
            self.Edit_SetLayerHoverHeight                  = Qt.QDoubleSpinBox        ()

    def initEdit_SetLayerDragHoverHeight             (self):
        if not self.hasEdit_SetLayerDragHoverHeight             :
            self.Edit_SetLayerDragHoverHeight              = Qt.QDoubleSpinBox        ()

    def initEdit_SetLayerSpacingHeight               (self):
        if not self.hasEdit_SetLayerSpacingHeight               :
            self.Edit_SetLayerSpacingHeight                = Qt.QDoubleSpinBox        ()

    def initEdit_SetAxisXPickPosition                (self):
        if not self.hasEdit_SetAxisXPickPosition                :
            self.Edit_SetAxisXPickPosition                 = Qt.QDoubleSpinBox        ()

    def initEdit_SetAxisYPickPosition                (self):
        if not self.hasEdit_SetAxisYPickPosition                :
            self.Edit_SetAxisYPickPosition                 = Qt.QDoubleSpinBox        ()

    def initEdit_SetScanCodePosition                 (self):
        if not self.hasEdit_SetScanCodePosition                 :
            self.Edit_SetScanCodePosition                  = Qt.QDoubleSpinBox        ()

    def initEdit_SetScanCodeSpacing                  (self):
        if not self.hasEdit_SetScanCodeSpacing                  :
            self.Edit_SetScanCodeSpacing                   = Qt.QDoubleSpinBox        ()

    def initEdit_SetAxisXDetectorPosition            (self):
        if not self.hasEdit_SetAxisXDetectorPosition            :
            self.Edit_SetAxisXDetectorPosition             = Qt.QDoubleSpinBox        ()

    def initEdit_SetAxisYDetectorPosition            (self):
        if not self.hasEdit_SetAxisYDetectorPosition            :
            self.Edit_SetAxisYDetectorPosition             = Qt.QDoubleSpinBox        ()

    def initEdit_SetLayerCount                       (self):
        if not self.hasEdit_SetLayerCount                       :
            self.Edit_SetLayerCount                        = Qt.QSpinBox              ()

    def initEdit_SetDetectorLayerPosition            (self):
        if not self.hasEdit_SetDetectorLayerPosition            :
            self.Edit_SetDetectorLayerPosition             = Qt.QDoubleSpinBox        ()

    def initSend_Position                            (self):
        if not self.hasSend_Position                            :
            self.Send_Position                             = Qt.QPushButton           ()

    def initSend_Velocity                            (self):
        if not self.hasSend_Velocity                            :
            self.Send_Velocity                             = Qt.QPushButton           ()

    def initSend_SetLayerHoverHeight                 (self):
        if not self.hasSend_SetLayerHoverHeight                 :
            self.Send_SetLayerHoverHeight                  = Qt.QPushButton           ()

    def initSend_SetLayerDragHoverHeight             (self):
        if not self.hasSend_SetLayerDragHoverHeight             :
            self.Send_SetLayerDragHoverHeight              = Qt.QPushButton           ()

    def initSend_SetLayerSpacingHeight               (self):
        if not self.hasSend_SetLayerSpacingHeight               :
            self.Send_SetLayerSpacingHeight                = Qt.QPushButton           ()

    def initSend_SetAxisXPickPosition                (self):
        if not self.hasSend_SetAxisXPickPosition                :
            self.Send_SetAxisXPickPosition                 = Qt.QPushButton           ()

    def initSend_SetAxisYPickPosition                (self):
        if not self.hasSend_SetAxisYPickPosition                :
            self.Send_SetAxisYPickPosition                 = Qt.QPushButton           ()

    def initSend_SetScanCodePosition                 (self):
        if not self.hasSend_SetScanCodePosition                 :
            self.Send_SetScanCodePosition                  = Qt.QPushButton           ()

    def initSend_SetScanCodeSpacing                  (self):
        if not self.hasSend_SetScanCodeSpacing                  :
            self.Send_SetScanCodeSpacing                   = Qt.QPushButton           ()

    def initSend_SetAxisXDetectorPosition            (self):
        if not self.hasSend_SetAxisXDetectorPosition            :
            self.Send_SetAxisXDetectorPosition             = Qt.QPushButton           ()

    def initSend_SetAxisYDetectorPosition            (self):
        if not self.hasSend_SetAxisYDetectorPosition            :
            self.Send_SetAxisYDetectorPosition             = Qt.QPushButton           ()

    def initSend_SetLayerCount                       (self):
        if not self.hasSend_SetLayerCount                       :
            self.Send_SetLayerCount                        = Qt.QPushButton           ()

    def initSend_SetDetectorLayerPosition            (self):
        if not self.hasSend_SetDetectorLayerPosition            :
            self.Send_SetDetectorLayerPosition             = Qt.QPushButton           ()

    def initStatusIcon(self):
        if not self.hasStatusIcon:
            self.StatusIcon = Qt.QLabel()

    def initGroupBox(self):
        if not self.hasGroupBox:
            self.GroupBox = Qt.QGroupBox()
    def initLabels(self):
        if not self.hasLabels:
            self.Labels = []
            for index in range(0, 24):
                self.Labels.append(Qt.QLabel())

    def initChamberStatusButton(self):
        if not self.hasChamberStatusButton:
            self.ChamberStatusButton = Qt.QPushButton()



    def initInfoChamberNumber(self):
        if not self.hasInfoChamberNumber:
            self.InfoChamberNumber = Qt.QPushButton()
    def initEditChamberNumber(self):
        if not self.hasEditChamberNumber:
            self.EditChamberNumber = Qt.QComboBox()

    @property
    def hasStatusIcon                              (self) -> bool:
        return hasattr(self, 'StatusIcon'                                 ) and isinstance(self.StatusIcon                              , Qt.QLabel               )

    @property
    def hasStatusLabel                              (self) -> bool:
        return hasattr(self, 'StatusLabel'                                 ) and isinstance(self.StatusLabel                              , Qt.QLabel               )

    @property
    def hasStatusEdit                               (self) -> bool:
        return hasattr(self, 'StatusEdit'                                  ) and isinstance(self.StatusEdit                               , Qt.QComboBox            )

    @property
    def hasStatusButton                             (self) -> bool:
        return hasattr(self, 'StatusButton'                                ) and isinstance(self.StatusButton                             , Qt.QPushButton          )

    @property
    def hasButton_HookClearZero                     (self) -> bool:
        return hasattr(self, 'Button_HookClearZero'                        ) and isinstance(self.Button_HookClearZero                     , Qt.QPushButton          )

    @property
    def hasButton_ForceQuit                         (self) -> bool:
        return hasattr(self, 'Button_ForceQuit'                            ) and isinstance(self.Button_ForceQuit                         , Qt.QPushButton          )

    @property
    def hasButton_PickTray                          (self) -> bool:
        return hasattr(self, 'Button_PickTray'                             ) and isinstance(self.Button_PickTray                          , Qt.QPushButton          )

    @property
    def hasButton_DropTray                          (self) -> bool:
        return hasattr(self, 'Button_DropTray'                             ) and isinstance(self.Button_DropTray                          , Qt.QPushButton          )

    @property
    def hasButton_Detector                          (self) -> bool:
        return hasattr(self, 'Button_Detector'                             ) and isinstance(self.Button_Detector                          , Qt.QPushButton          )

    @property
    def hasButton_DetectorChamber                   (self) -> bool:
        return hasattr(self, 'Button_DetectorChamber'                      ) and isinstance(self.Button_DetectorChamber                   , Qt.QPushButton          )

    @property
    def hasButton_ScanCodePick                      (self) -> bool:
        return hasattr(self, 'Button_ScanCodePick'                         ) and isinstance(self.Button_ScanCodePick                      , Qt.QPushButton          )

    @property
    def hasButton_EmptyTrayReturn                   (self) -> bool:
        return hasattr(self, 'Button_EmptyTrayReturn'                      ) and isinstance(self.Button_EmptyTrayReturn                   , Qt.QPushButton          )

    @property
    def hasButton_Forward                           (self) -> bool:
        return hasattr(self, 'Button_Forward'                              ) and isinstance(self.Button_Forward                           , Qt.QPushButton          )

    @property
    def hasButton_Backward                          (self) -> bool:
        return hasattr(self, 'Button_Backward'                             ) and isinstance(self.Button_Backward                          , Qt.QPushButton          )

    @property
    def hasButton_ScanCodePlace                     (self) -> bool:
        return hasattr(self, 'Button_ScanCodePlace'                        ) and isinstance(self.Button_ScanCodePlace                     , Qt.QPushButton          )

    @property
    def hasButton_ScanCodeCompleteMove              (self) -> bool:
        return hasattr(self, 'Button_ScanCodeCompleteMove'                 ) and isinstance(self.Button_ScanCodeCompleteMove              , Qt.QPushButton          )

    @property
    def hasButton_HookReset                         (self) -> bool:
        return hasattr(self, 'Button_HookReset'                            ) and isinstance(self.Button_HookReset                         , Qt.QPushButton          )

    @property
    def hasRead_Position                            (self) -> bool:
        return hasattr(self, 'Read_Position'                               ) and isinstance(self.Read_Position                            , Qt.QPushButton          )

    @property
    def hasRead_Velocity                            (self) -> bool:
        return hasattr(self, 'Read_Velocity'                               ) and isinstance(self.Read_Velocity                            , Qt.QPushButton          )

    @property
    def hasRead_SetLayerHoverHeight                 (self) -> bool:
        return hasattr(self, 'Read_SetLayerHoverHeight'                    ) and isinstance(self.Read_SetLayerHoverHeight                 , Qt.QPushButton          )

    @property
    def hasRead_SetLayerDragHoverHeight             (self) -> bool:
        return hasattr(self, 'Read_SetLayerDragHoverHeight'                ) and isinstance(self.Read_SetLayerDragHoverHeight             , Qt.QPushButton          )

    @property
    def hasRead_SetLayerSpacingHeight               (self) -> bool:
        return hasattr(self, 'Read_SetLayerSpacingHeight'                  ) and isinstance(self.Read_SetLayerSpacingHeight               , Qt.QPushButton          )

    @property
    def hasRead_SetAxisXPickPosition                (self) -> bool:
        return hasattr(self, 'Read_SetAxisXPickPosition'                   ) and isinstance(self.Read_SetAxisXPickPosition                , Qt.QPushButton          )

    @property
    def hasRead_SetAxisYPickPosition                (self) -> bool:
        return hasattr(self, 'Read_SetAxisYPickPosition'                   ) and isinstance(self.Read_SetAxisYPickPosition                , Qt.QPushButton          )

    @property
    def hasRead_SetScanCodePosition                 (self) -> bool:
        return hasattr(self, 'Read_SetScanCodePosition'                    ) and isinstance(self.Read_SetScanCodePosition                 , Qt.QPushButton          )

    @property
    def hasRead_SetScanCodeSpacing                  (self) -> bool:
        return hasattr(self, 'Read_SetScanCodeSpacing'                     ) and isinstance(self.Read_SetScanCodeSpacing                  , Qt.QPushButton          )

    @property
    def hasRead_SetAxisXDetectorPosition            (self) -> bool:
        return hasattr(self, 'Read_SetAxisXDetectorPosition'               ) and isinstance(self.Read_SetAxisXDetectorPosition            , Qt.QPushButton          )

    @property
    def hasRead_SetAxisYDetectorPosition            (self) -> bool:
        return hasattr(self, 'Read_SetAxisYDetectorPosition'               ) and isinstance(self.Read_SetAxisYDetectorPosition            , Qt.QPushButton          )

    @property
    def hasRead_SetLayerCount                       (self) -> bool:
        return hasattr(self, 'Read_SetLayerCount'                          ) and isinstance(self.Read_SetLayerCount                       , Qt.QPushButton          )

    @property
    def hasRead_SetDetectorLayerPosition            (self) -> bool:
        return hasattr(self, 'Read_SetDetectorLayerPosition'               ) and isinstance(self.Read_SetDetectorLayerPosition            , Qt.QPushButton          )

    @property
    def hasEdit_Position                            (self) -> bool:
        return hasattr(self, 'Edit_Position'                               ) and isinstance(self.Edit_Position                            , Qt.QDoubleSpinBox       )

    @property
    def hasEdit_Velocity                            (self) -> bool:
        return hasattr(self, 'Edit_Velocity'                               ) and isinstance(self.Edit_Velocity                            , Qt.QDoubleSpinBox       )

    @property
    def hasEdit_SetLayerHoverHeight                 (self) -> bool:
        return hasattr(self, 'Edit_SetLayerHoverHeight'                    ) and isinstance(self.Edit_SetLayerHoverHeight                 , Qt.QDoubleSpinBox       )

    @property
    def hasEdit_SetLayerDragHoverHeight             (self) -> bool:
        return hasattr(self, 'Edit_SetLayerDragHoverHeight'                ) and isinstance(self.Edit_SetLayerDragHoverHeight             , Qt.QDoubleSpinBox       )

    @property
    def hasEdit_SetLayerSpacingHeight               (self) -> bool:
        return hasattr(self, 'Edit_SetLayerSpacingHeight'                  ) and isinstance(self.Edit_SetLayerSpacingHeight               , Qt.QDoubleSpinBox       )

    @property
    def hasEdit_SetAxisXPickPosition                (self) -> bool:
        return hasattr(self, 'Edit_SetAxisXPickPosition'                   ) and isinstance(self.Edit_SetAxisXPickPosition                , Qt.QDoubleSpinBox       )

    @property
    def hasEdit_SetAxisYPickPosition                (self) -> bool:
        return hasattr(self, 'Edit_SetAxisYPickPosition'                   ) and isinstance(self.Edit_SetAxisYPickPosition                , Qt.QDoubleSpinBox       )

    @property
    def hasEdit_SetScanCodePosition                 (self) -> bool:
        return hasattr(self, 'Edit_SetScanCodePosition'                    ) and isinstance(self.Edit_SetScanCodePosition                 , Qt.QDoubleSpinBox       )

    @property
    def hasEdit_SetScanCodeSpacing                  (self) -> bool:
        return hasattr(self, 'Edit_SetScanCodeSpacing'                     ) and isinstance(self.Edit_SetScanCodeSpacing                  , Qt.QDoubleSpinBox       )

    @property
    def hasEdit_SetAxisXDetectorPosition            (self) -> bool:
        return hasattr(self, 'Edit_SetAxisXDetectorPosition'               ) and isinstance(self.Edit_SetAxisXDetectorPosition            , Qt.QDoubleSpinBox       )

    @property
    def hasEdit_SetAxisYDetectorPosition            (self) -> bool:
        return hasattr(self, 'Edit_SetAxisYDetectorPosition'               ) and isinstance(self.Edit_SetAxisYDetectorPosition            , Qt.QDoubleSpinBox       )

    @property
    def hasEdit_SetLayerCount                       (self) -> bool:
        return hasattr(self, 'Edit_SetLayerCount'                          ) and isinstance(self.Edit_SetLayerCount                       , Qt.QSpinBox             )

    @property
    def hasEdit_SetDetectorLayerPosition            (self) -> bool:
        return hasattr(self, 'Edit_SetDetectorLayerPosition'               ) and isinstance(self.Edit_SetDetectorLayerPosition            , Qt.QDoubleSpinBox       )

    @property
    def hasSend_Position                            (self) -> bool:
        return hasattr(self, 'Send_Position'                               ) and isinstance(self.Send_Position                            , Qt.QPushButton          )

    @property
    def hasSend_Velocity                            (self) -> bool:
        return hasattr(self, 'Send_Velocity'                               ) and isinstance(self.Send_Velocity                            , Qt.QPushButton          )

    @property
    def hasSend_SetLayerHoverHeight                 (self) -> bool:
        return hasattr(self, 'Send_SetLayerHoverHeight'                    ) and isinstance(self.Send_SetLayerHoverHeight                 , Qt.QPushButton          )

    @property
    def hasSend_SetLayerDragHoverHeight             (self) -> bool:
        return hasattr(self, 'Send_SetLayerDragHoverHeight'                ) and isinstance(self.Send_SetLayerDragHoverHeight             , Qt.QPushButton          )

    @property
    def hasSend_SetLayerSpacingHeight               (self) -> bool:
        return hasattr(self, 'Send_SetLayerSpacingHeight'                  ) and isinstance(self.Send_SetLayerSpacingHeight               , Qt.QPushButton          )

    @property
    def hasSend_SetAxisXPickPosition                (self) -> bool:
        return hasattr(self, 'Send_SetAxisXPickPosition'                   ) and isinstance(self.Send_SetAxisXPickPosition                , Qt.QPushButton          )

    @property
    def hasSend_SetAxisYPickPosition                (self) -> bool:
        return hasattr(self, 'Send_SetAxisYPickPosition'                   ) and isinstance(self.Send_SetAxisYPickPosition                , Qt.QPushButton          )

    @property
    def hasSend_SetScanCodePosition                 (self) -> bool:
        return hasattr(self, 'Send_SetScanCodePosition'                    ) and isinstance(self.Send_SetScanCodePosition                 , Qt.QPushButton          )

    @property
    def hasSend_SetScanCodeSpacing                  (self) -> bool:
        return hasattr(self, 'Send_SetScanCodeSpacing'                     ) and isinstance(self.Send_SetScanCodeSpacing                  , Qt.QPushButton          )

    @property
    def hasSend_SetAxisXDetectorPosition            (self) -> bool:
        return hasattr(self, 'Send_SetAxisXDetectorPosition'               ) and isinstance(self.Send_SetAxisXDetectorPosition            , Qt.QPushButton          )

    @property
    def hasSend_SetAxisYDetectorPosition            (self) -> bool:
        return hasattr(self, 'Send_SetAxisYDetectorPosition'               ) and isinstance(self.Send_SetAxisYDetectorPosition            , Qt.QPushButton          )

    @property
    def hasSend_SetLayerCount                       (self) -> bool:
        return hasattr(self, 'Send_SetLayerCount'                          ) and isinstance(self.Send_SetLayerCount                       , Qt.QPushButton          )

    @property
    def hasSend_SetDetectorLayerPosition            (self) -> bool:
        return hasattr(self, 'Send_SetDetectorLayerPosition'               ) and isinstance(self.Send_SetDetectorLayerPosition            , Qt.QPushButton          )

    @property
    def hasGroupBox   (self) -> bool:
        return hasattr(self, 'GroupBox' ) and isinstance(self.GroupBox, Qt.QGroupBox )

    @property
    def hasLabels     (self) -> bool:
        return hasattr(self, 'Labels'   ) and isinstance(self.Labels  , list         )

    @property
    def hasChamberStatusButton(self) -> bool:
        return hasattr(self, 'ChamberStatusButton') and isinstance(self.ChamberStatusButton, Qt.QPushButton)

    @property
    def hasInfoChamberNumber(self) -> bool:
        return hasattr(self, 'InfoChamberNumber') and isinstance(self.InfoChamberNumber, Qt.QPushButton)

    @property
    def hasEditChamberNumber(self) -> bool:
        return hasattr(self, 'EditChamberNumber') and isinstance(self.EditChamberNumber, Qt.QComboBox  )

    # FrontLimit                          : ModBusRegister            #  M14     '挂钩前面限位　　'
    # BackLimit                           : ModBusRegister            #  M15     '挂钩后面限位　　'
    # PlaceRegister                       : ModBusRegister            #  M16     '托盘到位状态　　'
    # DetectorRegister                    : ModBusRegister            #  M17     '检测托盘状态　　'
    # LayerRegister                       : ModBusRegister            #  M20     '片仓一层状态　　'
    # PickTrayCompleteRegister            : ModBusRegister            #  M44     '取片完成状态　　'
    # DropTrayCompleteRegister            : ModBusRegister            #  M45     '放片完成状态　　'
    # DetectorTrayCompleteRegister        : ModBusRegister            #  M46     '检测托盘完成状态'
    # DetectorChamberCompleteRegister     : ModBusRegister            #  M47     '扫描片仓完成状态'
    # ScanCodePickTrayCompleteRegister    : ModBusRegister            #  M48     '扫码取片到位状态'
    # EmptyTrayReturnStatusRegister       : ModBusRegister            #  M50     '空挂退出完成状态'
    # ForwardMalfunction                  : ModBusRegister            #  M406    '挂钩前进故障状态'
    # BackwardMalfunction                 : ModBusRegister            #  M407    '挂钩后退故障状态'
    StatusLabel                              : Qt.QLabel                   #
    StatusEdit                               : Qt.QComboBox                  #
    StatusIcon                               : Qt.QLabel                     #
    StatusButton                             : Qt.QPushButton                #
    Button_HookClearZero                     : Qt.QPushButton            #  M3      '挂钩电机清零　　'
    Button_ForceQuit                         : Qt.QPushButton            #  M59     '设置强制退出功能'
    Button_PickTray                          : Qt.QPushButton            #  M60     '片仓取出托盘功能'
    Button_DropTray                          : Qt.QPushButton            #  M61     '托盘放回片仓功能'
    Button_Detector                          : Qt.QPushButton            #  M62     '检测指定托盘功能'
    Button_DetectorChamber                   : Qt.QPushButton            #  M63     '检测片仓托盘功能'
    Button_ScanCodePick                      : Qt.QPushButton            #  M64     '扫码托片功能　　'
    Button_EmptyTrayReturn                   : Qt.QPushButton            #  M65     '空挂返回功能　　'
    Button_Forward                           : Qt.QPushButton            #  M72     '挂钩电机前进功能'
    Button_Backward                          : Qt.QPushButton            #  M73     '挂钩电机后退功能'
    Button_ScanCodeCompleteMove              : Qt.QPushButton            #  M81     '扫码完成前进功能'
    Button_HookReset                         : Qt.QPushButton            #  M423    '挂钩电机复位功能'

    Read_Position                            : Qt.QPushButton            #  D100    '当前挂钩位置　　'
    Read_Velocity                            : Qt.QPushButton            #  D102    '当前挂钩速度　　'
    Read_SetLayerHoverHeight                 : Qt.QPushButton            #  D1200   '设置悬停高度功能'
    Read_SetLayerDragHoverHeight             : Qt.QPushButton            #  D1202   '设置拖拽高度功能'
    Read_SetLayerSpacingHeight               : Qt.QPushButton            #  D1204   '设置片仓间距功能'
    Read_SetAxisXPickPosition                : Qt.QPushButton            #  D1206   '设置Ｘ轴取片位置'
    Read_SetAxisYPickPosition                : Qt.QPushButton            #  D1208   '设置Ｙ轴取片位置'
    Read_SetScanCodePosition                 : Qt.QPushButton            #  D1210   '设置扫码位置功能'
    Read_SetScanCodeSpacing                  : Qt.QPushButton            #  D1212   '设置扫码间距功能'
    Read_SetAxisXDetectorPosition            : Qt.QPushButton            #  D1214   '设置Ｘ轴检测位置'
    Read_SetAxisYDetectorPosition            : Qt.QPushButton            #  D1216   '设置Ｙ轴检测位置'
    Read_SetLayerCount                       : Qt.QPushButton            #  D1216   '设置片仓层数功能'
    Read_SetDetectorLayerPosition            : Qt.QPushButton            #  D1216   '检测片仓Ｚ轴位置'
    Edit_Position                            : Qt.QDoubleSpinBox         #  D100    '当前挂钩位置　　'
    Edit_Velocity                            : Qt.QDoubleSpinBox         #  D102    '当前挂钩速度　　'
    Edit_SetLayerHoverHeight                 : Qt.QDoubleSpinBox         #  D1200   '设置悬停高度功能'
    Edit_SetLayerDragHoverHeight             : Qt.QDoubleSpinBox         #  D1202   '设置拖拽高度功能'
    Edit_SetLayerSpacingHeight               : Qt.QDoubleSpinBox         #  D1204   '设置片仓间距功能'
    Edit_SetAxisXPickPosition                : Qt.QDoubleSpinBox         #  D1206   '设置Ｘ轴取片位置'
    Edit_SetAxisYPickPosition                : Qt.QDoubleSpinBox         #  D1208   '设置Ｙ轴取片位置'
    Edit_SetScanCodePosition                 : Qt.QDoubleSpinBox         #  D1210   '设置扫码位置功能'
    Edit_SetScanCodeSpacing                  : Qt.QDoubleSpinBox         #  D1212   '设置扫码间距功能'
    Edit_SetAxisXDetectorPosition            : Qt.QDoubleSpinBox         #  D1214   '设置Ｘ轴检测位置'
    Edit_SetAxisYDetectorPosition            : Qt.QDoubleSpinBox         #  D1216   '设置Ｙ轴检测位置'
    Edit_SetLayerCount                       : Qt.QSpinBox               #  D1216   '设置片仓层数功能'
    Edit_SetDetectorLayerPosition            : Qt.QDoubleSpinBox         #  D1216   '检测片仓Ｚ轴位置'
    Send_Position                            : Qt.QPushButton           #  D100     '当前挂钩位置　　'
    Send_Velocity                            : Qt.QPushButton           #  D102     '当前挂钩速度　　'
    Send_SetLayerHoverHeight                 : Qt.QPushButton           #  D1200    '设置悬停高度功能'
    Send_SetLayerDragHoverHeight             : Qt.QPushButton           #  D1202    '设置拖拽高度功能'
    Send_SetLayerSpacingHeight               : Qt.QPushButton           #  D1204    '设置片仓间距功能'
    Send_SetAxisXPickPosition                : Qt.QPushButton           #  D1206    '设置Ｘ轴取片位置'
    Send_SetAxisYPickPosition                : Qt.QPushButton           #  D1208    '设置Ｙ轴取片位置'
    Send_SetScanCodePosition                 : Qt.QPushButton           #  D1210    '设置扫码位置功能'
    Send_SetScanCodeSpacing                  : Qt.QPushButton           #  D1212    '设置扫码间距功能'
    Send_SetAxisXDetectorPosition            : Qt.QPushButton           #  D1214    '设置Ｘ轴检测位置'
    Send_SetAxisYDetectorPosition            : Qt.QPushButton           #  D1216    '设置Ｙ轴检测位置'
    Send_SetLayerCount                       : Qt.QPushButton           #  D1216    '设置片仓层数功能'
    Send_SetDetectorLayerPosition            : Qt.QPushButton           #  D1216    '检测片仓Ｚ轴位置'
    GroupBox                                 : Qt.QGroupBox
    Labels                                   : list[Qt.QLabel]
    ChamberStatusButton                      : Qt.QPushButton
    InfoChamberNumber                        : Qt.QPushButton           #
    EditChamberNumber                        : Qt.QComboBox             #
