static void Main(string[] args) { SpiralLab.Core.Initialize(); #region initialize RTC IRtc rtc = new RtcVirtual(0); ///가상 rtc 제어기 생성 //IRtc rtc = new Rtc5(0); ///rtc 5 제어기 생성 double fov = 60.0; /// scanner field of view : 60mm double kfactor = Math.Pow(2, 20) / fov; /// k factor (bits/mm) = 2^20 / fov rtc.Initialize(kfactor, LaserMode.Yag1, "cor_1to1.ct5"); /// 스캐너 보정 파일 지정 : correction file rtc.CtlFrequency(50 * 1000, 2); /// laser frequency : 50KHz, pulse width : 2usec rtc.CtlSpeed(100, 100); /// default jump and mark speed : 100mm/s rtc.CtlDelay(10, 100, 200, 200, 0); /// scanner and laser delays #endregion #region initialize Laser (virtial) ILaser laser = new LaserVirtual(0, "virtual", 20); #endregion ConsoleKeyInfo key; do { Console.WriteLine("Testcase for spirallab.sirius. powered by [email protected] (https://sepwind.blogspot.com)"); Console.WriteLine(""); Console.WriteLine("'C' : draw circle"); Console.WriteLine("'R' : draw rectangle"); Console.WriteLine("'D' : draw circle with dots"); Console.WriteLine("'Q' : quit"); Console.WriteLine(""); Console.Write("select your target : "); key = Console.ReadKey(false); if (key.Key == ConsoleKey.Q) { break; } Console.WriteLine("\r\nWARNING !!! LASER IS BUSY ..."); var timer = new Stopwatch(); switch (key.Key) { case ConsoleKey.C: DrawCircle(laser, rtc, 10); break; case ConsoleKey.R: DrawRectangle(laser, rtc, 10, 10); break; case ConsoleKey.D: DrawCircleWithDots(laser, rtc, 10, 1.0); break; } rtc.ListExecute(true); Console.WriteLine($"processing time = {timer.ElapsedMilliseconds/1000.0:F3}s"); } while (true); rtc.Dispose(); }
static void Main(string[] args) { SpiralLab.Core.Initialize(); #region initialize RTC IRtc rtc = new RtcVirtual(0); ///가상 rtc 제어기 생성 //IRtc rtc = new Rtc5(0); ///rtc 5 제어기 생성 double fov = 60.0; /// scanner field of view : 60mm double kfactor = Math.Pow(2, 20) / fov; /// k factor (bits/mm) = 2^20 / fov rtc.Initialize(kfactor, LaserMode.Yag1, "cor_1to1.ct5"); ///default correction file rtc.CtlFrequency(50 * 1000, 2); ///laser frequency : 50KHz, pulse width : 2usec rtc.CtlSpeed(100, 100); /// default jump and mark speed : 100mm/s rtc.CtlDelay(10, 100, 200, 200, 0); ///scanner and laser delays #endregion #region initialize Laser (virtial) ILaser laser = new LaserVirtual(0, "virtual", 20); #endregion #region create entities var doc = new DocumentDefault("Unnamed"); var layer = new Layer("default"); doc.Layers.Add(layer); ///첫번째 그룹 객체 생성 var group1 = new Group(); group1.Add( new Pen() { Frequency = 100 * 1000, PulseWidth = 2, LaserOnDelay = 0, LaserOffDelay = 0, ScannerJumpDelay = 100, ScannerMarkDelay = 200, ScannerPolygonDelay = 0, JumpSpeed = 500, MarkSpeed = 500, } ); group1.Add(new Line(0, 0, 10, 20)); group1.Add(new Circle(0, 0, 10)); group1.Add(new Spiral(-20.0f, 0.0f, 0.5f, 2.0f, 5, true)); group1.RepeatCount = 10; /// 10회 가공 /// 두번째 그룹 객체 생성 var group2 = new Group(); group2.Add( new Pen() { Frequency = 50 * 1000, PulseWidth = 2, LaserOnDelay = 0, LaserOffDelay = 0, ScannerJumpDelay = 100, ScannerMarkDelay = 200, ScannerPolygonDelay = 0, JumpSpeed = 100, MarkSpeed = 100, } ); group1.Add(new Line(0, 0, 5, 10)); group1.Add(new Circle(0, 0, 50)); group1.Add(new Spiral(-10.0f, 0.0f, 0.5f, 2.0f, 10, true)); group1.RepeatCount = 20; /// 20 회 가공 layer.Add(group2); var ds = new DocumentSerializer(); ds.Save(doc, "test.sirius"); #endregion ConsoleKeyInfo key; do { Console.WriteLine("Testcase for spirallab.sirius. powered by [email protected](https://sepwind.blogspot.com)"); Console.WriteLine(""); Console.WriteLine("'D' : draw group entities with pen"); Console.WriteLine("'Q' : quit"); Console.WriteLine(""); Console.Write("select your target : "); key = Console.ReadKey(false); if (key.Key == ConsoleKey.Q) { break; } switch (key.Key) { case ConsoleKey.D: Console.WriteLine("\r\nWARNING !!! LASER IS BUSY ..."); var timer = new Stopwatch(); if (DrawForFieldCorrection(laser, rtc, doc)) { rtc.ListExecute(true); Console.WriteLine($"processing time = {timer.ElapsedMilliseconds / 1000.0:F3}s"); } break; } } while (true); rtc.Dispose(); }
static void Main(string[] args) { SpiralLab.Core.Initialize(); #region initialize RTC IRtc rtc = new RtcVirtual(0); ///가상 rtc 제어기 생성 //IRtc rtc = new Rtc5(0); ///rtc 5 제어기 생성 double fov = 60.0; /// scanner field of view : 60mm double kfactor = Math.Pow(2, 20) / fov; /// k factor (bits/mm) = 2^20 / fov rtc.Initialize(kfactor, LaserMode.Yag1, "cor_1to1.ct5"); ///default correction file rtc.CtlFrequency(50 * 1000, 2); ///laser frequency : 50KHz, pulse width : 2usec rtc.CtlSpeed(100, 100); /// default jump and mark speed : 100mm/s rtc.CtlDelay(10, 100, 200, 200, 0); ///scanner and laser delays #endregion #region initialize Laser(Virtual) ILaser laser = new LaserVirtual(0, "virtual", 20); #endregion #region create entities for scanner field correction var doc = new DocumentDefault("3x3 scanner field correction"); var layer = new Layer("default"); doc.Layers.Add(layer); /// 9 (3x3) 측정 위치에 마킹할 형상 생성 (나선 모양의 객체) layer.Add(new Spiral(-20.0f, 20.0f, 0.2f, 2.0f, 5, true)); layer.Add(new Spiral(0.0f, 20.0f, 0.2f, 2.0f, 5, true)); layer.Add(new Spiral(20.0f, 20.0f, 0.2f, 2.0f, 5, true)); layer.Add(new Spiral(-20.0f, 0.0f, 0.2f, 2.0f, 5, true)); layer.Add(new Spiral(0.0f, 0.0f, 0.2f, 2.0f, 5, true)); layer.Add(new Spiral(20.0f, 0.0f, 0.2f, 2.0f, 5, true)); layer.Add(new Spiral(-20.0f, -20.0f, 0.2f, 2.0f, 5, true)); layer.Add(new Spiral(0.0f, -20.0f, 0.2f, 2.0f, 5, true)); layer.Add(new Spiral(20.0f, -20.0f, 0.2f, 2.0f, 5, true)); var ds = new DocumentSerializer(); ds.Save(doc, "test.sirius"); #endregion ConsoleKeyInfo key; do { Console.WriteLine("Testcase for spirallab.sirius. powered by [email protected] (https://sepwind.blogspot.com)"); Console.WriteLine(""); Console.WriteLine("'F' : draw field correction entities"); Console.WriteLine("'C' : create new field correction for 2D"); Console.WriteLine("'Q' : quit"); Console.WriteLine(""); Console.Write("select your target : "); key = Console.ReadKey(false); if (key.Key == ConsoleKey.Q) { break; } switch (key.Key) { case ConsoleKey.F: Console.WriteLine("\r\nWARNING !!! LASER IS BUSY ..."); var timer = new Stopwatch(); if (DrawForFieldCorrection(laser, rtc, doc)) { rtc.ListExecute(true); } Console.WriteLine($"processing time = {timer.ElapsedMilliseconds / 1000.0:F3}s"); break; case ConsoleKey.C: string result = CreateFieldCorrection(); Console.WriteLine(""); Console.WriteLine(result); break; } } while (true); rtc.Dispose(); }
static void Main(string[] args) { SpiralLab.Core.Initialize(); #region initialize RTC var rtc = new RtcVirtual(0); ///create Rtc for dummy //var rtc = new Rtc5(0); ///create Rtc5 controller //var rtc = new Rtc6(0); ///create Rtc6 controller //var rtc = new Rtc6Ethernet(0, "192.168.0.200"); ///create Rtc6 ethernet controller //var rtc = new Rtc53D(0); ///create Rtc5 + 3D option controller //var rtc = new Rtc63D(0); ///create Rtc5 + 3D option controller //var rtc = new Rtc5DualHead(0); ///create Rtc5 + Dual head option controller //var rtc = new Rtc5MOTF(0); ///create Rtc5 + MOTF option controller //var rtc = new Rtc6MOTF(0); ///create Rtc6 + MOTF option controller //var rtc = new Rtc6SyncAxis(0); //var rtc = new Rtc6SyncAxis(0, "syncAXISConfig.xml"); ///create Rtc6 + XL-SCAN (ACS+SYNCAXIS) option controller float fov = 60.0f; /// scanner field of view : 60mm float kfactor = (float)Math.Pow(2, 20) / fov; /// k factor (bits/mm) = 2^20 / fov var correctionFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "correction", "cor_1to1.ct5"); rtc.Initialize(kfactor, LaserMode.Yag1, correctionFile); /// 스캐너 보정 파일 지정 : correction file rtc.CtlFrequency(50 * 1000, 2); /// laser frequency : 50KHz, pulse width : 2usec rtc.CtlSpeed(100, 100); /// default jump and mark speed : 100mm/s rtc.CtlDelay(10, 100, 200, 200, 0); /// scanner and laser delays #endregion #region initialize Laser (virtial) ILaser laser = new LaserVirtual(0, "virtual", 20); #endregion ConsoleKeyInfo key; do { Console.WriteLine("Testcase for spirallab.sirius. powered by [email protected] (https://sepwind.blogspot.com)"); Console.WriteLine(""); Console.WriteLine("'R' : draw rectangle with rotate"); Console.WriteLine("'L' : draw lines with rotate"); Console.WriteLine("'Q' : quit"); Console.WriteLine(""); Console.Write("select your target : "); key = Console.ReadKey(false); if (key.Key == ConsoleKey.Q) { break; } Console.WriteLine("\r\nWARNING !!! LASER IS BUSY ..."); var timer = Stopwatch.StartNew(); switch (key.Key) { case ConsoleKey.R: /// 회전하는 사각형 모양 가공 (가로 10, 세로 10 크기, 0 ~360 각도의 회전 형상) DrawRectangle(laser, rtc, 10, 10, 0, 360); break; case ConsoleKey.L: ///회전하는 직선 모양 가공 DrawLinesWithRotate(laser, rtc, 0, 360); break; } rtc.ListExecute(true); Console.WriteLine($"processing time = {timer.ElapsedMilliseconds / 1000.0:F3}s"); } while (true); rtc.Dispose(); }
static void Main(string[] args) { SpiralLab.Core.Initialize(); #region initialize RTC var rtc = new RtcVirtual(0); //var rtc = new Rtc5(0); ///create Rtc5 controller //var rtc = new Rtc6(0); ///create Rtc6 controller //var rtc = new Rtc6Ethernet(0, "192.168.0.200"); ///create Rtc6 ethernet controller //var rtc = new Rtc53D(0); ///create Rtc5 + 3D option controller //var rtc = new Rtc63D(0); ///create Rtc5 + 3D option controller //var rtc = new Rtc5DualHead(0); ///create Rtc5 + Dual head option controller //var rtc = new Rtc5MOTF(0); ///create Rtc5 + MOTF option controller //var rtc = new Rtc6MOTF(0); ///create Rtc6 + MOTF option controller //var rtc = new Rtc6SyncAxis(0); //var rtc = new Rtc6SyncAxis(0, "syncAXISConfig.xml"); ///create Rtc6 + XL-SCAN (ACS+SYNCAXIS) option controller float fov = 60.0f; /// scanner field of view : 60mm float kfactor = (float)Math.Pow(2, 20) / fov; /// k factor (bits/mm) = 2^20 / fov var correctionFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "correction", "cor_1to1.ct5"); rtc.Initialize(kfactor, LaserMode.Yag1, correctionFile); ///default correction file rtc.CtlFrequency(50 * 1000, 2); ///laser frequency : 50KHz, pulse width : 2usec rtc.CtlSpeed(100, 100); /// default jump and mark speed : 100mm/s rtc.CtlDelay(10, 100, 200, 200, 0); ///scanner and laser delays #endregion #region initialize Laser (virtial) ILaser laser = new LaserVirtual(0, "virtual", 20); #endregion #region create entities /// 신규 문서 생성 var doc = new DocumentDefault("Unnamed"); /// 레이어 생성후 문서에 추가 var layer = new Layer("default"); doc.Layers.Add(layer); ///첫번째 그룹 객체 생성 var group1 = new Group(); group1.Add( new Pen() /// 그룹내에 펜 개체 생성하여 추가 { Frequency = 100 * 1000, PulseWidth = 2, LaserOnDelay = 0, LaserOffDelay = 0, ScannerJumpDelay = 100, ScannerMarkDelay = 200, ScannerPolygonDelay = 0, JumpSpeed = 500, MarkSpeed = 500, } ); /// 그룹내에 선 개체 생성하여 추가 group1.Add(new Line(0, 0, 10, 20)); /// 그룹내에 원 개체 생성하여 추가 group1.Add(new Circle(0, 0, 10)); /// 그룹내에 나선 개체 생성하여 추가 group1.Add(new Spiral(-20.0f, 0.0f, 0.5f, 2.0f, 5, true)); /// 그룹의 반복 회수 설정 group1.Repeat = 10; /// 10회 가공 /// 반복 가공시 개체들을 반복회수(10) 를 먼저 실시 group1.RepeatMode = GroupRepeatMode.EntityFirst; /// 반복 가공시 역 방향 가공할지 여부 group1.IsReverseMark = false; /// 두번째 그룹 객체 생성 var group2 = new Group(); group2.Add( new Pen() /// 그룹내에 펜 개체 생성하여 추가 { Frequency = 50 * 1000, PulseWidth = 2, LaserOnDelay = 0, LaserOffDelay = 0, ScannerJumpDelay = 100, ScannerMarkDelay = 200, ScannerPolygonDelay = 0, JumpSpeed = 500, MarkSpeed = 500, } ); group1.Add(new Line(0, 0, 5, 10)); group1.Add(new Circle(0, 0, 50)); group1.Add(new Spiral(-10.0f, 0.0f, 0.5f, 2.0f, 10, true)); group1.Repeat = 20; /// 20 회 가공 layer.Add(group2); /// 해당 문서 데이타를 지정된 파일에 저장 var ds = new DocumentSerializer(); ds.Save(doc, "test.sirius"); #endregion ConsoleKeyInfo key; do { Console.WriteLine("Testcase for spirallab.sirius. powered by [email protected](https://sepwind.blogspot.com)"); Console.WriteLine(""); Console.WriteLine("'D' : draw group entities with pen"); Console.WriteLine("'Q' : quit"); Console.WriteLine(""); Console.Write("select your target : "); key = Console.ReadKey(false); if (key.Key == ConsoleKey.Q) { break; } switch (key.Key) { case ConsoleKey.D: Console.WriteLine("\r\nWARNING !!! LASER IS BUSY ..."); var timer = Stopwatch.StartNew(); if (DrawForFieldCorrection(laser, rtc, doc)) { rtc.ListExecute(true); Console.WriteLine($"processing time = {timer.ElapsedMilliseconds / 1000.0:F3}s"); } break; } } while (true); rtc.Dispose(); }
static void Main(string[] args) { SpiralLab.Core.Initialize(); #region initialize RTC var rtc = new RtcVirtual(0); //var rtc = new Rtc5(0); ///create Rtc5 controller //var rtc = new Rtc6(0); ///create Rtc6 controller //var rtc = new Rtc6Ethernet(0, "192.168.0.200"); ///create Rtc6 ethernet controller //var rtc = new Rtc53D(0); ///create Rtc5 + 3D option controller //var rtc = new Rtc63D(0); ///create Rtc5 + 3D option controller //var rtc = new Rtc5DualHead(0); ///create Rtc5 + Dual head option controller //var rtc = new Rtc5MOTF(0); ///create Rtc5 + MOTF option controller //var rtc = new Rtc6MOTF(0); ///create Rtc6 + MOTF option controller //var rtc = new Rtc6SyncAxis(0); //var rtc = new Rtc6SyncAxis(0, "syncAXISConfig.xml"); ///create Rtc6 + XL-SCAN (ACS+SYNCAXIS) option controller float fov = 60.0f; /// scanner field of view : 60mm kfactor = (float)Math.Pow(2, 20) / fov; /// k factor (bits/mm) = 2^20 / fov var correctionFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "correction", "cor_1to1.ct5"); rtc.Initialize(kfactor, LaserMode.Yag1, correctionFile); ///default correction file rtc.CtlFrequency(50 * 1000, 2); ///laser frequency : 50KHz, pulse width : 2usec rtc.CtlSpeed(100, 100); /// default jump and mark speed : 100mm/s rtc.CtlDelay(10, 100, 200, 200, 0); ///scanner and laser delays #endregion #region initialize Laser(Virtual) ILaser laser = new LaserVirtual(0, "virtual", 20); #endregion #region create entities for scanner field correction /// 신규 문서(Document) 생성 var doc = new DocumentDefault("3x3 scanner field correction"); /// 레이어를 생성해서 문서에 추가 var layer = new Layer("default"); doc.Layers.Add(layer); /// 나선모양 개체(Entities)를 레이어에 추가 /// 각 개체의 간격은 20mm 로 총 9개를 생성 layer.Add(new Spiral(-20.0f, 20.0f, 0.2f, 2.0f, 5, true)); layer.Add(new Spiral(0.0f, 20.0f, 0.2f, 2.0f, 5, true)); layer.Add(new Spiral(20.0f, 20.0f, 0.2f, 2.0f, 5, true)); layer.Add(new Spiral(-20.0f, 0.0f, 0.2f, 2.0f, 5, true)); layer.Add(new Spiral(0.0f, 0.0f, 0.2f, 2.0f, 5, true)); layer.Add(new Spiral(20.0f, 0.0f, 0.2f, 2.0f, 5, true)); layer.Add(new Spiral(-20.0f, -20.0f, 0.2f, 2.0f, 5, true)); layer.Add(new Spiral(0.0f, -20.0f, 0.2f, 2.0f, 5, true)); layer.Add(new Spiral(20.0f, -20.0f, 0.2f, 2.0f, 5, true)); /// 해당 문서를 파일에 저장 var ds = new DocumentSerializer(); ds.Save(doc, "test.sirius"); #endregion ConsoleKeyInfo key; do { Console.WriteLine("Testcase for spirallab.sirius. powered by [email protected] (https://sepwind.blogspot.com)"); Console.WriteLine(""); Console.WriteLine("'F' : draw field correction entities"); Console.WriteLine("'C' : create new field correction for 2D"); Console.WriteLine("'Q' : quit"); Console.WriteLine(""); Console.Write("select your target : "); key = Console.ReadKey(false); if (key.Key == ConsoleKey.Q) { break; } switch (key.Key) { case ConsoleKey.F: Console.WriteLine("\r\nWARNING !!! LASER IS BUSY ..."); var timer = Stopwatch.StartNew(); ///9개의 나선모양들을 가공 if (DrawForFieldCorrection(laser, rtc, doc)) { rtc.ListExecute(true); } Console.WriteLine($"processing time = {timer.ElapsedMilliseconds / 1000.0:F3}s"); break; case ConsoleKey.C: string result = CreateFieldCorrection(rtc); Console.WriteLine(""); Console.WriteLine(result); break; } } while (true); rtc.Dispose(); }
static void Main(string[] args) { SpiralLab.Core.Initialize(); #region initialize RTC var rtc = new RtcVirtual(0); //var rtc = new Rtc5(0); ///create Rtc5 controller //var rtc = new Rtc6(0); ///create Rtc6 controller //var rtc = new Rtc6Ethernet(0, "192.168.0.200"); ///create Rtc6 ethernet controller //var rtc = new Rtc53D(0); ///create Rtc5 + 3D option controller //var rtc = new Rtc63D(0); ///create Rtc5 + 3D option controller //var rtc = new Rtc5DualHead(0); ///create Rtc5 + Dual head option controller //var rtc = new Rtc5MOTF(0); ///create Rtc5 + MOTF option controller //var rtc = new Rtc6MOTF(0); ///create Rtc6 + MOTF option controller //var rtc = new Rtc6SyncAxis(0); //var rtc = new Rtc6SyncAxis(0, "syncAXISConfig.xml"); ///create Rtc6 + XL-SCAN (ACS+SYNCAXIS) option controller float fov = 60.0f; /// scanner field of view : 60mm float kfactor = (float)Math.Pow(2, 20) / fov; /// k factor (bits/mm) = 2^20 / fov var correctionFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "correction", "cor_1to1.ct5"); rtc.Initialize(kfactor, LaserMode.Yag1, correctionFile); ///default correction file rtc.CtlFrequency(50 * 1000, 2); ///laser frequency : 50KHz, pulse width : 2usec rtc.CtlSpeed(100, 100); /// default jump and mark speed : 100mm/s rtc.CtlDelay(10, 100, 200, 200, 0); ///scanner and laser delays #endregion #region initialize Laser (virtial) ILaser laser = new LaserVirtual(0, "virtual", 20); #endregion #region create entities /// 문서 생성 var doc = new DocumentDefault("Unnamed"); /// 레이어 생성및 문서에 추가 var layer = new Layer("default"); doc.Layers.Add(layer); /// 펜 개체(Entity) 생성및 레이어에 추가 layer.Add( new Pen() { Frequency = 100 * 1000, ///주파수 Hz PulseWidth = 2, ///펄스폭 usec LaserOnDelay = 0, /// 레이저 시작 지연 usec LaserOffDelay = 0, /// 레이저 끝 지연 usec ScannerJumpDelay = 100, /// 스캐너 점프 지연 usec ScannerMarkDelay = 200, /// 스캐너 마크 지연 usec ScannerPolygonDelay = 0, /// 스캐너 폴리곤 지연 usec JumpSpeed = 500, /// 스캐너 점프 속도 mm/s MarkSpeed = 500, /// 스캐너 마크 속도 mm/s } ); /// 선 개체 레이어에 추가 layer.Add(new Line(0, 0, 10, 20)); /// 원 개체 레이어에 추가 layer.Add(new Circle(0, 0, 10)); /// 나선 개체 레이어에 추가 layer.Add(new Spiral(-20.0f, 0.0f, 0.5f, 2.0f, 5, true)); /// 문서를 지정된 파일에 저장 var ds = new DocumentSerializer(); ds.Save(doc, "test.sirius"); #endregion ConsoleKeyInfo key; do { Console.WriteLine("Testcase for spirallab.sirius. powered by [email protected] (https://sepwind.blogspot.com)"); Console.WriteLine(""); Console.WriteLine("'D' : draw entities by pen"); Console.WriteLine("'Q' : quit"); Console.WriteLine(""); Console.Write("select your target : "); key = Console.ReadKey(false); if (key.Key == ConsoleKey.Q) { break; } switch (key.Key) { case ConsoleKey.D: Console.WriteLine("\r\nWARNING !!! LASER IS BUSY ..."); var timer = Stopwatch.StartNew(); if (DrawForFieldCorrection(laser, rtc, doc)) { rtc.ListExecute(true); } Console.WriteLine($"processing time = {timer.ElapsedMilliseconds / 1000.0:F3}s"); break; } } while (true); rtc.Dispose(); }