Example #1
0
        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 source
            ILaser laser = new YourCustomLaser(0, "custom laser", 20.0f, PowerXFactor.ByUser);
            laser.Initialize();
            laser.CtlPower(rtc, 8.0f);
            #endregion

            #region prepare your marker
            var marker = new YourMarker(0);
            marker.Name        = "custom marker";
            marker.OnFinished += Marker_OnFinished;
            #endregion

            ConsoleKeyInfo key;
            do
            {
                Console.WriteLine("Testcase for spirallab.sirius. powered by [email protected] (https://sepwind.blogspot.com)");
                Console.WriteLine("");
                Console.WriteLine("'M' : mark by your custom marker");
                Console.WriteLine("'L' : pop up your custom laser form");
                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.M:
                    Console.WriteLine("\r\nWARNING !!! LASER IS BUSY ...");
                    DrawByMarker(rtc, laser, marker);
                    break;

                case ConsoleKey.L:
                    Console.WriteLine("\r\nLASER FORM");
                    PopUpLaserForm(laser);
                    break;
                }
            } while (true);

            rtc.Dispose();
        }
Example #2
0
        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();
        }
Example #3
0
        public FormMain()
        {
            InitializeComponent();

            SpiralLab.Core.Initialize();

            var doc = new DocumentDefault();

            siriusEditorForm1.Document = doc;
            siriusViewerForm1.Document = doc;

            /// 소스 문서(IDocument) 가 변경될경우 다른 멀티 뷰에 이를 통지하는 이벤트 핸들러 등록
            siriusEditorForm1.OnDocumentSourceChanged += SiriusEditorForm1_OnDocumentSourceChanged;

            #region 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
            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
            this.siriusEditorForm1.Rtc = rtc;

            #region 레이저 소스 초기화
            ILaser laser = new LaserVirtual(0, "virtual", 20.0f);
            laser.Initialize();
            var pen = new Pen
            {
                Power = 10.0f,
            };
            laser.CtlPower(rtc, pen);
            #endregion
            this.siriusEditorForm1.Laser = laser;

            #region 마커 지정
            var marker = new MarkerDefault(0);
            #endregion
            this.siriusEditorForm1.Marker = marker;
        }
Example #4
0
        static void Main(string[] args)
        {
            SpiralLab.Core.Initialize();

            #region create entities
            var doc1  = new DocumentDefault("Unnamed");
            var layer = new Layer("default");
            doc1.Layers.Add(layer);
            layer.Add(new Line(0, 10, 20, 20));
            layer.Add(new Circle(0, 0, 10));
            layer.Add(new Spiral(-20.0f, 0.0f, 0.5f, 2.0f, 5, true));
            #endregion

            Console.WriteLine("press any key to save ...");
            Console.ReadKey(false);
            string filename = "default.sirius";

            var ds = new DocumentSerializer();
            ds.Save(doc1, filename);

            Console.WriteLine("press any key to open ...");
            Console.ReadKey(false);
            var doc2 = DocumentSerializer.OpenSirius(filename);

            Console.WriteLine("press any key to rtc initialize ...");
            Console.ReadKey(false);

            #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

            Console.WriteLine("press any key to laser processing ...WARNING !!!  LASER EMISSION");
            Console.ReadKey(false);
            DoBegin(laser, rtc, doc2);

            Console.WriteLine("press any key to terminate program");
            Console.ReadKey(false);
        }
Example #5
0
        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 source
            ILaser laser = new YourCustomLaser(0, "custom laser", 20.0f, PowerXFactor.ByUser);
            laser.Initialize();
            var pen = new Pen
            {
                Power = 10.0f,
            };
            laser.CtlPower(rtc, pen);
            #endregion

            #region prepare your marker
            /// 사용자 정의 마커 생성
            var marker = new YourCustomMarker(0);
            marker.Name = "custom marker";
            ///가공 완료 이벤트 핸들러 등록
            marker.OnFinished += Marker_OnFinished;
            #endregion

            ConsoleKeyInfo key;
            do
            {
                Console.WriteLine("Testcase for spirallab.sirius. powered by [email protected] (https://sepwind.blogspot.com)");
                Console.WriteLine("");
                Console.WriteLine("'M' : mark by your custom marker");
                Console.WriteLine("'L' : pop up your custom laser form");
                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.M:
                    Console.WriteLine("\r\nWARNING !!! LASER IS BUSY ...");
                    DrawByMarker(rtc, laser, marker);
                    break;

                case ConsoleKey.L:
                    Console.WriteLine("\r\nLASER FORM");
                    PopUpLaserForm(laser);
                    break;
                }
            } while (true);

            rtc.Dispose();
        }
