/* * Copyright (c) 2025 LG Electronics Inc. * SPDX-License-Identifier: LicenseRef-LGE-Proprietary */ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace VisionCommon { public class PatternResult { public PatternIndex PatternIndex { get; set; } public ePatternType PatternType { get; set; } = ePatternType.None; public string PatternName { get; set; } = string.Empty; public eFoundStatus Status { get; set; } = eFoundStatus.NotFound; public IEnumerable Results { get; set; } public ROI FindRoi { get; set; } public double TactTimeInMilliSec { get; set; } public object MoreInfo { get; set; } public eFovId FovId { get; set; } = eFovId.None; public override string ToString() { string str = string.Empty; if (Status != eFoundStatus.NotFound) { int index = 0; if (Results != null) { foreach (var baseResult in Results) { if (index != 0) { str += "\n"; } str += $"Position[{index}] : {baseResult}"; index++; } } } return str; } public PatternResult Clone() { return new PatternResult() { PatternIndex = this.PatternIndex.Clone() as PatternIndex, PatternType = this.PatternType, PatternName = this.PatternName, Status = this.Status, Results = new List(this.Results), FindRoi = this.FindRoi?.Clone() as ROI, TactTimeInMilliSec = this.TactTimeInMilliSec, MoreInfo = this.MoreInfo, FovId = this.FovId }; } } }