73 lines
2.7 KiB
C#
73 lines
2.7 KiB
C#
using Aurora.View;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using VisionCommon;
|
|
|
|
namespace VisionAligner {
|
|
/// <summary>
|
|
/// 얼라인 결과 항목
|
|
/// </summary>
|
|
public class AlignResultItem : ICloneable {
|
|
/// <summary>걸린 시간</summary>
|
|
public string Time { get; set; }
|
|
/// <summary>얼라인 이름</summary>
|
|
public string AlignName { get; set; }
|
|
/// <summary>얼라인 알고리즘</summary>
|
|
public string AlignAlgorithm { get; set; }
|
|
/// <summary>얼라인 횟수</summary>
|
|
public int AlignCnt { get; set; }
|
|
/// <summary>얼라인 보정량 X</summary>
|
|
public double Dx { get; set; }
|
|
/// <summary>얼라인 보정량 Y</summary>
|
|
public double Dy { get; set; }
|
|
/// <summary>얼라인 보정량 T</summary>
|
|
public double Dt { get; set; }
|
|
/// <summary>얼라인 상태</summary>
|
|
public string AlignStatus { get; set; }
|
|
|
|
/// <summary>
|
|
/// Clone (Deep Copy)
|
|
/// </summary>
|
|
/// <returns>AlignResultItem</returns>
|
|
public object Clone() {
|
|
return new AlignResultItem() {
|
|
Time = this.Time,
|
|
AlignName = this.AlignName,
|
|
AlignAlgorithm = this.AlignAlgorithm,
|
|
AlignCnt = this.AlignCnt,
|
|
Dx = this.Dx,
|
|
Dy = this.Dy,
|
|
Dt = this.Dt,
|
|
AlignStatus = this.AlignStatus
|
|
};
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 얼라인 결과 항목 매니저
|
|
/// </summary>
|
|
public class AlignResultItemManager : ItemManagerBase {
|
|
private static readonly object _Lock = new object();
|
|
|
|
/// <summary>
|
|
/// 얼라인 결과 항목을 Get한다
|
|
/// </summary>
|
|
/// <param name="subSysInfo">서브 시스템 정보</param>
|
|
/// <param name="alignResult">얼라인 결과</param>
|
|
/// <returns>얼라인 결과 항목</returns>
|
|
public static AlignResultItem GetAlignResultItem(SubSysInfo subSysInfo, AlignResult alignResult) {
|
|
lock (_Lock) {
|
|
return new AlignResultItem() {
|
|
Time = GetTimeStamp(subSysInfo, alignResult),
|
|
AlignName = alignResult.AlignName,
|
|
AlignAlgorithm = alignResult.AlignAlgorithm.ToString(),
|
|
AlignCnt = alignResult.AlignCnt,
|
|
Dx = CoordUnitValueConverter.GetCoordUnitValue(alignResult.Delta.X),
|
|
Dy = CoordUnitValueConverter.GetCoordUnitValue(alignResult.Delta.Y),
|
|
Dt = alignResult.Delta.T.Degree,
|
|
AlignStatus = alignResult.Status.ToString()
|
|
};
|
|
}
|
|
}
|
|
}
|
|
} |