kingno
5 天以前 e41fb4bea3afa879caaf6c9f316f01bacf262545
src/Bro.M135.Common/ProductModel.cs
@@ -76,7 +76,12 @@
        public bool IsPreStationOK { get; set; } = false;
        [JsonIgnore]
        public List<string> ImagePaths { get; set; } = new List<string>();
        public List<Netdefectdetail> Netdefectdetails = new List<Netdefectdetail>();
        public List<double> Centermatrix { get; set; } = new List<double>();
        public DateTime? EndTime { get; set; } = null;
@@ -424,7 +429,7 @@
        #endregion
        #region PositionCheckTimes
        public void InitialPositionCheckList(string positionName, List<int> checkTimes,string stationName)
        public void InitialPositionCheckList(string positionName, List<int> checkTimes, string stationName)
        {
            lock (_checkResultLock)
            {
@@ -493,4 +498,37 @@
            TimeoutTimer = null;
        }
    }
    public class Netdefectdetail
    {
        public string name { get; set; }
        public double centerX { get; set; }
        public double centerY { get; set; }
        public static double GetDistance(double x1, double y1, double x2, double y2)
        {
            double dx = x2 - x1;
            double dy = y2 - y1;
            return Math.Sqrt(dx * dx + dy * dy);
        }
        public static bool operator ==(Netdefectdetail a, Netdefectdetail b)
        {
            if (GetDistance(a.centerX, a.centerY, b.centerX, b.centerY) < 50)
            {
                return true;
            }
            return false;
        }
        public static bool operator !=(Netdefectdetail a, Netdefectdetail b)
        {
            return !(a == b);
        }
    }
}