Example #6
0
        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();
        }
Example #7
0
        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();
        }
Example #8
0
        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, "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);  /// 최대 출력 20W 의 가상 레이저 소스 생성
            #endregion

            ConsoleKeyInfo key;
            do
            {
                Console.WriteLine("Testcase for spirallab.sirius. powered by [email protected] (https://sepwind.blogspot.com)");
                Console.WriteLine("");
                Console.WriteLine("'S' : get status");
                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;
                }
                var timer = Stopwatch.StartNew();
                switch (key.Key)
                {
                case ConsoleKey.S:      ///RTC의 상태 확인
                    if (rtc.CtlGetStatus(RtcStatus.Busy))
                    {
                        Console.WriteLine($"\r\nRtc is busy!");
                    }
                    else if (!rtc.CtlGetStatus(RtcStatus.PowerOK))
                    {
                        Console.WriteLine($"\r\nScanner power is not ok");
                    }
                    else if (!rtc.CtlGetStatus(RtcStatus.PositionAckOK))
                    {
                        Console.WriteLine($"\r\nScanner position is not acked");
                    }
                    else if (!rtc.CtlGetStatus(RtcStatus.NoError))
                    {
                        Console.WriteLine($"\r\nRtc status has an error");
                    }
                    else
                    {
                        Console.WriteLine($"\r\nIt's okay");
                    }
                    break;

                case ConsoleKey.C:      /// 원 모양 가공
                    Console.WriteLine("\r\nWARNING !!! LASER IS BUSY ...");
                    DrawCircle(laser, rtc, 10);
                    break;

                case ConsoleKey.R:      /// 사각형 모양 가공
                    Console.WriteLine("\r\nWARNING !!! LASER IS BUSY ...");
                    DrawRectangle(laser, rtc, 10, 10);
                    break;

                case ConsoleKey.D:      ///점으로 이루어진 원 모양 가공
                    Console.WriteLine("\r\nWARNING !!! LASER IS BUSY ...");
                    DrawCircleWithDots(laser, rtc, 10, 1.0f);
                    break;
                }
                Console.WriteLine($"Processing time = {timer.ElapsedMilliseconds/1000.0:F3}s");
            } while (true);

            rtc.Dispose();
        }
Example #9
0
        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();
        }
Example #10
0
        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();
        }
Example #11
0
        static void Main(string[] args)
        {
            SpiralLab.Core.Initialize();

            #region create entities
            ///신규 문서(Document) 생성
            var doc1 = new DocumentDefault("Unnamed");
            /// 레이어 생성
            var layer = new Layer("default");
            /// 레이어를 문서해 추가
            doc1.Layers.Add(layer);
            ///레이어에 선 형상 개체(Entity) 생성및 추가
            layer.Add(new Line(0, 10, 20, 20));
            ///레이어에 원 형상 개체(Entity) 생성및 추가
            layer.Add(new Circle(0, 0, 10));
            ///레이어에 나선 형상 개체(Entity) 생성및 추가
            layer.Add(new Spiral(-20.0f, 0.0f, 0.5f, 2.0f, 5, true));
            #endregion

            Console.WriteLine("press any key to save ...");
            Console.ReadKey(false);
            string filename = "default.sirius";

            /// 문서(Document) 저장하기
            var ds = new DocumentSerializer();
            ds.Save(doc1, filename);

            Console.WriteLine("press any key to open ...");
            Console.ReadKey(false);
            /// 문서(Document) 불러오기
            var doc2 = DocumentSerializer.OpenSirius(filename);

            Console.WriteLine("press any key to rtc initialize ...");
            Console.ReadKey(false);

            #region initialize RTC
            var rtc = new RtcVirtual(0, "output2.txt");
            //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

            Console.WriteLine("press any key to laser processing ...WARNING !!!  LASER EMISSION");
            Console.ReadKey(false);
            DoBegin(laser, rtc, doc2);

            Console.WriteLine("press any key to terminate program");
            Console.ReadKey(false);
        }
