diff --git a/AuroraDevices/AuroraLaserScanner/ScannerConfig.cs b/AuroraDevices/AuroraLaserScanner/ScannerConfig.cs index 488aa7d..b5a9348 100644 --- a/AuroraDevices/AuroraLaserScanner/ScannerConfig.cs +++ b/AuroraDevices/AuroraLaserScanner/ScannerConfig.cs @@ -75,6 +75,18 @@ namespace AuroraLaserScanner public double RotaryEncoderOffset { get; set; } public double MOTFStageSpeed { get; set; } + #region 26.04.08 NDY MOTF Limit(추적 오차 한계) 변수 추가 --- RTC5에 있는 보드num 과 x,y,z에 대한 limit bit수를 입력하면 해당 오차 벗어나면 알려주는 메소드가 존재합니다. 현재는 stop을 직접하니깐 변수 추가하고 메소드 추가추가해서 사용하는 방식으로 확인 부탁드립니다. + [DisplayName("Tracking Error Limit X (mm)")] + public double FlyLimitXmm { get; set; } = 28.0; // 60 FOV 기준 약 90% 지점 - bit로 자동 변환되는지를 확인 해야함. + + [DisplayName("Tracking Error Limit Y (mm)")] + public double FlyLimitYmm { get; set; } = 28.0; + + [DisplayName("Tracking Error Limit Z (mm)")] + public double FlyLimitZmm { get; set; } = 10.0; // 3D 모드 사용 시 + #endregion + + [Category("Scan Area Size")] public double ScanXSize { get; set; } public double ScanYSize { get; set; } diff --git a/AuroraDevices/AuroraLaserScanner/ScannerObj.cs b/AuroraDevices/AuroraLaserScanner/ScannerObj.cs index 6c4b6bc..52d698f 100644 --- a/AuroraDevices/AuroraLaserScanner/ScannerObj.cs +++ b/AuroraDevices/AuroraLaserScanner/ScannerObj.cs @@ -337,5 +337,10 @@ namespace AuroraLaserScanner } + #region 26.04.08 NDY 오차 추적 메소드 OVERRIDE 추가 RTC6 (부모클래스 -자식클래스에서 override 가능하도록 abstract 처리 ) + public abstract void SetFlyLimit(uint portNo, int xMin, int xMax, int yMin, int yMax); + public abstract void SetFlyLimitZ(uint portNo, int zMin, int zMax); + #endregion + } } \ No newline at end of file diff --git a/AuroraDevices/AuroraLaserScanner/ScannerRTC6.cs b/AuroraDevices/AuroraLaserScanner/ScannerRTC6.cs index 34037db..be7ca3e 100644 --- a/AuroraDevices/AuroraLaserScanner/ScannerRTC6.cs +++ b/AuroraDevices/AuroraLaserScanner/ScannerRTC6.cs @@ -152,6 +152,28 @@ namespace AuroraLaserScanner } #region 좌표 변환 작업 수행 + // 26.04.08 NDY - MOTF Tracking Error Limit 설정 추가 - 요기서 처리해야 한다고 한다. + // 하드웨어 보호를 위해 실제 좌표 변환 및 가공 시작 전 울타리를 칩니다. + if (config.UseMarkingOnTheFly) + { + // 1. mm 단위를 bits 단위로 변환 + int xLimitBits = Convert.ToInt32(config.FlyLimitXmm * m_ScaleXYFactor); + int yLimitBits = Convert.ToInt32(config.FlyLimitYmm * m_ScaleXYFactor); + + // 2. 오버라이드된 메서드 호출 (중앙 0 기준 +- 범위 설정) + this.SetFlyLimit(m_deviceNo, -xLimitBits, xLimitBits, -yLimitBits, yLimitBits); + Log.D($"[RTC6ScannerUnit] MOTF Limit 적용: ±{config.FlyLimitXmm}mm (±{xLimitBits} bits)"); + + if (config.Use3DMode) + { + int zLimitBits = Convert.ToInt32(config.FlyLimitZmm * m_ScaleZFactor); + this.SetFlyLimitZ(m_deviceNo, -zLimitBits, zLimitBits); + Log.D($"[RTC6ScannerUnit] MOTF Z-Limit 적용: ±{config.FlyLimitZmm}mm (±{zLimitBits} bits)"); + } + } + + + SetOffset(config.TranslationXOffset, config.TranslationYOffset, 1); SetAngle(config.TranslationAngle, 1); Log.D(string.Format($"[RTC6ScannerUnit] 스캐너 좌표 변화값 설정(X,Y,Θ:{config.TranslationXOffset},{config.TranslationYOffset},{config.TranslationAngle})")); @@ -1099,5 +1121,19 @@ namespace AuroraLaserScanner { return RTC6Wrap.get_last_error(); } + + #region 26.04.08 NDY - 오차 추적 메소드 OVERRIDE 추가 RTC6 (자식클래스 -실제 RTC6Wrap전달 지점) + public override void SetFlyLimit(uint portNo,int xMin, int xMax , int yMin,int yMax ) + { + // mm 를 bits로 처리해줘야한다. + + RTC6Wrap.n_set_fly_limits(portNo, xMin, xMax, yMin, yMax); + } + public override void SetFlyLimitZ(uint portNo, int zMin, int zMax) + { + RTC6Wrap.n_set_fly_limits_z(portNo, zMin, zMax); + } + + #endregion } }