#!D:/IDE/anaconda3/envs/Microscope_Scan python
# -*- coding: UTF-8 -*-
"""
@FileName：FocusingContext.py
@Description：
@Author：XSH
@Time：2025/12/20 18:22
@Department：研发部
@Copyright：©2025 乐辰生物
"""
import sys
from PyQt5                              import Qt
from AppInterfaces.ModelInterface       import ContextModelInterface
from AppCore.Levels                     import *
from AppUtils.utils                     import *
from AppCore.Requests                   import *


class FocusingContext(ContextModelInterface):
    Information    : str            #
    Level          : int            #
    ZPosition      : float          #
    XPosition      : float          #
    YPosition      : float          #
    ExposureTime   : float          #
    OffsetZ        : float          #
    OffsetX        : float          #
    OffsetY        : float          #
    IsCalibrate    : int            #

    Context         : object
    Objective       : object
    Offset          : object
    Camera          : object
    Anointing       : object
    def __init__(self, **args):
        super(FocusingContext, self).__init__()
        self.initialization("FocusingContext")
        self.initParameter(**args)

    def initValue(self):
        super(FocusingContext, self).initValue()
        self.Information     = None
        self.Level           = None
        self.ZPosition       = None
        self.XPosition       = None
        self.YPosition       = None
        self.ExposureTime    = None
        self.OffsetZ         = None
        self.OffsetX         = None
        self.OffsetY         = None
        self.IsCalibrate     = None







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

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

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

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

    @property
    def hasLevel(self) -> bool:
        return self.has_field('Level'         , int              )

    @property
    def hasInformation    (self) -> bool:
        return self.has_field('Information'   , str             )

    @property
    def hasZPosition      (self) -> bool:
        return self.has_field('ZPosition'     , (int, float)    )

    @property
    def hasExposureTime   (self) -> bool:
        return self.has_field('ExposureTime'  , (int, float)    )

    @property
    def hasOffsetZ        (self) -> bool:
        return self.has_field('OffsetZ'       , (int, float)    )

    @property
    def hasOffsetX        (self) -> bool:
        return self.has_field('OffsetX'       , (int, float)    )

    @property
    def hasOffsetY        (self) -> bool:
        return self.has_field('OffsetY'       , (int, float)    )

    @property
    def hasIsCalibrate(self) -> bool:
        return self.has_field('IsCalibrate'   , (int, bool)     )

    @property
    def hasZPosition(self) -> bool:
        return self.has_field('ZPosition', (int, float))

    @property
    def hasXPosition(self) -> bool:
        return self.has_field('XPosition', (int, float))

    @property
    def hasYPosition(self) -> bool:
        return self.has_field('YPosition', (int, float))


    __slots__ = (
        'Information'   ,
        'Level'         ,
        'ZPosition'     ,
        'XPosition'     ,
        'YPosition'     ,
        'ExposureTime'  ,
        'OffsetZ'       ,
        'OffsetX'       ,
        'OffsetY'       ,
        'IsCalibrate'   ,
    )
    __types__ = (
        str             ,
        int             ,
        float           ,
        float           ,
        float           ,
        float           ,
        float           ,
        float           ,
        float           ,
        int             ,
    )