# This file is autogenerated
import threading
import ctypes
import os
from pyautd3.native_methods.structs import Vector3, Quaternion, FfiFuture, LocalFfiFuture
from pyautd3.native_methods.autd3_driver import SamplingConfig, LoopBehavior, SyncMode, GainSTMMode, GPIOOut, GPIOIn, Segment, SilencerTarget, Drive
from enum import IntEnum


class DebugTypeTag(IntEnum):
    None_ = 0
    BaseSignal = 1
    Thermo = 2
    ForceFan = 3
    Sync = 4
    ModSegment = 5
    ModIdx = 6
    StmSegment = 7
    StmIdx = 8
    IsStmMode = 9
    PwmOut = 10
    Direct = 11
    SysTimeEq = 12

    @classmethod
    def from_param(cls, obj):
        return int(obj)  # pragma: no cover


class TransitionModeTag(IntEnum):
    SyncIdx = 0
    SysTime = 1
    Gpio = 2
    Ext = 3
    Immediate = 4
    None_ = 0xFF

    @classmethod
    def from_param(cls, obj):
        return int(obj)  # pragma: no cover


class DynWindow(IntEnum):
    Rectangular = 0
    Blackman = 1

    @classmethod
    def from_param(cls, obj):
        return int(obj)  # pragma: no cover


class AUTDStatus(IntEnum):
    AUTDTrue = 0
    AUTDFalse = 1
    AUTDErr = 2

    @classmethod
    def from_param(cls, obj):
        return int(obj)  # pragma: no cover


class TimerStrategyTag(IntEnum):
    Std = 0
    Spin = 1
    Async = 2
    Waitable = 3

    @classmethod
    def from_param(cls, obj):
        return int(obj)  # pragma: no cover


class SpinStrategyTag(IntEnum):
    YieldThread = 0
    SpinLoopHint = 1

    @classmethod
    def from_param(cls, obj):
        return int(obj)  # pragma: no cover


class ConstPtr(ctypes.Structure):
    _fields_ = [("_0", ctypes.c_void_p)]


class ControllerPtr(ctypes.Structure):
    _fields_ = [("_0", ctypes.c_void_p)]


class ControllerBuilderPtr(ctypes.Structure):
    _fields_ = [("_0", ctypes.c_void_p)]


class DatagramPtr(ctypes.Structure):
    _fields_ = [("_0", ctypes.c_void_p)]


class GainPtr(ctypes.Structure):
    _fields_ = [("_0", ctypes.c_void_p)]


class GeometryPtr(ctypes.Structure):
    _fields_ = [("_0", ctypes.c_void_p)]


class DevicePtr(ctypes.Structure):
    _fields_ = [("_0", ctypes.c_void_p)]


class TransducerPtr(ctypes.Structure):
    _fields_ = [("_0", ctypes.c_void_p)]


class LinkBuilderPtr(ctypes.Structure):
    _fields_ = [("_0", ctypes.c_void_p)]


class LinkPtr(ctypes.Structure):
    _fields_ = [("_0", ctypes.c_void_p)]


class SyncLinkBuilderPtr(ctypes.Structure):
    _fields_ = [("_0", ctypes.c_void_p)]


class ModulationPtr(ctypes.Structure):
    _fields_ = [("_0", ctypes.c_void_p)]


class RuntimePtr(ctypes.Structure):
    _fields_ = [("_0", ctypes.c_void_p)]


class HandlePtr(ctypes.Structure):
    _fields_ = [("_0", ctypes.c_void_p)]


class FociSTMPtr(ctypes.Structure):
    _fields_ = [("_0", ctypes.c_void_p)]


class GainSTMPtr(ctypes.Structure):
    _fields_ = [("_0", ctypes.c_void_p)]


class DebugTypeWrap(ctypes.Structure):
    _fields_ = [("ty", ctypes.c_uint8), ("value", ctypes.c_uint64)]

    def __eq__(self, other: object) -> bool:
        return isinstance(other, DebugTypeWrap) and self._fields_ == other._fields_  # pragma: no cover


