using System.Threading.Tasks;
using XP.Hardware.Detector.Abstractions.Enums;

namespace XP.Hardware.Detector.Abstractions
{
    /// <summary>
    /// Varex 探测器专属接口 | Varex detector specific interface
    /// 扩展 Varex 特有的功能
    /// </summary>
    public interface IVarexDetector : IAreaDetector
    {
        /// <summary>
        /// 设置 Binning 模式 | Set binning mode
        /// </summary>
        /// <param name="mode">Binning 模式 | Binning mode</param>
        /// <returns>操作结果 | Operation result</returns>
        Task<DetectorResult> SetBinningModeAsync(BinningMode mode);

        /// <summary>
        /// 获取 Binning 模式 | Get binning mode
        /// </summary>
        /// <returns>当前 Binning 模式 | Current binning mode</returns>
        BinningMode GetBinningMode();

        /// <summary>
        /// 设置增益模式 | Set gain mode
        /// </summary>
        /// <param name="mode">增益模式 | Gain mode</param>
        /// <returns>操作结果 | Operation result</returns>
        Task<DetectorResult> SetGainModeAsync(GainMode mode);

        /// <summary>
        /// 获取增益模式 | Get gain mode
        /// </summary>
        /// <returns>当前增益模式 | Current gain mode</returns>
        GainMode GetGainMode();

        /// <summary>
        /// 设置曝光时间 | Set exposure time
        /// </summary>
        /// <param name="milliseconds">曝光时间（毫秒）| Exposure time (milliseconds)</param>
        /// <returns>操作结果 | Operation result</returns>
        Task<DetectorResult> SetExposureTimeAsync(uint milliseconds);

        /// <summary>
        /// 获取曝光时间 | Get exposure time
        /// </summary>
        /// <returns>曝光时间（毫秒）| Exposure time (milliseconds)</returns>
        uint GetExposureTime();

        /// <summary>
        /// 设置 ROI 区域 | Set ROI region
        /// </summary>
        /// <param name="x">起始 X 坐标 | Start X coordinate</param>
        /// <param name="y">起始 Y 坐标 | Start Y coordinate</param>
        /// <param name="width">宽度 | Width</param>
        /// <param name="height">高度 | Height</param>
        /// <returns>操作结果 | Operation result</returns>
        Task<DetectorResult> SetROIAsync(uint x, uint y, uint width, uint height);

        /// <summary>
        /// 获取 ROI 区域 | Get ROI region
        /// </summary>
        /// <returns>ROI 参数 | ROI parameters</returns>
        (uint x, uint y, uint width, uint height) GetROI();
    }
}