Example #12
0
        public FormMain()
        {
            InitializeComponent();

            SpiralLab.Core.Initialize();

            //Rtc 2개 생성
            var rtc1 = new RtcVirtual(0, "output1.txt");

            rtc1.Initialize(1000, LaserMode.Yag1, null);
            var rtc2 = new RtcVirtual(1, "output2.txt");

            rtc2.Initialize(1000, LaserMode.Yag1, null);

            //Laser 2개 생성
            var laser1 = new LaserVirtual(0, "Virtual Laser1", 20);

            laser1.Initialize();
            var laser2 = new LaserVirtual(1, "Virtual Laser2", 20);

            laser2.Initialize();

            //Marker 2개 생성
            var marker1 = new MarkerDefault(0);
            var marker2 = new MarkerDefault(1);


            //두개의 문서 생성
            var doc1 = new DocumentDefault();
            var doc2 = new DocumentDefault();


            //뷰어에 문서 소스 설정
            this.formViewer = new FormViewer();
            this.formViewer.Viewer1.Document  = doc1;
            this.formViewer.Viewer1.AliasName = "Left Viewer";
            this.formViewer.Viewer2.Document  = doc2;
            this.formViewer.Viewer2.AliasName = "Right Viewer";

            //에디터 1에 문서 소스 설정
            this.formEditor1 = new FormEditor();
            this.formEditor1.Editor.Document  = doc1;
            this.formEditor1.Editor.AliasName = "Left Editor";

            //에디터 2에 문서 소스 설정
            this.formEditor2 = new FormEditor();
            this.formEditor2.Editor.Document  = doc2;
            this.formEditor2.Editor.AliasName = "Right Editor";

            //소스 문서(IDocument) 가 변경될경우 다른 멀티 뷰에 이를 통지가능하도록 이벤트 핸들러 등록
            this.formViewer.Viewer1.OnDocumentSourceChanged += Viewer1_OnDocumentSourceChanged;
            this.formEditor1.Editor.OnDocumentSourceChanged += Viewer1_OnDocumentSourceChanged;

            this.formViewer.Viewer2.OnDocumentSourceChanged += Viewer2_OnDocumentSourceChanged;
            this.formEditor2.Editor.OnDocumentSourceChanged += Viewer2_OnDocumentSourceChanged;


            // 뷰어1 와 하드웨어 연결
            this.formViewer.Viewer1.Rtc    = rtc1;
            this.formViewer.Viewer1.Laser  = laser1;
            this.formViewer.Viewer1.Marker = marker1;

            //뷰어2 와 하드웨어 연결
            this.formViewer.Viewer2.Rtc    = rtc2;
            this.formViewer.Viewer2.Laser  = laser2;
            this.formViewer.Viewer2.Marker = marker2;


            // 에디터1 와 하드웨어 연결
            this.formEditor1.Editor.Rtc    = rtc1;
            this.formEditor1.Editor.Laser  = laser1;
            this.formEditor1.Editor.Marker = marker1;

            //에디터1 와 하드웨어 연결
            this.formEditor2.Editor.Rtc    = rtc2;
            this.formEditor2.Editor.Laser  = laser2;
            this.formEditor2.Editor.Marker = marker2;



            // 뷰어를 초기화면에 출력
            SwitchForm(panel3, this.formViewer);
        }
