static void Main(string[] args) { SpiralLab.Core.Initialize(); #region initialize RTC var rtc = new RtcCustom(0); ///your custom rtc 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 laser", 10.0f); laser.Initialize(); var pen = new Pen { Power = 5.0f, }; laser.CtlPower(rtc, pen); #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 circle"); Console.WriteLine("'L' : pop up your custom rtc 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.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.L: Console.WriteLine("\r\nLASER FORM"); rtc.Form.ShowDialog(); break; } } while (true); rtc.Dispose(); }
public RtcCustomForm(RtcCustom rtc) { InitializeComponent(); this.rtc = rtc; }