2026-01-26 18:56:53 +09:00

86 lines
2.8 KiB
C#

/*
* Copyright (c) 2025 LG Electronics Inc.
* SPDX-License-Identifier: LicenseRef-LGE-Proprietary
*/
using Aurora.View;
using PropertyTools.DataAnnotations;
using System;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.Linq;
namespace VisionCommon {
public class InspRecipe : ICloneCopy<InspRecipe> {
public AttachInspRecipe AttachInspRecipe { get; set; }
public InspRecipe Clone() {
return ((ICloneable)this).Clone() as InspRecipe;
}
object ICloneable.Clone() {
var cloneObj = new InspRecipe();
CopyTo(cloneObj);
return cloneObj;
}
public void CopyTo(InspRecipe target) {
if (this.AttachInspRecipe != null) {
target.AttachInspRecipe = this.AttachInspRecipe.Clone();
}
}
}
public class AttachInspParam : ICloneCopy<AttachInspParam> {
public double SpecW { get; set; }
public double ErrRangeW { get; set; }
public double SpecH { get; set; }
public double ErrRangeH { get; set; }
public AttachInspParam Clone() {
return ((ICloneable)this).Clone() as AttachInspParam;
}
object ICloneable.Clone() {
var cloneObj = new AttachInspParam();
CopyTo(cloneObj);
return cloneObj;
}
public void CopyTo(AttachInspParam target) {
target.SpecW = this.SpecW;
target.ErrRangeW = this.ErrRangeW;
target.SpecH = this.SpecH;
target.ErrRangeH = this.ErrRangeH;
}
}
/// <summary>
/// 부착검사 시퀀스 FOV 타입
/// </summary>
public enum eAttachInspFovType {
C2_F4_MV, // CAM 2대 / FOV 4개 / 포지션 이동 (O)
}
public class AttachInspRecipe : ICloneCopy<AttachInspRecipe> {
public eAttachInspFovType AttachInspFovType { get; set; } = eAttachInspFovType.C2_F4_MV;
/// <summary> FOV 순서별 부착검사 파라미터 </summary>
[Converter(typeof(CoordUnitAttachInspParamsConverter))]
public ObservableCollection<AttachInspParam> AttachInspParams { get; set; } = new ObservableCollection<AttachInspParam>();
public AttachInspRecipe Clone() {
return ((ICloneable)this).Clone() as AttachInspRecipe;
}
object ICloneable.Clone() {
var cloneObj = new AttachInspRecipe();
CopyTo(cloneObj);
return cloneObj;
}
public void CopyTo(AttachInspRecipe target) {
target.AttachInspFovType = this.AttachInspFovType;
var clonedList = this.AttachInspParams.Select(x => x.Clone()).ToList();
target.AttachInspParams = new ObservableCollection<AttachInspParam>(clonedList);
}
}
}