Example #13
0
        public FormMain()
        {
            InitializeComponent();

            SpiralLab.Core.Initialize();

            //Rtc 제어기 객체 2개 생성
            var rtc1 = new RtcVirtual(0, "output1.txt");
            var rtc2 = new RtcVirtual(1, "output2.txt");
            //var rtc = new Rtc5(0); //create Rtc5 controller
            //var rtc = new Rtc6(0); //create Rtc6 controller
            //var rtc = new Rtc6Ethernet(0, "192.168.0.100", "255.255.255.0"); //실험적인 상태 (Scanlab Rtc6 Ethernet 제어기)
            //var rtc = new Rtc6SyncAxis(0, Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "syncAxis", "syncAXISConfig.xml")); //실험적인 상태 (Scanlab XLSCAN 솔류션)

            var correctionFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "correction", "cor_1to1.ct5");

            rtc1.Initialize(1000, LaserMode.Yag1, correctionFile);
            rtc2.Initialize(1000, LaserMode.Yag1, correctionFile);

            //Laser 소스 객체 2개 생성
            var laser1 = new LaserVirtual(0, "virtual", 20);  // virtual laser source with max 20W power (최대 출력 20W 의 가상 레이저 소스 생성)

            //var laser1 = new IPGYLP(0, "IPG YLP", 1, 20);
            //var laser1 = new JPTTypeE(0, "JPT Type E", 1, 20);
            //var laser1 = new SPIG4(0, "SPI G3/4", 1, 20);
            //var laser1 = new PhotonicsIndustryDX(0, "PI", 1, 20);
            //var laser1 = new AdvancedOptoWaveFotia(0, "Fotia", 1, 20);
            //var laser1 = new CoherentAviaLX(0, "Avia LX", 1, 20);
            laser1.Rtc = rtc1;
            laser1.Initialize();
            laser1.CtlPower(2);

            var laser2 = new LaserVirtual(0, "virtual", 20);  // virtual laser source with max 20W power (최대 출력 20W 의 가상 레이저 소스 생성)

            //var laser2 = new IPGYLP(0, "IPG YLP", 2, 20);
            //var laser2 = new JPTTypeE(0, "JPT Type E", 2, 20);
            //var laser2 = new SPIG4(0, "SPI G3/4", 2, 20);
            //var laser2 = new PhotonicsIndustryDX(0, "PI", 2, 20);
            //var laser2 = new AdvancedOptoWaveFotia(0, "Fotia", 2, 20);
            //var laser2 = new CoherentAviaLX(0, "Avia LX", 2, 20);
            laser2.Rtc = rtc2;
            laser2.Initialize();
            laser2.CtlPower(2);

            //Marker 2개 생성
            var marker1 = new MarkerDefault(0);
            var marker2 = new MarkerDefault(1);

            //두개의 문서 생성
            var doc1 = new DocumentDefault();
            var doc2 = new DocumentDefault();

            //뷰어에 문서 소스 설정
            this.formViewer = new FormViewer();
            this.formViewer.Viewer1.Document  = doc1;
            this.formViewer.Viewer1.AliasName = "Left Viewer";
            this.formViewer.Viewer2.Document  = doc2;
            this.formViewer.Viewer2.AliasName = "Right Viewer";

            //에디터 1에 문서 소스 설정
            this.formEditor1 = new FormEditor();
            this.formEditor1.Editor.Document  = doc1;
            this.formEditor1.Editor.AliasName = "Left Editor";

            //에디터 2에 문서 소스 설정
            this.formEditor2 = new FormEditor();
            this.formEditor2.Editor.Document  = doc2;
            this.formEditor2.Editor.AliasName = "Right Editor";

            //소스 문서(IDocument) 가 변경될경우 다른 멀티 뷰에 이를 통지가능하도록 이벤트 핸들러 등록
            this.formEditor1.Editor.OnDocumentSourceChanged += Editor1_OnDocumentSourceChanged;
            this.formEditor2.Editor.OnDocumentSourceChanged += Editor2_OnDocumentSourceChanged;

            // 기본 펜 개체 생성
            var pen1 = new PenDefault();

            doc1.Action.ActEntityAdd(pen1);
            var pen2 = new PenDefault();

            doc2.Action.ActEntityAdd(pen2);

            // 에디터1 와 하드웨어 연결
            this.formEditor1.Editor.Rtc    = rtc1;
            this.formEditor1.Editor.Laser  = laser1;
            this.formEditor1.Editor.Marker = marker1;

            //에디터1 와 하드웨어 연결
            this.formEditor2.Editor.Rtc    = rtc2;
            this.formEditor2.Editor.Laser  = laser2;
            this.formEditor2.Editor.Marker = marker2;

            // 뷰어를 초기화면에 출력
            SwitchForm(panel3, this.formViewer);
        }
Example #14
0
        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();
        }
