using MwFramework.Device.Model;
using SemiconductorVisionAlgorithm.SemiParams;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Jm1RecheckDiePoint = JM1.JM1Params.RecheckDiePoint;
using SemiPoint = SemiconductorVisionAlgorithm.SemiParams.Point;

namespace MainShell.Vision
{
    /// <summary>
    /// 通用视觉算法服务接口。
    /// </summary>
    public interface ICommonVisionAlgorithmService
    {
        Task<VisionProcessResult> GenWaferMapXAsync(
            string fileDirectory,
            double[] edgePtRow,
            double[] edgePtCol,
            double[] edgePtAngle,
            double[] inPtRow,
            double[] inPtCol,
            double[] inPtAngle,
            double upThresholdAngle,
            double upRowDistance,
            double upColDistance,
            int upRowNumber,
            int upColNumber,
            double firstPosRow,
            double firstPosCol,
            double distanceThreshold,
            double angleThreshold,
            double rotateAngle,
            CancellationToken cancellationToken = default(CancellationToken));

        Task<VisionProcessResult> RecheckPosRgbAsync(
            List<Jm1RecheckDiePoint> edgeDiePoints,
            List<Jm1RecheckDiePoint> inDiePoints,
            double threshold,
            List<Jm1RecheckDiePoint> existingPoints,
            RecheckDieMap padPos,
            double diePitch,
            int rowNumber,
            int colNumber,
            CancellationToken cancellationToken = default(CancellationToken));

        Task<VisionProcessResult> ClearRecheckDiePosAsync(
            CancellationToken cancellationToken = default(CancellationToken));

        Task<VisionProcessResult> ClearMapAsync(
            int flag,
            CancellationToken cancellationToken = default(CancellationToken));

        Task<VisionProcessResult<(RecheckDieMap UpMap, List<Jm1RecheckDiePoint> PatchPos, List<Jm1RecheckDiePoint> ExceptPos)>> GetMapAsync(
            CancellationToken cancellationToken = default(CancellationToken));

        Task<VisionProcessResult<(RecheckDieMap Map, List<Jm1RecheckDiePoint> ExposedPoints)>> GetRecheckDiePosAsync(
            CancellationToken cancellationToken = default(CancellationToken));

        Task<VisionProcessResult> CalProductAffineAsync(
            List<SemiPoint> sourcePoints,
            List<SemiPoint> targetPoints,
            CancellationToken cancellationToken = default(CancellationToken));

        Task<VisionProcessResult<double>> CalculateLineAngleAsync(
            SemiPoint point1,
            SemiPoint point2,
            CancellationToken cancellationToken = default(CancellationToken));

        Task<VisionProcessResult> SetWorkAreaAsync(
            string fileDirectory,
            double heightY,
            double widthX,
            CancellationToken cancellationToken = default(CancellationToken));

        Task<VisionProcessResult> SetDirectionAsync(
            string fileDirectory,
            int xDirection,
            int yDirection,
            CancellationToken cancellationToken = default(CancellationToken));

    }
}
