#!D:/IDE/anaconda3/envs/Microscope_Scan python
# -*- coding: UTF-8 -*-
"""
@FileName：LMicroscopeInterface.py
@Description：
@Author：XSH
@Time：2025/11/11 12:55
@Department：研发部
@Copyright：©2025 乐辰生物
"""
import clr
import socket
import gc
import struct
from abc import abstractmethod
from clr_loader.types                                       import Assembly, ClrFunction    #
from AppContexts.Contexts                                   import LeiCaContext             #
from AppInterfaces.AppImplInterfaces.MicroscopeInterface    import MicroscopeInterfaceBase  #


class LMicroscopeInterface(MicroscopeInterfaceBase):
    Parameter   :  LeiCaContext                 # 显微镜参数类
    Manager     : 'IMicroscope'                 # 显微镜管理器
    Controller  : "IMicController"              # 显微镜控制器

    @property
    def hasParameter(self) -> bool:
        return hasattr(self, 'Parameter') and isinstance(self.Parameter, LeiCaContext)

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

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


    @property
    def manager(self) -> 'IMicroscope':
        return self.Manager if self.hasManager else None

    @property
    def controller(self) -> 'IMicController':
        return self.Controller if self.hasController else None


    @property
    def parameter(self) -> LeiCaContext:
        return self.Parameter if self.hasParameter else None

    def setParameter(self, value):
        self.Parameter = value if isinstance(value, LeiCaContext) else None


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