Example #15
0
        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 source
            ILaser laser = new LaserVirtual(0, "virtual", 20.0f);
            laser.Initialize();
            laser.CtlPower(rtc, 8.0f);
            #endregion

            #region create entity at 0,0 location
            var doc   = new DocumentDefault("3x3 scanner field correction");
            var layer = new Layer("default");
            doc.Layers.Add(layer);
            layer.Add(new Spiral(0.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("'M' : draw entities by marker");
                Console.WriteLine("'O' : draw entities by marker with offsets");
                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.M:
                    Console.WriteLine("\r\nWARNING !!! LASER IS BUSY ...");
                    DrawByMarker(doc, rtc, laser);
                    break;

                case ConsoleKey.O:
                    Console.WriteLine("\r\nWARNING !!! LASER IS BUSY ...");
                    DrawByMarkerWithOffset(doc, rtc, laser);
                    break;
                }
            } while (true);

            rtc.Dispose();
        }
Example #16
0
        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 source
            ILaser laser = new LaserVirtual(0, "virtual", 10.0f);
            laser.Initialize();
            var pen = new Pen
            {
                Power = 10.0f,
            };
            laser.CtlPower(rtc, pen);
            #endregion

            #region create entity at 0,0 location
            var doc   = new DocumentDefault("3x3 scanner field correction");
            var layer = new Layer("default");
            doc.Layers.Add(layer);
            layer.Add(new Spiral(0.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("'M' : draw entities by marker");
                Console.WriteLine("'O' : draw entities by marker with offsets");
                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.M:
                    Console.WriteLine("\r\nWARNING !!! LASER IS BUSY ...");
                    DrawByMarker(doc, rtc, laser);
                    break;

                case ConsoleKey.O:
                    Console.WriteLine("\r\nWARNING !!! LASER IS BUSY ...");
                    DrawByMarkerWithOffset(doc, rtc, laser);
                    break;
                }
            } while (true);

            rtc.Dispose();
        }
Example #17
0
        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();
        }
Example #18
0
        public FormMain()
        {
            InitializeComponent();

            SpiralLab.Core.Initialize();

            //Rtc 2개 생성
            var rtc1 = new RtcVirtual(0, "output1.txt");
            var rtc2 = new RtcVirtual(1, "output2.txt");
            //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

            var correctionFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "correction", "cor_1to1.ct5");

            rtc1.Initialize(1000, LaserMode.Yag1, correctionFile);
            rtc2.Initialize(1000, LaserMode.Yag1, correctionFile);

            //Laser 2개 생성
            var laser1 = new LaserVirtual(0, "Virtual Laser1", 20);

            laser1.Initialize();
            var laser2 = new LaserVirtual(1, "Virtual Laser2", 20);

            laser2.Initialize();

            //Marker 2개 생성
            var marker1 = new MarkerDefault(0);
            var marker2 = new MarkerDefault(1);

            //두개의 문서 생성
            var doc1 = new DocumentDefault();
            var doc2 = new DocumentDefault();

            //뷰어에 문서 소스 설정
            this.formViewer = new FormViewer();
            this.formViewer.Viewer1.Document  = doc1;
            this.formViewer.Viewer1.AliasName = "Left Viewer";
            this.formViewer.Viewer2.Document  = doc2;
            this.formViewer.Viewer2.AliasName = "Right Viewer";

            //에디터 1에 문서 소스 설정
            this.formEditor1 = new FormEditor();
            this.formEditor1.Editor.Document  = doc1;
            this.formEditor1.Editor.AliasName = "Left Editor";

            //에디터 2에 문서 소스 설정
            this.formEditor2 = new FormEditor();
            this.formEditor2.Editor.Document  = doc2;
            this.formEditor2.Editor.AliasName = "Right Editor";

            //소스 문서(IDocument) 가 변경될경우 다른 멀티 뷰에 이를 통지가능하도록 이벤트 핸들러 등록
            this.formEditor1.Editor.OnDocumentSourceChanged += Editor1_OnDocumentSourceChanged;
            this.formEditor2.Editor.OnDocumentSourceChanged += Editor2_OnDocumentSourceChanged;

            // 에디터1 와 하드웨어 연결
            this.formEditor1.Editor.Rtc    = rtc1;
            this.formEditor1.Editor.Laser  = laser1;
            this.formEditor1.Editor.Marker = marker1;

            //에디터1 와 하드웨어 연결
            this.formEditor2.Editor.Rtc    = rtc2;
            this.formEditor2.Editor.Laser  = laser2;
            this.formEditor2.Editor.Marker = marker2;

            // 뷰어를 초기화면에 출력
            SwitchForm(panel3, this.formViewer);
        }