#!D:/IDE/anaconda3/envs/Microscope_Scan python
# -*- coding: UTF-8 -*-
"""
@FileName：StatusConfigInterface.py
@Description：
@Author：XSH
@Time：2025/11/11 12:45
@Department：研发部
@Copyright：©2025 乐辰生物
"""
from PyQt5                          import Qt
from datetime                       import datetime, date
from AppInterfaces.ConfigInterface  import ConfigInterface
from abc                            import abstractmethod
from AppCore.Levels                 import ScanStatusLevel

class StatusConfigInterface(ConfigInterface):
    IOLocker: Qt.QReadWriteLock = Qt.QReadWriteLock()
    ID                      : int                    #        '数据序号　'
    ObjectiveLevel          : int                    #        '当前物镜　'
    ChamberGroupNumber      : int                    #        '片仓组号　'
    ChamberRowNumber        : int                    #        '片仓行号　'
    TrayNumber              : int                    #        '载玻台号　'
    RowNumber               : int                    #        '玻片行号　'
    ColNumber               : int                    #        '玻片列号　'
    ScanStatus              : int                    #        '扫描状态　'
    RunStatus               : int                    #        '运行状态　'
    Template_ID             : int                    #        '模板序号　'
    PreferredClassifier_ID  : int                    #        '优选器序号'
    PreviewClassifier_ID    : int                    #        '预选器序号'
    CollectClassifier_ID    : int                    #        '采集器序号'
    User_ID                 : int                    #        '当前账号　'
    OperatingStatus_ID      : int                    #        '当前状态　'
    CodeString              : str                    #        '玻片二维码'
    ScanningDateTime        : datetime               #        '开始时间　'
    StopScanningDateTime    : datetime               #        '停止时间　'
    Microscope              : int                    #      '　显微镜状态　　'
    WebSocket               : int                    #      '　网络服务状态　'
    HitBot                  : int                    #      '　机械臂状态　　'
    AxisX                   : int                    #      '载玻台Ｘ轴状态　'
    AxisY                   : int                    #      '载玻台Ｙ轴状态　'
    TrayZ                   : int                    #      '载玻台Ｚ轴状态　'
    TrayH                   : int                    #      '载玻台Ｈ轴状态　'
    Camera                  : int                    #      '　相机状态　　　'
    ColorCamera             : int                    #      '　彩色相机状态　'
    ScanCode                : int                    #      '　扫描器状态　　'
    Oil                     : int                    #      '　镜油管状态　　'
    Chamber                 : int                    #      '　载玻片片仓状态'
    Buzzer                  : int                    #      '　蜂鸣器器状态　'
    Door                    : int                    #      '仪器门传感器状态'
    TrayStatus              : int                    #      '当前载玻台号状态'
    AutoScanMode            : int                    #      '玻片自动扫描模式'
    JumpScanning            : int                    #      '　　跳过扫描　　'
    CameraModel             : object
    FocusingStatus          : int                    #      '定焦停止标志位'

    def UpdateMaxLocation(self):
        self.UpdateScanStatus       ()
        self.UpdateOperatingStatus  ()

    def initFocusingStatus(self):
        if not self.hasFocusingStatus:
            self.FocusingStatus = ScanStatusLevel.ReadyScanning_Status

    def setFocusingStatus(self, status: int):
        self.FocusingStatus = status

    def init_focusing_status(self):
        self.FocusingStatus = ScanStatusLevel.ReadyScanning_Status

    @property
    def focusing_status(self) -> int:
        self.initFocusingStatus()
        return self.FocusingStatus

    @property
    def currentObjectiveLevel(self) -> int:
        Locker: Qt.QReadLocker = Qt.QReadLocker(self.IOLocker)
        return self.ObjectiveLevel

    @property
    def currentChamberGroupNumber(self) -> int:
        Locker: Qt.QReadLocker = Qt.QReadLocker(self.IOLocker)
        return self.ChamberGroupNumber

    @property
    def currentChamberRowNumber(self) -> int:
        Locker: Qt.QReadLocker = Qt.QReadLocker(self.IOLocker)
        return self.ChamberRowNumber

    @property
    def currentTrayNumber(self) -> int:
        Locker: Qt.QReadLocker = Qt.QReadLocker(self.IOLocker)
        return self.TrayNumber

    @property
    def currentRowNumber(self) -> int:
        Locker: Qt.QReadLocker = Qt.QReadLocker(self.IOLocker)
        return self.RowNumber

    @property
    def currentColNumber(self) -> int:
        Locker: Qt.QReadLocker = Qt.QReadLocker(self.IOLocker)
        return self.ColNumber

    @property
    def currentScanStatus(self) -> int:
        Locker: Qt.QReadLocker = Qt.QReadLocker(self.IOLocker)
        return self.ScanStatus

    @property
    def currentRunStatus(self) -> int:
        Locker: Qt.QReadLocker = Qt.QReadLocker(self.IOLocker)
        return self.RunStatus

    @property
    def currentTemplate_ID(self) -> int:
        Locker: Qt.QReadLocker = Qt.QReadLocker(self.IOLocker)
        return self.Template_ID

    @property
    def currentPreferredClassifier_ID(self) -> int:
        Locker: Qt.QReadLocker = Qt.QReadLocker(self.IOLocker)
        return self.PreferredClassifier_ID

    @property
    def currentPreviewClassifier_ID(self) -> int:
        Locker: Qt.QReadLocker = Qt.QReadLocker(self.IOLocker)
        return self.PreviewClassifier_ID

    @property
    def currentCollectClassifier_ID(self) -> int:
        Locker: Qt.QReadLocker = Qt.QReadLocker(self.IOLocker)
        return self.CollectClassifier_ID

    @property
    def currentUser_ID(self) -> int:
        Locker: Qt.QReadLocker = Qt.QReadLocker(self.IOLocker)
        return self.User_ID

    @property
    def currentCodeString(self) -> int:
        Locker: Qt.QReadLocker = Qt.QReadLocker(self.IOLocker)
        return self.CodeString

    @abstractmethod
    def getChamberSlide(self, chamber_number: int, row_number: int) -> 'SlideModelInterface':
        """获取当前片仓玻片对象"""
        pass

    @abstractmethod
    def getSlideScanTemplate(self, chamber_number: int, row_number: int) -> ('ScanTemplate', 'Previewsettings', 'Collectsettings'):
        """获取当前扫描玻片模板类"""
        pass

    @abstractmethod
    def setScanningSlide(self, chamber_number: int, row_number: int, tray_number: int, objective: int, level: int,templateID: int, codestring: str):
        """设置当前扫描玻片信息"""
        pass

    @abstractmethod
    def setCollectCount(self, chamber_number: int, row_number: int, tray_number: int, objective: int, collectcount: int):
        pass

    @abstractmethod
    def setPreviewCount(self, chamber_number: int, row_number: int, tray_number: int, objective: int, previewcount: int):
        pass

    @abstractmethod
    def setTrayFocusingCount(self, level: int, focusingNumber: int):
        pass

    @abstractmethod
    def getTrayFocusingCount(self, level: int) -> int:
        pass


    @abstractmethod
    def InitTrayStatus(self, chamber_number: int):
        pass

    @abstractmethod
    def InitChamberStatus(self):
        pass

    @abstractmethod
    def GetTrayDetectorStatus(self, chamber_number: int, row_number: int = 1, **args) -> int:
        pass

    @abstractmethod
    def GetChamberStatus(self, chamber_number: int, **args) -> int:
        pass

    @abstractmethod
    def SetTrayDetectorStatus(self, chamber_number: int, status: (int, bool)):
        pass

    @abstractmethod
    def SetTraySlideDetectorStatus(self, chamber_number: int, row_number: int, status:(int, bool)):
        pass
    @abstractmethod
    def SetChamberDetectorStatus(self, status: list[int]):
        pass

    @abstractmethod
    def UpdateScanStatus(self):
        pass

    @abstractmethod
    def UpdateOperatingStatus(self):
        pass

    @abstractmethod
    def getCameraModel(self, level: int) -> 'CameraInterface':
        pass

    @abstractmethod
    def setCameraModel(self, level: int):
        pass

    def hasOperating(self) -> bool:
        pass

    @abstractmethod
    def setRunStatus(self, status: int):
        pass

    @abstractmethod
    def getRunStatus(self) -> int:
        pass

    @abstractmethod
    def setPause(self, enable: (int, bool)):
        pass

    @abstractmethod
    def setExit(self, enable: (int, bool) = True):
        pass

    @abstractmethod
    def setRunning(self, enable: (int, bool) = True):
        pass

    @property
    @abstractmethod
    def isPause(self) -> bool:
        pass

    @property
    @abstractmethod
    def isExit(self) -> bool:
        pass

    @property
    @abstractmethod
    def isRunning(self) -> bool:
        pass

    @property
    @abstractmethod
    def isRunAvailable(self) -> bool:
        pass

    @abstractmethod
    def updateRunAvailable(self):
        pass

    @abstractmethod
    def setMicroscopeAvailable(self, enable: (int, bool)):
        pass

    def isManipulatorAvailable(self) -> int:
        pass

    def setManipulatorAvailable(self, enable: (int, bool)):
        pass

    @abstractmethod
    def setWebSocketAvailable(self, enable: (int, bool)):
        pass

    @abstractmethod
    def setHitBotAvailable(self, enable: (int, bool)):
        pass

    @abstractmethod
    def setAxisXAvailable(self, enable: (int, bool)):
        pass

    @abstractmethod
    def setAxisYAvailable(self, enable: (int, bool)):
        pass

    @abstractmethod
    def setTrayZAvailable(self, enable: (int, bool)):
        pass

    @abstractmethod
    def setTrayHAvailable(self, enable: (int, bool)):
        pass

    @abstractmethod
    def setCameraAvailable(self, enable: (int, bool)):
        pass

    @abstractmethod
    def setColorCameraAvailable(self, enable: (int, bool)):
        pass

    @abstractmethod
    def setScanCodeAvailable(self, enable: (int, bool)):
        pass

    @abstractmethod
    def setOilAvailable(self, enable: (int, bool)):
        pass

    @abstractmethod
    def setChamberAvailable(self, enable: (int, bool)):
        pass

    @abstractmethod
    def setBuzzerAvailable(self, enable: (int, bool)):
        pass

    @abstractmethod
    def setDoorAvailable(self, enable: (int, bool)):
        pass

    @abstractmethod
    def setTrayStatus(self, enable: (int, bool)):
        pass

    @abstractmethod
    def setAutoScanMode(self, enable: (int, bool)):
        pass

    @abstractmethod
    def setJumpScanning(self, enable: (int, bool)):
        pass

    @property
    @abstractmethod
    def isMicroscopeAvailable(self) -> int:
        pass

    @property
    @abstractmethod
    def isWebSocketAvailable(self) -> int:
        pass

    @property
    @abstractmethod
    def isHitBotAvailable(self) -> int:
        pass

    @property
    @abstractmethod
    def isAxisXAvailable(self) -> int:
        pass

    @property
    @abstractmethod
    def isAxisYAvailable(self) -> int:
        pass

    @property
    @abstractmethod
    def isTrayZAvailable(self) -> int:
        pass

    @property
    @abstractmethod
    def isTrayHAvailable(self) -> int:
        pass

    @property
    @abstractmethod
    def isCameraAvailable(self) -> int:
        pass

    @property
    @abstractmethod
    def isColorCameraAvailable(self) -> int:
        pass

    @property
    @abstractmethod
    def isScanCodeAvailable(self) -> int:
        pass

    @property
    @abstractmethod
    def isOilAvailable(self) -> int:
        pass

    @property
    @abstractmethod
    def isChamberAvailable(self) -> int:
        pass

    @property
    @abstractmethod
    def isBuzzerAvailable(self) -> int:
        pass

    @property
    @abstractmethod
    def isDoorAvailable(self) -> int:
        pass

    @property
    @abstractmethod
    def isTrayStatus(self) -> int:
        pass

    @property
    @abstractmethod
    def isAutoScanMode(self) -> int:
        pass

    @property
    @abstractmethod    
    def isJumpScanning(self) -> int:
        pass


    @abstractmethod
    def clearWarning(self):
        pass

    @abstractmethod
    def setWarning(self, enable: (int, bool)):
        pass

    @abstractmethod
    def setSlideTableAlreadyScanned(self, level: int):
        pass

    @abstractmethod
    def waitForPauseRunning(self, waittimes: int = 30000):
        pass

    @abstractmethod
    def waitForExitRunning(self, waittimes: int = 30000):
        pass

    @abstractmethod
    def waitForRunning(self, waittimes: int = 1000):
        pass

    @abstractmethod
    def setScanningStatus(self, level: int):
        pass

    @abstractmethod
    def getScanningStatus(self) -> int:
        pass

    @property
    @abstractmethod
    def scanning_level(self) -> int:
        pass

    @abstractmethod
    def setScanningDateTime     (self, value: (Qt.QDateTime, datetime)):
        pass

    @abstractmethod
    def setStopScanningDateTime (self, value: (Qt.QDateTime, datetime)):
        pass

    @abstractmethod
    def setTrayTableSlide(self, chamber_number: int, row_number: int, tray_number: int, **args):
        pass

    """修改片仓扫描状态"""
    @abstractmethod
    def changedChamberScanningStatus(self, chamber_number: int, row_number: int, level: int):
        pass

    """是否可以取片"""

    @abstractmethod
    def isPickAvailable(self, chamber_number: int, row_number: int = 1) -> int:
        pass

    """是否可以放片"""

    @abstractmethod
    def isPlaceAvailable(self, chamber_number: int, row_number: int = 1) -> int:
        pass

    """修改当前扫描状态"""

    @abstractmethod
    def changedScanningStatus(self, chamber_number: int, row_number: int, tray_number: int, level: int, codestring: str = None, objective: int = None):
        pass

    @abstractmethod
    def changedTrayScanningStatus(self, chamber_number: int, level: int, objective: int = None):
        pass

    @abstractmethod
    def result_chamber_status(self) -> list[dict[str, object]]:
        pass

    def result_start_scanningstatus(self) -> dict[str, object]:
        if not self.hasScanningDateTime:
            self.setScanningDateTime(Qt.QDateTime.currentDateTime())
        if self.hasStopScanningDateTime:
            self.setStopScanningDateTime(None)
        return self.scanningstatus()

    def result_finish_scanningstatus(self) -> dict[str, object]:
        if self.hasScanningDateTime:
            self.setScanningDateTime(None)
        if not self.hasStopScanningDateTime:
            self.setStopScanningDateTime(Qt.QDateTime.currentDateTime())
        return self.scanningstatus()

    @abstractmethod
    def scanningstatus(self) -> dict[str, object]:
        pass

    @abstractmethod
    def pushtemplate(self) -> dict[str, object]:
        pass
    __slots__ = (
        'ID'                      ,
        'ObjectiveLevel'          ,
        'ChamberGroupNumber'      ,
        'ChamberRowNumber'        ,
        'TrayNumber'              ,
        'RowNumber'               ,
        'ColNumber'               ,
        'ScanStatus'              ,
        'RunStatus'               ,
        'Template_ID'             ,
        'PreferredClassifier_ID'  ,
        'PreviewClassifier_ID'    ,
        'CollectClassifier_ID'    ,
        'User_ID'                 ,
        'OperatingStatus_ID'      ,
        'CodeString'              ,
        'ScanningDateTime'        ,
        'StopScanningDateTime'    ,
        'Microscope'              ,
        'WebSocket'               ,
        'HitBot'                  ,
        'AxisX'                   ,
        'AxisY'                   ,
        'TrayZ'                   ,
        'TrayH'                   ,
        'Camera'                  ,
        'ColorCamera'             ,
        'ScanCode'                ,
        'Oil'                     ,
        'Chamber'                 ,
        'Buzzer'                  ,
        'Door'                    ,
        'TrayStatus'              ,
        'AutoScanMode'            ,
        'JumpScanning'            ,
    )



    __types__ = (
        int        ,
        int        ,
        int        ,
        int        ,
        int        ,
        int        ,
        int        ,
        int        ,
        int        ,
        int        ,
        int        ,
        int        ,
        int        ,
        int        ,
        int        ,
        str        ,
        datetime   ,
        datetime   ,
        int        ,
        int        ,
        int        ,
        int        ,
        int        ,
        int        ,
        int        ,
        int        ,
        int        ,
        int        ,
        int        ,
        int        ,
        int        ,
        int        ,
        int        ,
        int        ,
        int        ,
    )


    @property
    def GetID                      (self) -> int        :
        return None if not self.hasID                       else self.ID

    @property
    def GetObjectiveLevel          (self) -> int        :
        return None if not self.hasObjectiveLevel           else self.ObjectiveLevel

    @property
    def GetChamberGroupNumber      (self) -> int        :
        return None if not self.hasChamberGroupNumber       else self.ChamberGroupNumber

    @property
    def GetChamberRowNumber        (self) -> int        :
        return None if not self.hasChamberRowNumber         else self.ChamberRowNumber

    @property
    def GetTrayNumber              (self) -> int        :
        return None if not self.hasTrayNumber               else self.TrayNumber

    @property
    def GetRowNumber               (self) -> int        :
        return None if not self.hasRowNumber                else self.RowNumber

    @property
    def GetColNumber               (self) -> int        :
        return None if not self.hasColNumber                else self.ColNumber

    @property
    def GetScanStatus              (self) -> int        :
        return None if not self.hasScanStatus               else self.ScanStatus

    @property
    def GetRunStatus               (self) -> int        :
        return None if not self.hasRunStatus                else self.RunStatus

    @property
    def GetTemplate_ID             (self) -> int        :
        return None if not self.hasTemplate_ID              else self.Template_ID

    @property
    def GetPreferredClassifier_ID  (self) -> int        :
        return None if not self.hasPreferredClassifier_ID   else self.PreferredClassifier_ID

    @property
    def GetPreviewClassifier_ID    (self) -> int        :
        return None if not self.hasPreviewClassifier_ID     else self.PreviewClassifier_ID

    @property
    def GetCollectClassifier_ID    (self) -> int        :
        return None if not self.hasCollectClassifier_ID     else self.CollectClassifier_ID

    @property
    def GetUser_ID                 (self) -> int        :
        return None if not self.hasUser_ID                  else self.User_ID

    @property
    def GetOperatingStatus_ID      (self) -> int        :
        return None if not self.hasOperatingStatus_ID       else self.OperatingStatus_ID

    @property
    def GetCodeString              (self) -> str        :
        return None if not self.hasCodeString               else self.CodeString

    @property
    def GetScanningDateTime        (self) -> datetime   :
        return None if not self.hasScanningDateTime         else self.ScanningDateTime

    @property
    def GetStopScanningDateTime    (self) -> datetime   :
        return None if not self.hasStopScanningDateTime     else self.StopScanningDateTime

    @property
    def GetMicroscope              (self) -> int        :
        return None if not self.hasMicroscope               else self.Microscope

    @property
    def GetWebSocket               (self) -> int        :
        return None if not self.hasWebSocket                else self.WebSocket

    @property
    def GetHitBot                  (self) -> int        :
        return None if not self.hasHitBot                   else self.HitBot

    @property
    def GetAxisX                   (self) -> int        :
        return None if not self.hasAxisX                    else self.AxisX

    @property
    def GetAxisY                   (self) -> int        :
        return None if not self.hasAxisY                    else self.AxisY

    @property
    def GetTrayZ                   (self) -> int        :
        return None if not self.hasTrayZ                    else self.TrayZ

    @property
    def GetTrayH                   (self) -> int        :
        return None if not self.hasTrayH                    else self.TrayH

    @property
    def GetCamera                  (self) -> int        :
        return None if not self.hasCamera                   else self.Camera

    @property
    def GetColorCamera             (self) -> int        :
        return None if not self.hasColorCamera              else self.ColorCamera

    @property
    def GetScanCode                (self) -> int        :
        return None if not self.hasScanCode                 else self.ScanCode

    @property
    def GetOil                     (self) -> int        :
        return None if not self.hasOil                      else self.Oil

    @property
    def GetChamber                 (self) -> int        :
        return None if not self.hasChamber                  else self.Chamber

    @property
    def GetBuzzer                  (self) -> int        :
        return None if not self.hasBuzzer                   else self.Buzzer

    @property
    def GetDoor                    (self) -> int        :
        return None if not self.hasDoor                     else self.Door

    @property
    def GetTrayStatus              (self) -> int        :
        return None if not self.hasTrayStatus               else self.TrayStatus

    @property
    def GetAutoScanMode            (self) -> int        :
        return None if not self.hasAutoScanMode             else self.AutoScanMode

    @property
    def GetJumpScanning            (self) -> int        :
        return None if not self.hasJumpScanning             else self.JumpScanning

    @property
    def GetCameraModel(self):
        return None if not self.hasCameraModel else self.CameraModel

    @property
    def hasID                      (self) -> bool:
        return hasattr(self, 'ID'                      ) and isinstance(self.ID                      , int        )

    @property
    def hasObjectiveLevel          (self) -> bool:
        return hasattr(self, 'ObjectiveLevel'          ) and isinstance(self.ObjectiveLevel          , int        )

    @property
    def hasChamberGroupNumber      (self) -> bool:
        return hasattr(self, 'ChamberGroupNumber'      ) and isinstance(self.ChamberGroupNumber      , int        )

    @property
    def hasChamberRowNumber        (self) -> bool:
        return hasattr(self, 'ChamberRowNumber'        ) and isinstance(self.ChamberRowNumber        , int        )

    @property
    def hasTrayNumber              (self) -> bool:
        return hasattr(self, 'TrayNumber'              ) and isinstance(self.TrayNumber              , int        )

    @property
    def hasRowNumber               (self) -> bool:
        return hasattr(self, 'RowNumber'               ) and isinstance(self.RowNumber               , int        )

    @property
    def hasColNumber               (self) -> bool:
        return hasattr(self, 'ColNumber'               ) and isinstance(self.ColNumber               , int        )

    @property
    def hasScanStatus              (self) -> bool:
        return hasattr(self, 'ScanStatus'              ) and isinstance(self.ScanStatus              , int        )

    @property
    def hasRunStatus               (self) -> bool:
        return hasattr(self, 'RunStatus'               ) and isinstance(self.RunStatus               , int        )

    @property
    def hasTemplate_ID             (self) -> bool:
        return hasattr(self, 'Template_ID'             ) and isinstance(self.Template_ID             , int        )

    @property
    def hasPreferredClassifier_ID  (self) -> bool:
        return hasattr(self, 'PreferredClassifier_ID'  ) and isinstance(self.PreferredClassifier_ID  , int        )

    @property
    def hasPreviewClassifier_ID    (self) -> bool:
        return hasattr(self, 'PreviewClassifier_ID'    ) and isinstance(self.PreviewClassifier_ID    , int        )

    @property
    def hasCollectClassifier_ID    (self) -> bool:
        return hasattr(self, 'CollectClassifier_ID'    ) and isinstance(self.CollectClassifier_ID    , int        )

    @property
    def hasUser_ID                 (self) -> bool:
        return hasattr(self, 'User_ID'                 ) and isinstance(self.User_ID                 , int        )

    @property
    def hasOperatingStatus_ID      (self) -> bool:
        return hasattr(self, 'OperatingStatus_ID'      ) and isinstance(self.OperatingStatus_ID      , int        )

    @property
    def hasCodeString              (self) -> bool:
        return hasattr(self, 'CodeString'              ) and isinstance(self.CodeString              , str        )

    @property
    def hasScanningDateTime        (self) -> bool:
        return hasattr(self, 'ScanningDateTime'        ) and isinstance(self.ScanningDateTime        , (datetime, Qt.QDateTime)   )

    @property
    def hasStopScanningDateTime    (self) -> bool:
        return hasattr(self, 'StopScanningDateTime'    ) and isinstance(self.StopScanningDateTime    , (datetime, Qt.QDateTime)   )

    @property
    def hasMicroscope              (self) -> bool:
        return hasattr(self, 'Microscope'              ) and isinstance(self.Microscope              , int        )

    @property
    def hasWebSocket               (self) -> bool:
        return hasattr(self, 'WebSocket'               ) and isinstance(self.WebSocket               , int        )

    @property
    def hasHitBot                  (self) -> bool:
        return hasattr(self, 'HitBot'                  ) and isinstance(self.HitBot                  , int        )

    @property
    def hasAxisX                   (self) -> bool:
        return hasattr(self, 'AxisX'                   ) and isinstance(self.AxisX                   , int        )

    @property
    def hasAxisY                   (self) -> bool:
        return hasattr(self, 'AxisY'                   ) and isinstance(self.AxisY                   , int        )

    @property
    def hasTrayZ                   (self) -> bool:
        return hasattr(self, 'TrayZ'                   ) and isinstance(self.TrayZ                   , int        )

    @property
    def hasTrayH                   (self) -> bool:
        return hasattr(self, 'TrayH'                   ) and isinstance(self.TrayH                   , int        )

    @property
    def hasCamera                  (self) -> bool:
        return hasattr(self, 'Camera'                  ) and isinstance(self.Camera                  , int        )

    @property
    def hasColorCamera             (self) -> bool:
        return hasattr(self, 'ColorCamera'             ) and isinstance(self.ColorCamera             , int        )

    @property
    def hasScanCode                (self) -> bool:
        return hasattr(self, 'ScanCode'                ) and isinstance(self.ScanCode                , int        )

    @property
    def hasOil                     (self) -> bool:
        return hasattr(self, 'Oil'                     ) and isinstance(self.Oil                     , int        )

    @property
    def hasChamber                 (self) -> bool:
        return hasattr(self, 'Chamber'                 ) and isinstance(self.Chamber                 , int        )

    @property
    def hasBuzzer                  (self) -> bool:
        return hasattr(self, 'Buzzer'                  ) and isinstance(self.Buzzer                  , int        )

    @property
    def hasDoor                    (self) -> bool:
        return hasattr(self, 'Door'                    ) and isinstance(self.Door                    , int        )

    @property
    def hasTrayStatus              (self) -> bool:
        return hasattr(self, 'TrayStatus'              ) and isinstance(self.TrayStatus              , int        )

    @property
    def hasAutoScanMode            (self) -> bool:
        return hasattr(self, 'AutoScanMode'            ) and isinstance(self.AutoScanMode            , int        )

    @property
    def hasJumpScanning            (self) -> bool:
        return hasattr(self, 'JumpScanning'            ) and isinstance(self.JumpScanning            , int        )

    @property
    def hasCameraModel             (self) -> bool:
        return hasattr(self, 'CameraModel') and self.CameraModel is not None

    @property
    def hasFocusingStatus(self) -> bool:
        return hasattr(self, 'FocusingStatus') and isinstance(self.FocusingStatus, (bool, int))