#!D:\IDE\Anaconda3\envs\Microscope_Scan python
# -*- coding: UTF-8 -*-
"""
 @Author: Administrator
 @FileName: ScanStatusLevel.py
 @DateTime: 2025/4/28 14:29
 @SoftWare: PyCharm
 @Author  ：xsh
"""
class ScanStatusLevel(int):
    Default_Status                  = 0
    ReadyScanning_Status            = 1
    Check_Status                    = 2
    PickChamberSlide_Status         = 3
    SlideScanCode_Status            = 4
    DropTraySlide_Status            = 5
    Low_First_Focus_Status          = 6
    Low_Second_Focus_Status         = 7
    Low_Three_Focus_Status          = 8
    Low_Four_Focus_Status           = 9
    LowScanning_Status              = 10
    LowCell_Status                  = 11
    OilDripping_Status              = 12
    Hig_First_Focus_Status          = 13
    Hig_Second_Focus_Status         = 14
    Hig_Three_Focus_Status          = 15
    Hig_Four_Focus_Status           = 16
    HigCheckCenter_Status           = 17
    MoveToKaryotypeCenter_Status    = 18
    HigKaryotypePicture_Status      = 19
    CellScanning_Status             = 20
    PickTraySlide_Status            = 21
    DropChamberSlide_Status         = 22
    Low_Identification_Cell_Status  = 23
    ScanningWarning_Status          = 24            # '平扫玻片错误'
    ScanComplete_Status             = 25            #
    ChamberBrokenDrop_Status        = 26            #
    FocusingFinish_Status           = 27            #
    FocusingWarning_Status          = 28            # '玻片定焦错误'
    CellEmpty_Status                = 29            # '细胞数量为空'
    OilWarning_status               = 30            # '玻片抹油错误'
    HigFocusingWarning_Status       = 31            # '高倍定焦错误'
    LowModelWarning_Status          = 32            # '识别模型错误'
    HigModelWarning_Status          = 33            # '识别模型错误'
    ScanTemplateWarning_Status      = 34            # '扫描模板错误'
    ModelWarning_Status             = 35            # '扫描模块错误'
    HitBotWarning_Status            = 36
    JumpScanning_Status             = 37
    FinishScanning_Status           = 38
    Check_Warning_Status            = 39
    PickChamberSlide_Warning_Status = 40
    SlideScanCode_Warning_Status    = 41
    DropTraySlide_Warning_Status    = 42
    PickTraySlide_Warning_Status    = 43
    DropChamberSlide_Warning_Status = 44
    @classmethod
    def all(cls) -> list[int]:
        return [
            cls.Default_Status                      ,
            cls.ReadyScanning_Status                ,
            cls.Check_Status                        ,
            cls.PickChamberSlide_Status             ,
            cls.SlideScanCode_Status                ,
            cls.DropTraySlide_Status                ,
            cls.Low_First_Focus_Status              ,
            cls.Low_Second_Focus_Status             ,
            cls.Low_Three_Focus_Status              ,
            cls.Low_Four_Focus_Status               ,
            cls.LowScanning_Status                  ,
            cls.LowCell_Status                      ,
            cls.OilDripping_Status                  ,
            cls.Hig_First_Focus_Status              ,
            cls.Hig_Second_Focus_Status             ,
            cls.Hig_Three_Focus_Status              ,
            cls.Hig_Four_Focus_Status               ,
            cls.HigCheckCenter_Status               ,
            cls.MoveToKaryotypeCenter_Status        ,
            cls.HigKaryotypePicture_Status          ,
            cls.CellScanning_Status                 ,
            cls.PickTraySlide_Status                ,
            cls.DropChamberSlide_Status             ,
            cls.Low_Identification_Cell_Status      ,
            cls.ScanningWarning_Status              ,
            cls.ScanComplete_Status                 ,
            cls.ChamberBrokenDrop_Status            ,
            cls.FocusingFinish_Status               ,
            cls.FocusingWarning_Status              ,
            cls.CellEmpty_Status                    ,
            cls.OilWarning_status                   ,
            cls.HigFocusingWarning_Status           ,
            cls.LowModelWarning_Status              ,
            cls.HigModelWarning_Status              ,
            cls.ScanTemplateWarning_Status          ,
            cls.ModelWarning_Status                 ,
            cls.HitBotWarning_Status                ,
            cls.JumpScanning_Status                 ,
            cls.FinishScanning_Status               ,
            cls.Check_Warning_Status                ,
            cls.PickChamberSlide_Warning_Status     ,
            cls.SlideScanCode_Warning_Status        ,
            cls.DropTraySlide_Warning_Status        ,
            cls.PickTraySlide_Warning_Status        ,
            cls.DropChamberSlide_Warning_Status     ,
        ]

    @classmethod
    def isFinishScanning(cls, level: int) -> bool:
        return isinstance(level, int) and level in [cls.FinishScanning_Status, cls.Default_Status]

    @classmethod
    def isReadyScanning(cls, level: int) -> bool:
        return isinstance(level, int) and level in [cls.ReadyScanning_Status]

    @classmethod
    def isLowFocusing(cls, level: int) -> bool:
        return level in (cls.Low_First_Focus_Status , cls.Low_Second_Focus_Status, cls.Low_Three_Focus_Status , cls.Low_Four_Focus_Status)

    @classmethod
    def isLowScanning(cls, level: int) -> bool:
        return level == cls.LowScanning_Status

    @classmethod
    def isScanWarning(cls, level: int) -> bool:
        return isinstance(level, int) and level in [cls.ScanningWarning_Status      ,
                                                    cls.FocusingWarning_Status      ,
                                                    cls.CellEmpty_Status            ,
                                                    cls.OilWarning_status           ,
                                                    cls.HigFocusingWarning_Status   ,
                                                    cls.LowModelWarning_Status      ,
                                                    cls.HigModelWarning_Status      ,
                                                    cls.ScanTemplateWarning_Status  ,
                                                    cls.ModelWarning_Status         ,
                                                    ]

    @classmethod
    def isJumpScanning(cls, level: int) -> bool:
        return isinstance(level, int) and level in [cls.JumpScanning_Status]

    @classmethod
    def isHitBotWarning(cls, level: int) -> bool:
        return isinstance(level, int) and level in [cls.HitBotWarning_Status            ,
                                                    cls.Check_Warning_Status            ,
                                                    cls.PickChamberSlide_Warning_Status ,
                                                    cls.SlideScanCode_Warning_Status    ,
                                                    cls.DropTraySlide_Warning_Status    ,
                                                    cls.PickTraySlide_Warning_Status    ,
                                                    cls.DropChamberSlide_Warning_Status ,
                                                    ]
    @classmethod
    def isHitBotAlarm(cls, level: int) -> bool:
        return isinstance(level, int) and level in [cls.HitBotWarning_Status]

    @classmethod
    def isCheckWarning            (cls, level: int) -> bool:
        return isinstance(level, int) and level in [cls.Check_Warning_Status            ]

    @classmethod
    def isPickChamberSlideWarning (cls, level: int) -> bool:
        return isinstance(level, int) and level in [cls.PickChamberSlide_Warning_Status ]

    @classmethod
    def isSlideScanCodeWarning    (cls, level: int) -> bool:
        return isinstance(level, int) and level in [cls.SlideScanCode_Warning_Status    ]

    @classmethod
    def isDropTraySlideWarning    (cls, level: int) -> bool:
        return isinstance(level, int) and level in [cls.DropTraySlide_Warning_Status    ]

    @classmethod
    def isPickTraySlideWarning    (cls, level: int) -> bool:
        return isinstance(level, int) and level in [cls.PickTraySlide_Warning_Status    ]

    @classmethod
    def isDropChamberSlideWarning (cls, level: int) -> bool:
        return isinstance(level, int) and level in [cls.DropChamberSlide_Warning_Status ]

    @classmethod
    def isScanComplete(cls, level: int) -> bool:
        return isinstance(level, int) and level in [cls.ScanComplete_Status]

    @classmethod
    def isLowCell(cls, level: int) -> bool:
        return level == cls.LowCell_Status

    @classmethod
    def isHigFocusing(cls, level: int):
        return level in (cls.Hig_First_Focus_Status  ,cls.Hig_Second_Focus_Status ,cls.Hig_Three_Focus_Status  ,cls.Hig_Four_Focus_Status   )

    @classmethod
    def isLowFirstFocusing(cls, level: int):
        return level in (cls.Low_First_Focus_Status  ,   )

    @classmethod
    def isHigFirstFocusing(cls, level: int):
        return level in (cls.Hig_First_Focus_Status,)

    @classmethod
    def isHigFocusing(cls, level: int) -> bool:
        return  isinstance(level, int) and level in [cls.Hig_First_Focus_Status, cls.Hig_Second_Focus_Status, cls.Hig_Three_Focus_Status, cls.Hig_Four_Focus_Status]

    @classmethod
    def isOtherHigFocusing(cls, level: int):
        return level in (cls.Hig_Three_Focus_Status, cls.Hig_Four_Focus_Status)

    @classmethod
    def isFirstLowFocusing(cls, level: int):
        return level in (cls.Low_First_Focus_Status,cls.Hig_Second_Focus_Status, )

    @classmethod
    def isOtherLowFocusing(cls, level: int):
        return level in (cls.Low_Second_Focus_Status, cls.Low_Three_Focus_Status, cls.Low_Four_Focus_Status)
    @classmethod
    def isFirstHigFocusing(cls, level: int):
        return level in (cls.Hig_First_Focus_Status,)

    @classmethod
    def isHigKaryotype(cls, level: int) -> bool:
        return level == cls .HigKaryotypePicture_Status or level == cls.CellScanning_Status

    @classmethod
    def isFirstFocusing(cls, level: int) -> bool:
        return level == cls.Low_First_Focus_Status or level == cls.Hig_First_Focus_Status


    @classmethod
    def isOilDripping(cls, level: int) -> bool:
        return level == cls.OilDripping_Status

    @classmethod
    def isMoveToKaryotypeCenter(cls, level: int) -> bool:
        return level == cls.MoveToKaryotypeCenter_Status

    @classmethod
    def isDefaultStatus(cls, level: int) -> bool:
        return level == cls.Default_Status

    @classmethod
    def isCheckStatus(cls, level: int) -> bool:
        return level == cls.Check_Status

    @classmethod
    def isPickChamberSlideStatus(cls, level: int) -> bool:
        return level == cls.PickChamberSlide_Status

    @classmethod
    def isSlideScanCodeStatus(cls, level: int) -> bool:
        return level == cls.SlideScanCode_Status

    @classmethod
    def isDropTraySlideStatus(cls, level: int) -> bool:
        return level == cls.DropTraySlide_Status

    @classmethod
    def isPickTraySlideStatus(cls, level: int) -> bool:
        return level == cls.PickTraySlide_Status
    @classmethod
    def isDropChamberSlideStatus(cls, level: int) -> bool:
        return level == cls.DropChamberSlide_Status

    @classmethod
    def isLowIdentificationCell(cls, level: int) -> bool:
        return level == cls.Low_Identification_Cell_Status

