#!D:\IDE\Anaconda3\envs\Microscope_Scan python
# -*- coding: UTF-8 -*-
"""
 @Author: Administrator
 @FileName: ReaderInterface.py
 @DateTime: 2025/4/8 0:28
 @SoftWare: PyCharm
 @Author  ：xsh
"""
from PyQt5 import Qt
from AppInterfaces.GlobalInterface import GlobalInterface
from AppInterfaces.ImplInterface import ImplInterface
from abc import abstractmethod
class ReaderInterface(GlobalInterface):
    Manager: ImplInterface

    @property
    @abstractmethod
    def isAvailable(self) -> bool:
        raise Exception('Interface Instance error')


    @property
    @abstractmethod
    def hasManager(self) -> bool:
        raise Exception('Interface Instance error')

    @property
    @abstractmethod
    def manager(self) -> ImplInterface:
        raise Exception('Interface Instance error')


    @property
    @abstractmethod
    def isValid(self) -> bool:
        raise Exception('Interface Instance error')

    @property
    @abstractmethod
    def IsOpen(self) -> bool:
        raise Exception('Interface Instance error')

    @abstractmethod
    def Open(self, **args) -> int:
        raise Exception('Interface Instance error')

    @abstractmethod
    def Close(self, **args) -> int:
        raise Exception('Interface Instance error')

    @abstractmethod
    def initManager(self, **args):
        raise Exception('Interface Instance error')

    @abstractmethod
    def deleManager(self, **args):
        raise Exception('Interface Instance error')

    @abstractmethod
    def Transmit(self, **args) -> int:
        raise Exception('Interface Instance error')

    @abstractmethod
    def Received(self, **args) -> int:
        raise Exception('Interface Instance error')

    @abstractmethod
    def Send(self, **args) -> int:
        raise Exception('Interface Instance error')

    @abstractmethod
    def Read(self, **args) -> int:
        raise Exception('Interface Instance error')

    @abstractmethod
    def WaitDone(self, **args) -> int:
        raise Exception('Interface Instance error')

    def ReOpen(self, timeOut: int = 1000, **args) -> int:
        self.Close(timeOut=timeOut, **args)
        return self.Open(timeOut=timeOut, **args)

