65 lines
2.1 KiB
C#
65 lines
2.1 KiB
C#
using Newtonsoft.Json;
|
|
using PropertyTools.DataAnnotations;
|
|
|
|
namespace VisionCommon {
|
|
public enum eMoveStep {
|
|
Step_3 = 3, // 3회 이동
|
|
Step_5 = 5, // 5회 이동
|
|
Step_7 = 7 // 7회 이동
|
|
}
|
|
|
|
public enum eMoveAxis {
|
|
T = 0x01, // 001
|
|
Y = 0x02, // 010
|
|
YT = 0x03, // 011
|
|
X = 0x04, // 100
|
|
XT = 0x05, // 101
|
|
XY = 0x06, // 110
|
|
XYT = 0x07 // 111
|
|
}
|
|
|
|
public class CalSetupRecipe {
|
|
public bool Enabled { get; set; } = true;
|
|
[SelectorStyle(SelectorStyle.ComboBox)]
|
|
public eMoveStep DistanceStep { get; set; } = eMoveStep.Step_5;
|
|
[Converter(typeof(CoordUnitValueConverter))]
|
|
public double DistanceUnit { get; set; } = 0.5; // 단위 : mm
|
|
[SelectorStyle(SelectorStyle.ComboBox)]
|
|
public eMoveStep RotationStep { get; set; } = eMoveStep.Step_5;
|
|
public double RotationUnit { get; set; } = 0.1; // 단위 : deg
|
|
[SelectorStyle(SelectorStyle.ComboBox)]
|
|
public eMoveAxis MoveAxis { get; set; } = eMoveAxis.XY;
|
|
|
|
public CalSetupRecipe Clone() {
|
|
return new CalSetupRecipe() {
|
|
Enabled = this.Enabled,
|
|
DistanceStep = this.DistanceStep,
|
|
DistanceUnit = this.DistanceUnit,
|
|
RotationStep = this.RotationStep,
|
|
RotationUnit = this.RotationUnit,
|
|
MoveAxis = this.MoveAxis
|
|
};
|
|
}
|
|
|
|
public void CopyTo(CalSetupRecipe target) {
|
|
target.Enabled = this.Enabled;
|
|
target.DistanceStep = this.DistanceStep;
|
|
target.DistanceUnit = this.DistanceUnit;
|
|
target.RotationStep = this.RotationStep;
|
|
target.RotationUnit = this.RotationUnit;
|
|
target.MoveAxis = this.MoveAxis;
|
|
}
|
|
|
|
public bool isX() {
|
|
return (((int)this.MoveAxis >> 2) % 2 == 1);
|
|
}
|
|
|
|
public bool isY() {
|
|
return (((int)this.MoveAxis >> 1) % 2 == 1);
|
|
}
|
|
|
|
public bool isT() {
|
|
return ((int)this.MoveAxis % 2 == 1);
|
|
}
|
|
}
|
|
} |