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

from datetime import timedelta
from typing import TYPE_CHECKING, Any, List

from sila2.server import MetadataDict, ObservableCommandInstance

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

if TYPE_CHECKING:
    from ..server import Server


class ModuleThermocyclerImpl(ModuleThermocyclerBase):
    def __init__(self, parent_server: Server) -> None:
        super().__init__(parent_server=parent_server)

        # Default lifetime of observable command instances. Possible values:
        # None: Command instance is valid and stored in memory until server shutdown
        # datetime.timedelta: Command instance is deleted after this duration, can be increased during command runtime
        self.CurrentBlockTemperature_default_lifetime_of_execution = timedelta(minutes=30)
        self.CurrentLidTemperature_default_lifetime_of_execution = timedelta(minutes=30)
        self.CurrentLidTemperatureStatus_default_lifetime_of_execution = timedelta(minutes=30)
        self.CurrentBlockTemperatureStatus_default_lifetime_of_execution = timedelta(minutes=30)
        self.CurrentLidPosition_default_lifetime_of_execution = timedelta(minutes=30)

    def Deactivate(self, *, metadata: MetadataDict) -> Deactivate_Responses:
        raise NotImplementedError  # TODO

    def DeactivateBlockHeater(self, *, metadata: MetadataDict) -> DeactivateBlockHeater_Responses:
        raise NotImplementedError  # TODO

    def DeactivateLidHeater(self, *, metadata: MetadataDict) -> DeactivateLidHeater_Responses:
        raise NotImplementedError  # TODO

    def CloseLid(self, *, metadata: MetadataDict) -> CloseLid_Responses:
        raise NotImplementedError  # TODO

    def OpenLid(self, *, metadata: MetadataDict) -> OpenLid_Responses:
        raise NotImplementedError  # TODO

    def SetLidTemperature(self, Temperature: float, *, metadata: MetadataDict) -> SetLidTemperature_Responses:
        raise NotImplementedError  # TODO

    def SetBlockTemperature(
        self,
        Temperature: float,
        HoldTimeMinutes: float,
        HoldTimeSeconds: float,
        BlockMaxVolume: float,
        *,
        metadata: MetadataDict,
    ) -> SetBlockTemperature_Responses:
        raise NotImplementedError  # TODO

    def ExecuteProfile(
        self, Steps: List[Any], Repetitions: int, BlockMaxVolume: float, *, metadata: MetadataDict
    ) -> ExecuteProfile_Responses:
        raise NotImplementedError  # TODO

    def CurrentBlockTemperature(
        self, *, metadata: MetadataDict, instance: ObservableCommandInstance
    ) -> CurrentBlockTemperature_Responses:
        # set execution status from `waiting` to `running`
        instance.begin_execution()

        raise NotImplementedError  # TODO

    def CurrentLidTemperature(
        self, *, metadata: MetadataDict, instance: ObservableCommandInstance
    ) -> CurrentLidTemperature_Responses:
        # set execution status from `waiting` to `running`
        instance.begin_execution()

        raise NotImplementedError  # TODO

    def CurrentLidTemperatureStatus(
        self, *, metadata: MetadataDict, instance: ObservableCommandInstance
    ) -> CurrentLidTemperatureStatus_Responses:
        # set execution status from `waiting` to `running`
        instance.begin_execution()

        raise NotImplementedError  # TODO

    def CurrentBlockTemperatureStatus(
        self, *, metadata: MetadataDict, instance: ObservableCommandInstance
    ) -> CurrentBlockTemperatureStatus_Responses:
        # set execution status from `waiting` to `running`
        instance.begin_execution()

        raise NotImplementedError  # TODO

    def CurrentLidPosition(
        self, *, metadata: MetadataDict, instance: ObservableCommandInstance
    ) -> CurrentLidPosition_Responses:
        # set execution status from `waiting` to `running`
        instance.begin_execution()

        raise NotImplementedError  # TODO
