2026-03-30 17:09:29 +09:00

51 lines
1.7 KiB
C#

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<BaseResult> 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;
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<BaseResult>(this.Results),
FindRoi = this.FindRoi?.Clone() as ROI,
TactTimeInMilliSec = this.TactTimeInMilliSec,
MoreInfo = this.MoreInfo,
FovId = this.FovId
};
}
}
}