#!D:/IDE/anaconda3/envs python
# -*- coding: UTF-8 -*-
"""
 @Author: Administrator
 @FileName：DrawSlidesDataView.py\n
 @DateTime: 2025/7/17 15:16\n
 @Author  ：xsh
"""
from abc import abstractmethod
from PyQt5 import Qt
from AppInterfaces.UiInterface import UiInterface, AppConvert, AppUtils
from AppCore.Contexts import *
from AppCore.DBModels import *
from AppCore.Levels import *
from AppUtils.UiUtils import UiUtils


class DrawSlidesDataView(Qt.QWidget, UiInterface):
    currentDataChanged: Qt.pyqtSignal = Qt.pyqtSignal(object)
    currentDataUpdated: Qt.pyqtSignal = Qt.pyqtSignal(object)
    Model                    : SlideModel
    InfoLevel                : Qt.QLabel
    InfoObjectiveLevel       : Qt.QLabel
    InfoChamberGroupNumber   : Qt.QLabel
    InfoChamberRowNumber     : Qt.QLabel
    InfoTrayNumber           : Qt.QLabel
    InfoRowNumber            : Qt.QLabel
    InfoColNumber            : Qt.QLabel
    InfoImageCellX           : Qt.QLabel
    InfoImageCellY           : Qt.QLabel
    InfoPosition_X           : Qt.QLabel
    InfoPosition_Y           : Qt.QLabel
    InfoPosition_Z           : Qt.QLabel
    InfoCodeString           : Qt.QLabel
    InfoCreateTime           : Qt.QLabel
    EditLevel                : Qt.QLabel
    EditObjectiveLevel       : Qt.QLabel
    EditChamberGroupNumber   : Qt.QLabel
    EditChamberRowNumber     : Qt.QLabel
    EditTrayNumber           : Qt.QLabel
    EditRowNumber            : Qt.QLabel
    EditColNumber            : Qt.QLabel
    EditImageCellX           : Qt.QLabel
    EditImageCellY           : Qt.QLabel
    EditPosition_X           : Qt.QLabel
    EditPosition_Y           : Qt.QLabel
    EditPosition_Z           : Qt.QLabel
    EditCodeString           : Qt.QLabel
    EditCreateTime           : Qt.QLabel
    def __init__(self, parent: Qt.QWidget = None):
        super(DrawSlidesDataView, self).__init__(parent=parent)
        self.Initialization('DrawSlidesDataView', self, parent)
        self.initWidgetStyle()
        self.flushFrame()

    def initWidgetStyle(self):
        self.setStyleSheet(UiUtils.getDrawDataStyle())


    def initConnect(self):
        super(DrawSlidesDataView, self).initConnect()
        TYPE: Qt.Qt.ConnectionType = Qt.Qt.ConnectionType(Qt.Qt.AutoConnection | Qt.Qt.UniqueConnection)
        self.currentDataUpdated.connect(slot=self.currentDataChangedSlot, type=TYPE)
        self.currentDataChanged.connect(slot=self.currentDataChangedSlot, type=TYPE)
    def setModel(self, model: SlideModelInterface):
        if isinstance(model, SlideModelInterface):
            self.initModel()
            self.Model.as_field(model.to_field())
        self.flushFrame()

    def currentDataChangedSlot(self, model: SlideModelInterface):
        if isinstance(model, SlideModelInterface):
            self.initModel()
            self.Model.as_field(model.to_field())
        self.flushFrame()

    def initValue(self):
        super(DrawSlidesDataView, self).initValue()
        self.initModel                    ()
        self.initInfoLevel                ()
        self.initInfoObjectiveLevel       ()
        self.initInfoChamberGroupNumber   ()
        self.initInfoChamberRowNumber     ()
        self.initInfoTrayNumber           ()
        self.initInfoRowNumber            ()
        self.initInfoColNumber            ()
        self.initInfoImageCellX           ()
        self.initInfoImageCellY           ()
        self.initInfoPosition_X           ()
        self.initInfoPosition_Y           ()
        self.initInfoPosition_Z           ()
        self.initInfoCodeString           ()
        self.initInfoCreateTime           ()
        self.initEditLevel                ()
        self.initEditObjectiveLevel       ()
        self.initEditChamberGroupNumber   ()
        self.initEditChamberRowNumber     ()
        self.initEditTrayNumber           ()
        self.initEditRowNumber            ()
        self.initEditColNumber            ()
        self.initEditImageCellX           ()
        self.initEditImageCellY           ()
        self.initEditPosition_X           ()
        self.initEditPosition_Y           ()
        self.initEditPosition_Z           ()
        self.initEditCodeString           ()
        self.initEditCreateTime           ()

    def initProperty(self):
        super(DrawSlidesDataView, self).initProperty()
        self.InfoLevel                .setAlignment(Qt.Qt.AlignRight | Qt.Qt.AlignVCenter)
        self.InfoObjectiveLevel       .setAlignment(Qt.Qt.AlignRight | Qt.Qt.AlignVCenter)
        self.InfoChamberGroupNumber   .setAlignment(Qt.Qt.AlignRight | Qt.Qt.AlignVCenter)
        self.InfoChamberRowNumber     .setAlignment(Qt.Qt.AlignRight | Qt.Qt.AlignVCenter)
        self.InfoTrayNumber           .setAlignment(Qt.Qt.AlignRight | Qt.Qt.AlignVCenter)
        self.InfoRowNumber            .setAlignment(Qt.Qt.AlignRight | Qt.Qt.AlignVCenter)
        self.InfoColNumber            .setAlignment(Qt.Qt.AlignRight | Qt.Qt.AlignVCenter)
        self.InfoImageCellX           .setAlignment(Qt.Qt.AlignRight | Qt.Qt.AlignVCenter)
        self.InfoImageCellY           .setAlignment(Qt.Qt.AlignRight | Qt.Qt.AlignVCenter)
        self.InfoPosition_X           .setAlignment(Qt.Qt.AlignRight | Qt.Qt.AlignVCenter)
        self.InfoPosition_Y           .setAlignment(Qt.Qt.AlignRight | Qt.Qt.AlignVCenter)
        self.InfoPosition_Z           .setAlignment(Qt.Qt.AlignRight | Qt.Qt.AlignVCenter)
        self.InfoCodeString           .setAlignment(Qt.Qt.AlignRight | Qt.Qt.AlignVCenter)
        self.InfoCreateTime           .setAlignment(Qt.Qt.AlignRight | Qt.Qt.AlignVCenter)
        self.EditLevel                .setAlignment(Qt.Qt.AlignLeft  | Qt.Qt.AlignVCenter)
        self.EditObjectiveLevel       .setAlignment(Qt.Qt.AlignLeft  | Qt.Qt.AlignVCenter)
        self.EditChamberGroupNumber   .setAlignment(Qt.Qt.AlignLeft  | Qt.Qt.AlignVCenter)
        self.EditChamberRowNumber     .setAlignment(Qt.Qt.AlignLeft  | Qt.Qt.AlignVCenter)
        self.EditTrayNumber           .setAlignment(Qt.Qt.AlignLeft  | Qt.Qt.AlignVCenter)
        self.EditRowNumber            .setAlignment(Qt.Qt.AlignLeft  | Qt.Qt.AlignVCenter)
        self.EditColNumber            .setAlignment(Qt.Qt.AlignLeft  | Qt.Qt.AlignVCenter)
        self.EditImageCellX           .setAlignment(Qt.Qt.AlignLeft  | Qt.Qt.AlignVCenter)
        self.EditImageCellY           .setAlignment(Qt.Qt.AlignLeft  | Qt.Qt.AlignVCenter)
        self.EditPosition_X           .setAlignment(Qt.Qt.AlignLeft  | Qt.Qt.AlignVCenter)
        self.EditPosition_Y           .setAlignment(Qt.Qt.AlignLeft  | Qt.Qt.AlignVCenter)
        self.EditPosition_Z           .setAlignment(Qt.Qt.AlignLeft  | Qt.Qt.AlignVCenter)
        self.EditCodeString           .setAlignment(Qt.Qt.AlignLeft  | Qt.Qt.AlignVCenter)
        self.EditCreateTime           .setAlignment(Qt.Qt.AlignLeft  | Qt.Qt.AlignVCenter)

        self.EditLevel                .setContentsMargins(5, 1, 1, 1)
        self.EditObjectiveLevel       .setContentsMargins(5, 1, 1, 1)
        self.EditChamberGroupNumber   .setContentsMargins(5, 1, 1, 1)
        self.EditChamberRowNumber     .setContentsMargins(5, 1, 1, 1)
        self.EditTrayNumber           .setContentsMargins(5, 1, 1, 1)
        self.EditRowNumber            .setContentsMargins(5, 1, 1, 1)
        self.EditColNumber            .setContentsMargins(5, 1, 1, 1)
        self.EditImageCellX           .setContentsMargins(5, 1, 1, 1)
        self.EditImageCellY           .setContentsMargins(5, 1, 1, 1)
        self.EditPosition_X           .setContentsMargins(5, 1, 1, 1)
        self.EditPosition_Y           .setContentsMargins(5, 1, 1, 1)
        self.EditPosition_Z           .setContentsMargins(5, 1, 1, 1)
        self.EditCodeString           .setContentsMargins(5, 1, 1, 1)
        self.EditCreateTime           .setContentsMargins(5, 1, 1, 1)

        self.InfoLevel                .setMinimumSize(100, 30)
        self.InfoObjectiveLevel       .setMinimumSize(100, 30)
        self.InfoChamberGroupNumber   .setMinimumSize(100, 30)
        self.InfoChamberRowNumber     .setMinimumSize(100, 30)
        self.InfoTrayNumber           .setMinimumSize(100, 30)
        self.InfoRowNumber            .setMinimumSize(100, 30)
        self.InfoColNumber            .setMinimumSize(100, 30)
        self.InfoImageCellX           .setMinimumSize(100, 30)
        self.InfoImageCellY           .setMinimumSize(100, 30)
        self.InfoPosition_X           .setMinimumSize(100, 30)
        self.InfoPosition_Y           .setMinimumSize(100, 30)
        self.InfoPosition_Z           .setMinimumSize(100, 30)
        self.InfoCodeString           .setMinimumSize(100, 30)
        self.InfoCreateTime           .setMinimumSize(100, 30)
        self.EditLevel                .setMinimumSize(100, 30)
        self.EditObjectiveLevel       .setMinimumSize(100, 30)
        self.EditChamberGroupNumber   .setMinimumSize(100, 30)
        self.EditChamberRowNumber     .setMinimumSize(100, 30)
        self.EditTrayNumber           .setMinimumSize(100, 30)
        self.EditRowNumber            .setMinimumSize(100, 30)
        self.EditColNumber            .setMinimumSize(100, 30)
        self.EditImageCellX           .setMinimumSize(100, 30)
        self.EditImageCellY           .setMinimumSize(100, 30)
        self.EditPosition_X           .setMinimumSize(100, 30)
        self.EditPosition_Y           .setMinimumSize(100, 30)
        self.EditPosition_Z           .setMinimumSize(100, 30)
        self.EditCodeString           .setMinimumSize(100, 30)
        self.EditCreateTime           .setMinimumSize(100, 30)
        self.setFixedWidth(300)

    def initLayouts(self):
        super(DrawSlidesDataView, self).initLayouts()
        if not self.hasControl or self.layout() is not None:
            return
        layout: Qt.QHBoxLayout = Qt.QHBoxLayout()
        layout.setSpacing(2)
        layout.setContentsMargins(20, 20, 20, 20)
        group_box: Qt.QGroupBox = Qt.QGroupBox(self)
        group_box_layout: Qt.QVBoxLayout = Qt.QVBoxLayout()
        group_box_layout.setSpacing(2)
        group_box_layout.setContentsMargins(5, 5, 5, 5)
        layouts: list[Qt.QHBoxLayout] = []
        for index in range(0, 14):
            _layout = Qt.QHBoxLayout()
            _layout.setSpacing(2)
            _layout.setContentsMargins(1, 1, 1, 1)
            layouts.append(_layout)

        layouts[0 ].addWidget(self.InfoLevel                )
        layouts[1 ].addWidget(self.InfoObjectiveLevel       )
        layouts[2 ].addWidget(self.InfoChamberGroupNumber   )
        layouts[3 ].addWidget(self.InfoChamberRowNumber     )
        layouts[4 ].addWidget(self.InfoTrayNumber           )
        layouts[5 ].addWidget(self.InfoRowNumber            )
        layouts[6 ].addWidget(self.InfoColNumber            )
        layouts[7 ].addWidget(self.InfoImageCellX           )
        layouts[8 ].addWidget(self.InfoImageCellY           )
        layouts[9 ].addWidget(self.InfoPosition_X           )
        layouts[10].addWidget(self.InfoPosition_Y           )
        layouts[11].addWidget(self.InfoPosition_Z           )
        layouts[12].addWidget(self.InfoCodeString           )
        layouts[13].addWidget(self.InfoCreateTime           )

        layouts[0 ].addWidget(self.EditLevel                )
        layouts[1 ].addWidget(self.EditObjectiveLevel       )
        layouts[2 ].addWidget(self.EditChamberGroupNumber   )
        layouts[3 ].addWidget(self.EditChamberRowNumber     )
        layouts[4 ].addWidget(self.EditTrayNumber           )
        layouts[5 ].addWidget(self.EditRowNumber            )
        layouts[6 ].addWidget(self.EditColNumber            )
        layouts[7 ].addWidget(self.EditImageCellX           )
        layouts[8 ].addWidget(self.EditImageCellY           )
        layouts[9 ].addWidget(self.EditPosition_X           )
        layouts[10].addWidget(self.EditPosition_Y           )
        layouts[11].addWidget(self.EditPosition_Z           )
        layouts[12].addWidget(self.EditCodeString           )
        layouts[13].addWidget(self.EditCreateTime           )

        group_box_layout.addLayout(layouts[0 ])
        group_box_layout.addLayout(layouts[1 ])
        group_box_layout.addLayout(layouts[2 ])
        group_box_layout.addLayout(layouts[3 ])
        group_box_layout.addLayout(layouts[4 ])
        group_box_layout.addLayout(layouts[5 ])
        group_box_layout.addLayout(layouts[6 ])
        group_box_layout.addLayout(layouts[7 ])
        group_box_layout.addLayout(layouts[8 ])
        group_box_layout.addLayout(layouts[9 ])
        group_box_layout.addLayout(layouts[10])
        group_box_layout.addLayout(layouts[11])
        group_box_layout.addLayout(layouts[12])
        group_box_layout.addLayout(layouts[13])

        group_box.setLayout(group_box_layout)
        layout.addWidget(group_box)
        self.setLayout(layout)


    def flushFrame(self):
        super(DrawSlidesDataView, self).flushFrame()
        self.initModel()


        self.InfoLevel                .setText('{0}:'.format(self.Model.__header__[self.Model.__field__.index('Level'               )]))
        self.InfoObjectiveLevel       .setText('{0}:'.format(self.Model.__header__[self.Model.__field__.index('ObjectiveLevel'      )]))
        self.InfoChamberGroupNumber   .setText('{0}:'.format(self.Model.__header__[self.Model.__field__.index('ChamberGroupNumber'  )]))
        self.InfoChamberRowNumber     .setText('{0}:'.format(self.Model.__header__[self.Model.__field__.index('ChamberRowNumber'    )]))
        self.InfoTrayNumber           .setText('{0}:'.format(self.Model.__header__[self.Model.__field__.index('TrayNumber'          )]))
        self.InfoRowNumber            .setText('{0}:'.format(self.Model.__header__[self.Model.__field__.index('RowNumber'           )]))
        self.InfoColNumber            .setText('{0}:'.format(self.Model.__header__[self.Model.__field__.index('ColNumber'           )]))
        self.InfoImageCellX           .setText('{0}:'.format(self.Model.__header__[self.Model.__field__.index('ImageCellX'          )]))
        self.InfoImageCellY           .setText('{0}:'.format(self.Model.__header__[self.Model.__field__.index('ImageCellY'          )]))
        self.InfoPosition_X           .setText('{0}:'.format(self.Model.__header__[self.Model.__field__.index('Position_X'          )]))
        self.InfoPosition_Y           .setText('{0}:'.format(self.Model.__header__[self.Model.__field__.index('Position_Y'          )]))
        self.InfoPosition_Z           .setText('{0}:'.format(self.Model.__header__[self.Model.__field__.index('Position_Z'          )]))
        self.InfoCodeString           .setText('{0}:'.format(self.Model.__header__[self.Model.__field__.index('CodeString'          )]))
        self.InfoCreateTime           .setText('{0}:'.format(self.Model.__header__[self.Model.__field__.index('CreateTime'          )]))
        self.EditLevel                .setText('{0}'.format(self.Model.Level                if self.Model.has_Level              else ''))
        self.EditObjectiveLevel       .setText('{0}'.format(self.Model.ObjectiveLevel       if self.Model.has_ObjectiveLevel     else ''))
        self.EditChamberGroupNumber   .setText('{0}'.format(self.Model.ChamberGroupNumber   if self.Model.has_ChamberGroupNumber else ''))
        self.EditChamberRowNumber     .setText('{0}'.format(self.Model.ChamberRowNumber     if self.Model.has_ChamberRowNumber   else ''))
        self.EditTrayNumber           .setText('{0}'.format(self.Model.TrayNumber           if self.Model.has_TrayNumber         else ''))
        self.EditRowNumber            .setText('{0}'.format(self.Model.RowNumber            if self.Model.has_RowNumber          else ''))
        self.EditColNumber            .setText('{0}'.format(self.Model.ColNumber            if self.Model.has_ColNumber          else ''))
        self.EditImageCellX           .setText('{0}'.format(self.Model.ImageCellX           if self.Model.has_ImageCellX         else ''))
        self.EditImageCellY           .setText('{0}'.format(self.Model.ImageCellY           if self.Model.has_ImageCellY         else ''))
        self.EditPosition_X           .setText('{0}'.format(self.Model.Position_X           if self.Model.has_Position_X         else ''))
        self.EditPosition_Y           .setText('{0}'.format(self.Model.Position_Y           if self.Model.has_Position_Y         else ''))
        self.EditPosition_Z           .setText('{0}'.format(self.Model.Position_Z           if self.Model.has_Position_Z         else ''))
        self.EditCodeString           .setText('{0}'.format(self.Model.CodeString           if self.Model.has_CodeString         else ''))
        self.EditCreateTime           .setText('{0}'.format(AppConvert.DateToString(self.Model.CreateTime)           if self.Model.has_CreateTime         else ''))

    def initModel                    (self):
        if not self.hasModel                    :
            self.Model                     = SlideModel  .copyInstance(ChamberStatusModel.getStatusModel(1, 1))

    def initInfoLevel                (self):
        if not self.hasInfoLevel                :
            self.InfoLevel                 = Qt.QLabel   (self)

    def initInfoObjectiveLevel       (self):
        if not self.hasInfoObjectiveLevel       :
            self.InfoObjectiveLevel        = Qt.QLabel   (self)

    def initInfoChamberGroupNumber   (self):
        if not self.hasInfoChamberGroupNumber   :
            self.InfoChamberGroupNumber    = Qt.QLabel   (self)

    def initInfoChamberRowNumber     (self):
        if not self.hasInfoChamberRowNumber     :
            self.InfoChamberRowNumber      = Qt.QLabel   (self)

    def initInfoTrayNumber           (self):
        if not self.hasInfoTrayNumber           :
            self.InfoTrayNumber            = Qt.QLabel   (self)

    def initInfoRowNumber            (self):
        if not self.hasInfoRowNumber            :
            self.InfoRowNumber             = Qt.QLabel   (self)

    def initInfoColNumber            (self):
        if not self.hasInfoColNumber            :
            self.InfoColNumber             = Qt.QLabel   (self)

    def initInfoImageCellX           (self):
        if not self.hasInfoImageCellX           :
            self.InfoImageCellX            = Qt.QLabel   (self)

    def initInfoImageCellY           (self):
        if not self.hasInfoImageCellY           :
            self.InfoImageCellY            = Qt.QLabel   (self)

    def initInfoPosition_X           (self):
        if not self.hasInfoPosition_X           :
            self.InfoPosition_X            = Qt.QLabel   (self)

    def initInfoPosition_Y           (self):
        if not self.hasInfoPosition_Y           :
            self.InfoPosition_Y            = Qt.QLabel   (self)

    def initInfoPosition_Z           (self):
        if not self.hasInfoPosition_Z           :
            self.InfoPosition_Z            = Qt.QLabel   (self)

    def initInfoCodeString           (self):
        if not self.hasInfoCodeString           :
            self.InfoCodeString            = Qt.QLabel   (self)

    def initInfoCreateTime           (self):
        if not self.hasInfoCreateTime           :
            self.InfoCreateTime            = Qt.QLabel   (self)

    def initEditLevel                (self):
        if not self.hasEditLevel                :
            self.EditLevel                 = Qt.QLabel   (self)

    def initEditObjectiveLevel       (self):
        if not self.hasEditObjectiveLevel       :
            self.EditObjectiveLevel        = Qt.QLabel   (self)

    def initEditChamberGroupNumber   (self):
        if not self.hasEditChamberGroupNumber   :
            self.EditChamberGroupNumber    = Qt.QLabel   (self)

    def initEditChamberRowNumber     (self):
        if not self.hasEditChamberRowNumber     :
            self.EditChamberRowNumber      = Qt.QLabel   (self)

    def initEditTrayNumber           (self):
        if not self.hasEditTrayNumber           :
            self.EditTrayNumber            = Qt.QLabel   (self)

    def initEditRowNumber            (self):
        if not self.hasEditRowNumber            :
            self.EditRowNumber             = Qt.QLabel   (self)

    def initEditColNumber            (self):
        if not self.hasEditColNumber            :
            self.EditColNumber             = Qt.QLabel   (self)

    def initEditImageCellX           (self):
        if not self.hasEditImageCellX           :
            self.EditImageCellX            = Qt.QLabel   (self)

    def initEditImageCellY           (self):
        if not self.hasEditImageCellY           :
            self.EditImageCellY            = Qt.QLabel   (self)

    def initEditPosition_X           (self):
        if not self.hasEditPosition_X           :
            self.EditPosition_X            = Qt.QLabel   (self)

    def initEditPosition_Y           (self):
        if not self.hasEditPosition_Y           :
            self.EditPosition_Y            = Qt.QLabel   (self)

    def initEditPosition_Z           (self):
        if not self.hasEditPosition_Z           :
            self.EditPosition_Z            = Qt.QLabel   (self)

    def initEditCodeString           (self):
        if not self.hasEditCodeString           :
            self.EditCodeString            = Qt.QLabel   (self)

    def initEditCreateTime           (self):
        if not self.hasEditCreateTime           :
            self.EditCreateTime            = Qt.QLabel   (self)








    @property
    def hasModel                    (self) -> bool:
        return hasattr(self, 'Model'                   ) and isinstance(self.Model                    , SlideModelInterface   )

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    @property
    def hasEditCreateTime           (self) -> bool:

        return hasattr(self, 'EditCreateTime'          ) and isinstance(self.EditCreateTime           , Qt.QLabel             )