class TransitionModeWrap(ctypes.Structure):
    _fields_ = [("tag", ctypes.c_uint8), ("value", ctypes.c_uint64)]

    def __eq__(self, other: object) -> bool:
        return isinstance(other, TransitionModeWrap) and self._fields_ == other._fields_  # pragma: no cover


class ResultDatagram(ctypes.Structure):
    _fields_ = [("result", DatagramPtr), ("err_len", ctypes.c_uint32), ("err", ctypes.c_void_p)]

    def __eq__(self, other: object) -> bool:
        return isinstance(other, ResultDatagram) and self._fields_ == other._fields_  # pragma: no cover


class ResultLinkBuilder(ctypes.Structure):
    _fields_ = [("result", LinkBuilderPtr), ("err_len", ctypes.c_uint32), ("err", ctypes.c_void_p)]

    def __eq__(self, other: object) -> bool:
        return isinstance(other, ResultLinkBuilder) and self._fields_ == other._fields_  # pragma: no cover


class ResultSyncLinkBuilder(ctypes.Structure):
    _fields_ = [("result", LinkBuilderPtr), ("err_len", ctypes.c_uint32), ("err", ctypes.c_void_p)]

    def __eq__(self, other: object) -> bool:
        return isinstance(other, ResultSyncLinkBuilder) and self._fields_ == other._fields_  # pragma: no cover


class ResultModulation(ctypes.Structure):
    _fields_ = [("result", ModulationPtr), ("err_len", ctypes.c_uint32), ("err", ctypes.c_void_p)]

    def __eq__(self, other: object) -> bool:
        return isinstance(other, ResultModulation) and self._fields_ == other._fields_  # pragma: no cover


class ResultFociSTM(ctypes.Structure):
    _fields_ = [("result", FociSTMPtr), ("err_len", ctypes.c_uint32), ("err", ctypes.c_void_p)]

    def __eq__(self, other: object) -> bool:
        return isinstance(other, ResultFociSTM) and self._fields_ == other._fields_  # pragma: no cover


class ResultGainSTM(ctypes.Structure):
    _fields_ = [("result", GainSTMPtr), ("err_len", ctypes.c_uint32), ("err", ctypes.c_void_p)]

    def __eq__(self, other: object) -> bool:
        return isinstance(other, ResultGainSTM) and self._fields_ == other._fields_  # pragma: no cover


class DynSincInterpolator(ctypes.Structure):
    _fields_ = [("window", ctypes.c_uint32), ("window_size", ctypes.c_uint32)]

    def __eq__(self, other: object) -> bool:
        return isinstance(other, DynSincInterpolator) and self._fields_ == other._fields_  # pragma: no cover


class ResultStatus(ctypes.Structure):
    _fields_ = [("result", ctypes.c_uint8), ("err_len", ctypes.c_uint32), ("err", ctypes.c_void_p)]

    def __eq__(self, other: object) -> bool:
        return isinstance(other, ResultStatus) and self._fields_ == other._fields_  # pragma: no cover


class ResultSamplingConfig(ctypes.Structure):
    _fields_ = [("result", SamplingConfig), ("err_len", ctypes.c_uint32), ("err", ctypes.c_void_p)]

    def __eq__(self, other: object) -> bool:
        return isinstance(other, ResultSamplingConfig) and self._fields_ == other._fields_  # pragma: no cover


class TimerStrategyWrap(ctypes.Structure):
    _fields_ = [("tag", ctypes.c_uint8), ("value", ctypes.c_uint32), ("spin_strategy", ctypes.c_uint8)]

    def __eq__(self, other: object) -> bool:
        return isinstance(other, TimerStrategyWrap) and self._fields_ == other._fields_  # pragma: no cover


NUM_TRANS_IN_UNIT: int = 249

NUM_TRANS_IN_X: int = 18

NUM_TRANS_IN_Y: int = 14

TRANS_SPACING_MM: float = 10.16

DEVICE_HEIGHT_MM: float = 151.4

DEVICE_WIDTH_MM: float = 192.0

