# Generated by sila2.code_generator; sila2.__version__: 0.12.2
from __future__ import annotations

from abc import ABC, abstractmethod
from datetime import timedelta
from typing import TYPE_CHECKING, Any, List, Optional

from sila2.server import FeatureImplementationBase, MetadataDict, ObservableCommandInstance

from .modulethermocycler_types import (
    CloseLid_Responses,
    CurrentBlockTemperature_Responses,
    CurrentBlockTemperatureStatus_Responses,
    CurrentLidPosition_Responses,
    CurrentLidTemperature_Responses,
    CurrentLidTemperatureStatus_Responses,
    Deactivate_Responses,
    DeactivateBlockHeater_Responses,
    DeactivateLidHeater_Responses,
    ExecuteProfile_Responses,
    OpenLid_Responses,
    SetBlockTemperature_Responses,
    SetLidTemperature_Responses,
)

if TYPE_CHECKING:

    from ...server import Server


class ModuleThermocyclerBase(FeatureImplementationBase, ABC):
    parent_server: Server

    CurrentBlockTemperature_default_lifetime_of_execution: Optional[timedelta]

    CurrentLidTemperature_default_lifetime_of_execution: Optional[timedelta]

    CurrentLidTemperatureStatus_default_lifetime_of_execution: Optional[timedelta]

    CurrentBlockTemperatureStatus_default_lifetime_of_execution: Optional[timedelta]

    CurrentLidPosition_default_lifetime_of_execution: Optional[timedelta]

    def __init__(self, parent_server: Server):
        """

        This feature contains all methods used for the thermocycler

        """
        super().__init__(parent_server=parent_server)

        self.CurrentBlockTemperature_default_lifetime_of_execution = None
        self.CurrentLidTemperature_default_lifetime_of_execution = None
        self.CurrentLidTemperatureStatus_default_lifetime_of_execution = None
        self.CurrentBlockTemperatureStatus_default_lifetime_of_execution = None
        self.CurrentLidPosition_default_lifetime_of_execution = None

    @abstractmethod
    def Deactivate(self, *, metadata: MetadataDict) -> Deactivate_Responses:
        """
        Stops heating



        :param metadata: The SiLA Client Metadata attached to the call

        """

    @abstractmethod
    def DeactivateBlockHeater(self, *, metadata: MetadataDict) -> DeactivateBlockHeater_Responses:
        """
        Stops heating



        :param metadata: The SiLA Client Metadata attached to the call

        """

    @abstractmethod
    def DeactivateLidHeater(self, *, metadata: MetadataDict) -> DeactivateLidHeater_Responses:
        """
        Stops heating



        :param metadata: The SiLA Client Metadata attached to the call

        """

    @abstractmethod
    def CloseLid(self, *, metadata: MetadataDict) -> CloseLid_Responses:
        """
        Closes the absorbance plate lid



        :param metadata: The SiLA Client Metadata attached to the call

        """

    @abstractmethod
    def OpenLid(self, *, metadata: MetadataDict) -> OpenLid_Responses:
        """
        Opens the absorbance plate lid



        :param metadata: The SiLA Client Metadata attached to the call

        """

    @abstractmethod
    def SetLidTemperature(self, Temperature: float, *, metadata: MetadataDict) -> SetLidTemperature_Responses:
        """

            Set the lid target temperature and waits for temperature to be reached.



        :param Temperature:
                A value between 37 and 110, representing the target temperature in °C.


        :param metadata: The SiLA Client Metadata attached to the call

        """

    @abstractmethod
    def SetBlockTemperature(
        self,
        Temperature: float,
        HoldTimeMinutes: float,
        HoldTimeSeconds: float,
        BlockMaxVolume: float,
        *,
        metadata: MetadataDict,
    ) -> SetBlockTemperature_Responses:
        """

            Set the block target temperature and waits for temperature to be reached.



        :param Temperature:
                A value between 4 and 99, representing the target temperature in °C.


        :param HoldTimeMinutes:
                The number of minutes to hold, after reaching temperature, before proceeding to the next command. Is added together with
                hold time seconds


        :param HoldTimeSeconds:
                The number of seconds to hold, after reaching temperature, before proceeding to the next command. Is added together with
                hold time minutes


        :param BlockMaxVolume:
                The greatest volume of liquid contained in any individual well of the loaded labware, in µL. If 0 is specified, the default is 25 µL.


        :param metadata: The SiLA Client Metadata attached to the call

        """

    @abstractmethod
    def ExecuteProfile(
        self, Steps: List[Any], Repetitions: int, BlockMaxVolume: float, *, metadata: MetadataDict
    ) -> ExecuteProfile_Responses:
        """
        Executes the thermocycler profile


        :param Steps: List of steps that make up a single cycle.

        :param Repetitions:
                The amount of times the steps will be repeated


        :param BlockMaxVolume:
                The greatest volume of liquid contained in any individual well of the loaded labware, in µL. If 0 is specified, the default is 25 µL.


        :param metadata: The SiLA Client Metadata attached to the call

        """

    @abstractmethod
    def CurrentBlockTemperature(
        self, *, metadata: MetadataDict, instance: ObservableCommandInstance
    ) -> CurrentBlockTemperature_Responses:
        """
        Returns the current block temperature in Celsius



        :param metadata: The SiLA Client Metadata attached to the call
        :param instance: The command instance, enabling sending status updates to subscribed clients

        :return:

            - Temperature: Temperature in Celsius


        """

    @abstractmethod
    def CurrentLidTemperature(
        self, *, metadata: MetadataDict, instance: ObservableCommandInstance
    ) -> CurrentLidTemperature_Responses:
        """
        Returns the current lid temperature in Celsius



        :param metadata: The SiLA Client Metadata attached to the call
        :param instance: The command instance, enabling sending status updates to subscribed clients

        :return:

            - Temperature: Temperature in Celsius


        """

    @abstractmethod
    def CurrentLidTemperatureStatus(
        self, *, metadata: MetadataDict, instance: ObservableCommandInstance
    ) -> CurrentLidTemperatureStatus_Responses:
        """
        Returns the current lid temperature status



        :param metadata: The SiLA Client Metadata attached to the call
        :param instance: The command instance, enabling sending status updates to subscribed clients

        :return:

            - TemperatureStatus: The temperature status


        """

    @abstractmethod
    def CurrentBlockTemperatureStatus(
        self, *, metadata: MetadataDict, instance: ObservableCommandInstance
    ) -> CurrentBlockTemperatureStatus_Responses:
        """
        Returns the current block temperature status



        :param metadata: The SiLA Client Metadata attached to the call
        :param instance: The command instance, enabling sending status updates to subscribed clients

        :return:

            - TemperatureStatus: The temperature status


        """

    @abstractmethod
    def CurrentLidPosition(
        self, *, metadata: MetadataDict, instance: ObservableCommandInstance
    ) -> CurrentLidPosition_Responses:
        """
        Returns the current lid position


        :param metadata: The SiLA Client Metadata attached to the call
        :param instance: The command instance, enabling sending status updates to subscribed clients

        :return:

            - LidPosition: The lid position


        """
