Beispiel #1
0
        /// <summary>
        /// 직선으로 원 그리기
        /// </summary>
        /// <param name="rtc"></param>
        /// <param name="radius"></param>
        /// <param name="durationMsec"></param>
        private static void DrawCircleWithLines(ILaser laser, IRtc rtc, float radius)
        {
            ///스테이지의 원점은 통상 0,0 이기 때문에 - 영역에서는 모션구동이 불가능하므로
            ///+ 영역에서 처리되도록 안전한 위치로 이동하는 코드
            rtc.MatrixStack.Push(radius * 2f, radius * 2f);///transit safety area

            /// 스테이지 + 스캐너 동시 구동하여 원 그리기
            rtc.ListBegin(laser, MotionType.StageAndScanner);
            double x = radius * Math.Sin(0 * Math.PI / 180.0);
            double y = radius * Math.Cos(0 * Math.PI / 180.0);

            rtc.ListJump(new Vector2((float)x, (float)y));

            for (float angle = 10; angle < 360; angle += 10)
            {
                x = radius * Math.Sin(angle * Math.PI / 180.0);
                y = radius * Math.Cos(angle * Math.PI / 180.0);
                rtc.ListMark(new Vector2((float)x, (float)y));
            }
            x = radius * Math.Sin(0 * Math.PI / 180.0);
            y = radius * Math.Cos(0 * Math.PI / 180.0);
            rtc.ListMark(new Vector2((float)x, (float)y));

            rtc.ListEnd();
            rtc.ListExecute(true);
            rtc.MatrixStack.Pop();
        }
Beispiel #2
0
 private static void DrawRectangle(IRtc rtc, double width, double height)
 {
     rtc.ListBegin();
     rtc.ListJump(new System.Numerics.Vector2((float)-width / 2, (float)height / 2));
     rtc.ListMark(new System.Numerics.Vector2((float)width / 2, (float)height / 2));
     rtc.ListMark(new System.Numerics.Vector2((float)width / 2, (float)-height / 2));
     rtc.ListMark(new System.Numerics.Vector2((float)-width / 2, (float)-height / 2));
     rtc.ListMark(new System.Numerics.Vector2((float)-width / 2, (float)height / 2));
     rtc.ListEnd();
 }
Beispiel #3
0
 /// <summary>
 /// 지정된 크기의 직사각형 그리기
 /// </summary>
 /// <param name="rtc"></param>
 /// <param name="width"></param>
 /// <param name="height"></param>
 private static void DrawRectangle(ILaser laser, IRtc rtc, double width, double height)
 {
     rtc.ListBegin(laser);
     rtc.ListJump(new Vector2((float)-width / 2, (float)height / 2));
     rtc.ListMark(new Vector2((float)width / 2, (float)height / 2));
     rtc.ListMark(new Vector2((float)width / 2, (float)-height / 2));
     rtc.ListMark(new Vector2((float)-width / 2, (float)-height / 2));
     rtc.ListMark(new Vector2((float)-width / 2, (float)height / 2));
     rtc.ListEnd();
 }
Beispiel #4
0
        /// <summary>
        /// 지정된 크기의 직사각형 그리기
        /// </summary>
        /// <param name="rtc"></param>
        /// <param name="width"></param>
        /// <param name="height"></param>
        private static void DrawRectangle(ILaser laser, IRtc rtc, double width, double height, double angleStart, double angleEnd)
        {
            rtc.ListBegin(laser);
            for (double angle = angleStart; angle <= angleEnd; angle += 1)
            {
                rtc.MatrixStack.Push(angle);
                rtc.ListJump(new Vector2((float)-width / 2, (float)height / 2));
                rtc.ListMark(new Vector2((float)width / 2, (float)height / 2));
                rtc.ListMark(new Vector2((float)width / 2, (float)-height / 2));
                rtc.ListMark(new Vector2((float)-width / 2, (float)-height / 2));
                rtc.ListMark(new Vector2((float)-width / 2, (float)height / 2));
                rtc.MatrixStack.Pop();
            }

            rtc.ListEnd();
        }
Beispiel #5
0
        private static bool DrawCircle(ILaser laser, IRtc rtc)
        {
            bool success     = true;
            var  rtcDualHead = rtc as IRtcDualHead;

            //리스트 시작
            success &= rtc.ListBegin(laser);
            //리스트 명령으로 오프셋 및 회전 처리 방법
            //rtcDualHead.ListHeadOffset(ScannerHead.Primary, new Vector2(5, 0), 0);
            //rtcDualHead.ListHeadOffset(ScannerHead.Secondary, new Vector2(-5, 0), 0);
            for (int i = 0; i < 10; i++)
            {
                //직선을 그립니다.
                success &= rtc.ListJump(new Vector2(0, 0));
                success &= rtc.ListMark(new Vector2(10, 0));

                success &= rtc.ListJump(new Vector2((float)10, 0));
                success &= rtc.ListArc(new Vector2(0, 0), 360.0f);
                if (!success)
                {
                    break;
                }
            }
            //리스트 명령으로 오프셋 및 회전 처리 방법
            //rtcDualHead.ListHeadOffset(ScannerHead.Primary, Vector2.Zero, 0);
            //rtcDualHead.ListHeadOffset(ScannerHead.Secondary, Vector2.Zero, 0);
            //리스트 종료
            if (success)
            {
                success &= rtc.ListEnd();
                //나머지 데이타 가공 완료 대기
                success &= rtc.ListExecute(true);
            }
            return(success);
        }
Beispiel #6
0
 /// <summary>
 /// 지정된 크기의 직사각형 그리기
 /// </summary>
 /// <param name="rtc"></param>
 /// <param name="width"></param>
 /// <param name="height"></param>
 private static void DrawRectangle(ILaser laser, IRtc rtc, double width, double height)
 {
     ///스테이지의 원점은 통상 0,0 이기 때문에 - 영역에서는 모션구동이 불가능하므로
     ///+ 영역에서 처리되도록 안전한 위치로 이동하는 코드
     rtc.MatrixStack.Push(width * 1.5f, height * 1.5f);///transit safety area
     /// 스테이지만 구동하여 원 그리기
     rtc.ListBegin(laser, MotionType.StageOnly);
     rtc.ListJump(new Vector2((float)-width / 2, (float)height / 2));
     rtc.ListMark(new Vector2((float)width / 2, (float)height / 2));
     rtc.ListMark(new Vector2((float)width / 2, (float)-height / 2));
     rtc.ListMark(new Vector2((float)-width / 2, (float)-height / 2));
     rtc.ListMark(new Vector2((float)-width / 2, (float)height / 2));
     rtc.ListEnd();
     rtc.ListExecute(true);
     rtc.MatrixStack.Pop();
 }
Beispiel #7
0
        /// <summary>
        /// 선 그리기 = 실제 속도 기반 레이저 신호 (주파수 변조) 제어
        /// iDRIVE 기반 스캐너 필요
        /// 가공 출력 조건 = 50KHz (최소 40KHz, 최대 60KHz)
        /// </summary>
        private static bool DrawLine3(ILaser laser, IRtc rtc, float x1, float y1, float x2, float y2)
        {
            var alc = rtc as IRtcAutoLaserControl;

            if (null == alc)
            {
                return(false);
            }
            bool success = true;

            alc.AutoLaserControlByPositionFileName = string.Empty;
            //target frequency : 100KHz
            //lower cut off frequency : 50KHz
            //upper cut off frequency : 120KHz
            success &= alc.CtlAutoLaserControl <float>(AutoLaserControlSignal.Frequency, AutoLaserControlMode.ActualVelocity, 50 * 1000, 40 * 1000, 60 * 1000);
            success &= rtc.ListBegin(laser);
            success &= rtc.ListJump(new Vector2(x1, y1));
            success &= rtc.ListMark(new Vector2(x2, y2));
            if (success)
            {
                success &= rtc.ListEnd();
                success &= rtc.ListExecute(true);
            }
            return(success);
        }
Beispiel #8
0
        private static void DrawCircleWithPosition(ILaser laser, IRtc rtc)
        {
            var motf = rtc as IRtcMOTF;
            /// RTC 15핀 커넥터에 있는 /START , /STOP 입력핀을 시작, 중지 트리거로 사용합니다.
            ///turn on external /start
            ///turn on reset encoder when external start
            var extCtrl = new RtcExternalControlMode();

            extCtrl.Add(RtcExternalControlMode.Signal.EncoderReset);
            extCtrl.Add(RtcExternalControlMode.Signal.ExternalStart);
            extCtrl.Add(RtcExternalControlMode.Signal.ExternalStartAgain);
            motf.CtlExternalControl(extCtrl);


            rtc.ListBegin(laser);
            ///직선을 그립니다. (엔코더 입력과 무관합니다)
            rtc.ListJump(new Vector2(0, 0));
            rtc.ListMark(new Vector2(10, 0));
            /// ListMOTFBegin 부터 ListMOTFEnd 사이의 모든 list 명령어는 엔코더증감값이 적용됩니다
            motf.ListMOTFBegin();
            /// 엔코더 X 값이  10mm 가 넘을때(Over) 까지 리스트 명령을 대기
            motf.ListMOTFWait(RtcEncoder.EncX, 10, EncoderWaitCondition.Over);//wait until encoder x position over 10.0mm
            ///엔코더 X 값이 위 조건을 만족한이후 원 을 그린다
            rtc.ListJump(new Vector2((float)10, 0));
            rtc.ListArc(new Vector2(0, 0), 360.0f);
            /// MOTF 중지및 0,0 위치(스캐너 중심 위치)로 jump 실시
            motf.ListMOTFEnd(Vector2.Zero);

            rtc.ListEnd();
            ///외부 트리거(/START)에 의해 시작되므로 execute 호출은 하지 않는다
            ///rtc.ListExecute(); /// its not need to call because its started by external trigger
        }
Beispiel #9
0
        /// <summary>
        /// draw rectangle
        /// </summary>
        /// <param name="laser"></param>
        /// <param name="rtc"></param>
        /// <param name="width"></param>
        /// <param name="height"></param>
        private static bool DrawRectangle(ILaser laser, IRtc rtc, float width, float height)
        {
            if (rtc.CtlGetStatus(RtcStatus.Busy))
            {
                return(false);
            }
            var rtcMeasurement = rtc as IRtcMeasurement;

            Debug.Assert(rtcMeasurement != null);
            Console.WriteLine("WARNING !!! LASER IS BUSY ... Draw Rectangle");
            timer = Stopwatch.StartNew();
            MeasurementChannel[] channels = new MeasurementChannel[4]
            {
                MeasurementChannel.SampleX,      //X
                MeasurementChannel.SampleY,      //Y
                MeasurementChannel.LaserOn,      //Gate
                MeasurementChannel.OutputPeriod, //KHz
            };
            float hz      = 10000;               //10 KHz
            bool  success = true;

            success &= rtc.ListBegin(laser);
            success &= rtcMeasurement.ListMeasurementBegin(hz, channels); //10 Khz, 4개 채널
            success &= rtc.ListFrequency(50 * 1000, 2);                   // 주파수 50KHz, 펄스폭 2usec
            success &= rtc.ListSpeed(500, 500);                           // 점프, 마크 속도 500mm/s
            success &= rtc.ListDelay(10, 100, 200, 200, 0);               // 스캐너/레이저 지연값
            success &= rtc.ListJump(new Vector2(-width / 2, height / 2));
            success &= rtc.ListMark(new Vector2(width / 2, height / 2));
            success &= rtc.ListMark(new Vector2(width / 2, -height / 2));
            success &= rtc.ListMark(new Vector2(-width / 2, -height / 2));
            success &= rtc.ListMark(new Vector2(-width / 2, height / 2));
            success &= rtcMeasurement.ListMeasurementEnd();
            success &= rtc.ListEnd();
            if (success)
            {
                success &= rtc.ListExecute(true);
            }
            var measurementFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "plot", "measurement_rectangle.txt");

            success &= MeasurementHelper.Save(measurementFile, rtcMeasurement, hz, channels, false);
            if (success)
            {
                Console.WriteLine($"Processing time = {timer.ElapsedMilliseconds / 1000.0:F3}s. plot to file = {measurementFile}");
            }

            return(success);
        }
Beispiel #10
0
        static void Draw(IRtc rtc, ILaser laser, MotionType motionType)
        {
            bool success     = true;
            var  rtcSyncAxis = rtc as IRtcSyncAxis;

            success &= rtcSyncAxis.ListBegin(laser, motionType);
            success &= rtc.ListJump(new Vector2(50, 50));
            success &= rtc.ListMark(new Vector2(100, 50));
            success &= rtc.ListMark(new Vector2(100, 100));
            success &= rtc.ListMark(new Vector2(50, 100));
            success &= rtc.ListMark(new Vector2(50, 50));
            if (success)
            {
                success &= rtc.ListEnd();
                success &= rtc.ListExecute(true);
            }
        }
Beispiel #11
0
        /// <summary>
        /// laser processing
        /// </summary>
        /// <param name="rtc"></param>
        /// <returns></returns>
        public override bool Mark(IRtc rtc)
        {
            bool success = true;

            ///jump to start pos
            success &= rtc.ListJump(new Vector2((float)this.StartX, (float)this.StartY));
            ///mark to end pos
            success &= rtc.ListMark(new Vector2((float)this.EndX, (float)this.EndY));
            return(success);
        }
Beispiel #12
0
 private static void DrawLinesWithRotate(IRtc rtc, double angleStart, double angleEnd)
 {
     rtc.ListBegin();
     for (double angle = angleStart; angle <= angleEnd; angle += 1)
     {
         rtc.Matrix.Push(angle);
         rtc.ListJump(new System.Numerics.Vector2(-10, 0));
         rtc.ListMark(new System.Numerics.Vector2(10, 0));
         rtc.Matrix.Pop();
     }
     rtc.ListEnd();
 }
Beispiel #13
0
        /// <summary>
        /// laser processing
        /// </summary>
        /// <param name="rtc"></param>
        /// <returns></returns>
        public override bool Mark(IRtc rtc)
        {
            if (this.OutterDiameter <= 0)
            {
                return(false);
            }
            if (this.InnerDiameter > this.OutterDiameter)
            {
                return(false);
            }
            if (this.Revolutions <= 0)
            {
                return(false);
            }

            bool success = true;

            ///translate spiral's center
            rtc.Matrix.Push(this.X, this.Y);
            ///jump to start pos
            success &= rtc.ListJump(new Vector2((float)(this.InnerDiameter / 2.0), 0.0f));
            ///calculate radial pitch
            double radialPitch = (this.OutterDiameter - this.InnerDiameter) / 2.0 / (double)this.Revolutions;

            for (int i = 0; i < this.Revolutions; i++)
            {
                for (double t = 0; t < 360; t += 30.0)  ///360/30 = 12 steps
                {
                    double  angle    = t + 360.0 * (double)i;
                    double  degInRad = angle * Math.PI / 180.0;
                    double  d        = InnerDiameter / 2.0 + radialPitch * (double)i + radialPitch * t / 360.0;
                    Vector2 v2;
                    v2.X     = (float)(d * Math.Cos(degInRad));
                    v2.Y     = (float)(d * Math.Sin(degInRad));
                    success &= rtc.ListMark(v2);
                    if (!success)
                    {
                        break;
                    }
                }
                if (!success)
                {
                    break;
                }
            }
            if (success && this.Closed)
            {
                success &= rtc.ListArc(new Vector2(0.0f, 0.0f), 360.0);
            }

            rtc.Matrix.Pop();
            return(success);
        }
Beispiel #14
0
 /// <summary>
 /// 행렬을 이용해 직선을 그릴때 1도마다 직선을 회전시켜 그리기
 /// </summary>
 /// <param name="rtc"></param>
 /// <param name="angleStart"></param>
 /// <param name="angleEnd"></param>
 private static void DrawLinesWithRotate(ILaser laser, IRtc rtc, double angleStart, double angleEnd)
 {
     rtc.ListBegin(laser);
     for (double angle = angleStart; angle <= angleEnd; angle += 1)
     {
         rtc.MatrixStack.Push(angle);
         rtc.ListJump(new Vector2(-10, 0));
         rtc.ListMark(new Vector2(10, 0));
         rtc.MatrixStack.Pop();
     }
     rtc.ListEnd();
 }
Beispiel #15
0
        private static void DoHeavyWork()
        {
            bool  success = true;
            float width   = 1;
            float height  = 1;

            Console.WriteLine("WARNING !!! LASER IS BUSY... DoHeavyWork thread");
            timer    = Stopwatch.StartNew();
            success &= rtc.ListBegin(laser, ListType.Auto); //auto list buffer handling (대량의 데이타를 처리하기 위해 auto 리스트 버퍼 사용)
            success &= rtc.ListJump(new Vector2(-width / 2, height / 2));
            for (int i = 0; i < 1000 * 1000 * 10; i++)
            {
                //list commands = 4 * 1000*1000*10 = 40M counts (4천만개의 리스트 명령)
                success &= rtc.ListMark(new Vector2(width / 2, height / 2));
                success &= rtc.ListMark(new Vector2(width / 2, -height / 2));
                success &= rtc.ListMark(new Vector2(-width / 2, -height / 2));
                success &= rtc.ListMark(new Vector2(-width / 2, height / 2));
                if (!success)
                {
                    break;
                }
            }
            if (success)
            {
                success &= rtc.ListEnd();
                success &= rtc.ListExecute();
            }
            if (success)
            {
                Console.WriteLine("Success to mark by DoHeavyWork thread");
            }
            else
            {
                Console.WriteLine("Fail to mark by DoHeavyWork thread !");
            }
            Console.WriteLine($"Processing time = {timer.ElapsedMilliseconds / 1000.0:F3}s");
        }
Beispiel #16
0
        /// <summary>
        /// 지정된 크기의 직사각형 그리기
        /// </summary>
        /// <param name="rtc"></param>
        /// <param name="width"></param>
        /// <param name="height"></param>
        private static bool DrawRectangle(ILaser laser, IRtc rtc, double width, double height, double angleStart, double angleEnd)
        {
            bool success = true;

            success &= rtc.ListBegin(laser);
            for (double angle = angleStart; angle <= angleEnd; angle += 1)
            {
                //회전 각도를 행렬 스택에 push
                rtc.MatrixStack.Push(angle);
                success &= rtc.ListJump(new Vector2((float)-width / 2, (float)height / 2));
                success &= rtc.ListMark(new Vector2((float)width / 2, (float)height / 2));
                success &= rtc.ListMark(new Vector2((float)width / 2, (float)-height / 2));
                success &= rtc.ListMark(new Vector2((float)-width / 2, (float)-height / 2));
                success &= rtc.ListMark(new Vector2((float)-width / 2, (float)height / 2));
                //이전에 push 된 행렬값을 pop 하여 삭제
                rtc.MatrixStack.Pop();
            }
            if (success)
            {
                success &= rtc.ListEnd();
                success &= rtc.ListExecute(true);
            }
            return(success);
        }
Beispiel #17
0
        /// <summary>
        /// draw rectangle
        /// </summary>
        /// <param name="laser"></param>
        /// <param name="rtc"></param>
        /// <param name="width"></param>
        /// <param name="height"></param>
        private static bool DrawRectangle(ILaser laser, IRtc rtc, float width, float height)
        {
            if (rtc.CtlGetStatus(RtcStatus.Busy))
            {
                return(false);
            }
            Console.WriteLine("WARNING !!! LASER IS BUSY ... DrawRectangle");
            timer = Stopwatch.StartNew();
            bool success = true;

            success &= rtc.ListBegin(laser);
            success &= rtc.ListJump(new Vector2(-width / 2, height / 2));
            success &= rtc.ListMark(new Vector2(width / 2, height / 2));
            success &= rtc.ListMark(new Vector2(width / 2, -height / 2));
            success &= rtc.ListMark(new Vector2(-width / 2, -height / 2));
            success &= rtc.ListMark(new Vector2(-width / 2, height / 2));
            success &= rtc.ListEnd();
            if (success)
            {
                success &= rtc.ListExecute(true);
            }
            Console.WriteLine($"Processing time = {timer.ElapsedMilliseconds / 1000.0:F3}s");
            return(success);
        }
Beispiel #18
0
        /// <summary>
        /// 행렬을 이용해 직선을 그릴때 1도마다 직선을 회전시켜 그리기
        /// </summary>
        /// <param name="rtc"></param>
        /// <param name="angleStart"></param>
        /// <param name="angleEnd"></param>
        private static bool DrawLinesWithRotate(ILaser laser, IRtc rtc, double angleStart, double angleEnd)
        {
            bool success = true;

            success &= rtc.ListBegin(laser);
            rtc.MatrixStack.Push(2, 4); // dx =2, dy=4 만큼 이동
            for (double angle = angleStart; angle <= angleEnd; angle += 1)
            {
                rtc.MatrixStack.Push(angle);
                success &= rtc.ListJump(new Vector2(-10, 0));
                success &= rtc.ListMark(new Vector2(10, 0));
                rtc.MatrixStack.Pop();
            }
            rtc.MatrixStack.Pop();
            if (success)
            {
                success &= rtc.ListEnd();
                success &= rtc.ListExecute(true);
            }
            return(success);
        }
Beispiel #19
0
        private static bool MotfWithCircleAndWaitEncoder(ILaser laser, IRtc rtc, bool externalStart)
        {
            var  rtcMotf      = rtc as IRtcMOTF;
            var  rtcExtension = rtc as IRtcExtension;
            bool success      = true;

            // 리스트 시작
            success &= rtc.ListBegin(laser, ListType.Single);
            // 직선을 그립니다. (엔코더 입력과 무관합니다)
            success &= rtc.ListJump(new Vector2(0, 0));
            success &= rtc.ListMark(new Vector2(0, 10));
            // ListMOTFBegin 부터 ListMOTFEnd 사이의 모든 list 명령어는 엔코더증감값이 적용됩니다
            success &= rtcMotf.ListMOTFBegin();
            // 엔코더 X 값이 10mm 가 넘을때(Over) 까지 리스트 명령들이 모두 대기됨
            success &= rtcMotf.ListMOTFWait(RtcEncoder.EncX, 10, EncoderWaitCondition.Over);
            // 엔코더 X 값이 위 조건을 만족한 이후 원 을 그린다
            success &= rtc.ListJump(new Vector2((float)10, 0));
            success &= rtc.ListArc(new Vector2(0, 0), 360.0f);
            // MOTF 중지및 0,0 위치(스캐너 중심 위치)로 jump 실시
            success &= rtcMotf.ListMOTFEnd(Vector2.Zero);
            success &= rtc.ListEnd();
            if (externalStart)
            {
                // RTC 15핀 커넥터에 있는 /START 을 리스트 시작 트리거로 사용합니다.
                var extCtrl = new Rtc5ExternalControlMode();
                extCtrl.Add(Rtc5ExternalControlMode.Bit.ExternalStart);
                extCtrl.Add(Rtc5ExternalControlMode.Bit.ExternalStartAgain);
                rtcExtension.CtlExternalControl(extCtrl);
            }
            else
            {
                // 외부 트리거(/START) 미사용
                rtcExtension.CtlExternalControl(Rtc5ExternalControlMode.Empty);
                if (success)
                {
                    success &= rtc.ListExecute();
                }
            }
            return(success);
        }
Beispiel #20
0
        /// <summary>
        /// 선 그리기 = 지령 속도 기반 레이저 신호 (아나로그 ~10V) 제어
        /// 가공 출력 조건 = 5V (최소 4V, 최대 6V)
        /// </summary>
        private static bool DrawLine1(ILaser laser, IRtc rtc, float x1, float y1, float x2, float y2)
        {
            var alc = rtc as IRtcAutoLaserControl;

            if (null == alc)
            {
                return(false);
            }
            bool success = true;

            alc.AutoLaserControlByPositionFileName = string.Empty;
            success &= alc.CtlAutoLaserControl <float>(AutoLaserControlSignal.Analog1, AutoLaserControlMode.SetVelocity, 5, 4, 6);
            success &= rtc.ListBegin(laser);
            success &= rtc.ListJump(new Vector2(x1, y1));
            success &= rtc.ListMark(new Vector2(x2, y2));
            if (success)
            {
                success &= rtc.ListEnd();
                success &= rtc.ListExecute(true);
            }
            return(success);
        }
Beispiel #21
0
        /// <summary>
        /// 선 그리기 = 벡터 위치 기반 레이저 신호(아나로그) 제어
        /// </summary>
        private static bool DrawLine4(ILaser laser, IRtc rtc, float x1, float y1, float x2, float y2)
        {
            var alc = rtc as IRtcAutoLaserControl;

            if (null == alc)
            {
                return(false);
            }
            bool success = true;

            success &= rtc.ListBegin(laser);
            success &= alc.ListAlcByVectorBegin <float>(AutoLaserControlSignal.Analog1, 5F); // 아나로그 출력 초기값 : 5V
            success &= rtc.ListJump(new Vector2(x1, y1), 0.5F);                              //시작 위치로 점프 5V * 0.5 = 2.5V 로 시작
            success &= rtc.ListMark(new Vector2(x2, y2), 1.5F);                              //끝 위치로 마크 5V * 1.5 = 7.5V 로 끝
            success &= alc.ListAlcByVectorEnd();
            if (success)
            {
                success &= rtc.ListEnd();
                success &= rtc.ListExecute(true);
            }
            return(success);
        }
Beispiel #22
0
        /// <summary>
        /// 폰트 RTC 내부 리스트 메모리에 등록
        /// </summary>
        /// <param name="laser"></param>
        /// <param name="rtc"></param>
        private static void CreateCharacterSet(ILaser laser, IRtc rtc)
        {
            var rtcCharSet = rtc as IRtcCharacterSet;

            //폰트 등록
            // 총 4개의 character set 등록 가능
            // 기본값  0 번 character set 으로 등록됨
            // example font : 0~9(숫자) ;(콜론) -(대쉬)
            rtcCharSet.CtlCharacterBegin('0');
            rtc.ListJump(new Vector2(5, 10));
            rtc.ListMark(new Vector2(5 + 0, 10 - 5));
            rtc.ListMark(new Vector2(5 + 0 + 0, 10 - 5 - 5));
            rtc.ListMark(new Vector2(5 + 0 + 0 - 5, 10 - 5 - 5));
            rtc.ListMark(new Vector2(5 + 0 + 0 - 5, 10 - 5 - 5 + 5));
            rtc.ListMark(new Vector2(5 + 0 + 0 - 5 + 0, 10 - 5 - 5 + 5 + 5));
            rtc.ListMark(new Vector2(5 + 0 + 0 - 5 + 0 + 5, 10 - 5 - 5 + 5 + 5 + 0));
            rtc.ListJump(new Vector2(5 + 0 + 0 - 5 + 0 + 5 + 5, 10 - 5 - 5 + 5 + 5 + 0 - 10));
            rtcCharSet.CtlCharacterEnd();

            rtcCharSet.CtlCharacterBegin('1');
            rtc.ListJump(new Vector2(5, 0));
            rtc.ListMark(new Vector2(5 + 0, 0 + 10));
            rtc.ListJump(new Vector2(5 + 0 + 5, 0 + 10 - 10));
            rtcCharSet.CtlCharacterEnd();

            rtcCharSet.CtlCharacterBegin('2');
            rtc.ListJump(new Vector2(0, 10));
            rtc.ListMark(new Vector2(0 + 5, 10 + 0));
            rtc.ListMark(new Vector2(0 + 5 + 0, 10 + 0 - 5));
            rtc.ListMark(new Vector2(0 + 5 + 0 - 5, 10 + 0 - 5 + 0));
            rtc.ListMark(new Vector2(0 + 5 + 0 - 5 + 0, 10 + 0 - 5 + 0 - 5));
            rtc.ListMark(new Vector2(0 + 5 + 0 - 5 + 0 + 5, 10 + 0 - 5 + 0 - 5 + 0));
            rtc.ListJump(new Vector2(0 + 5 + 0 - 5 + 0 + 5 + 5, 10 + 0 - 5 + 0 - 5 + 0 + 0));
            rtcCharSet.CtlCharacterEnd();

            rtcCharSet.CtlCharacterBegin('3');
            rtc.ListJump(new Vector2(0, 10));
            rtc.ListMark(new Vector2(0 + 5, 10 + 0));
            rtc.ListMark(new Vector2(0 + 5 + 0, 10 + 0 - 5));
            rtc.ListMark(new Vector2(0 + 5 + 0 - 5, 10 + 0 - 5 + 0));
            rtc.ListJump(new Vector2(0 + 5 + 0 - 5 + 5, 10 + 0 - 5 + 0 + 0));
            rtc.ListMark(new Vector2(0 + 5 + 0 - 5 + 5 + 0, 10 + 0 - 5 + 0 + 0 - 5));
            rtc.ListMark(new Vector2(0 + 5 + 0 - 5 + 5 + 0 - 5, 10 + 0 - 5 + 0 + 0 - 5 + 0));
            rtc.ListJump(new Vector2(0 + 5 + 0 - 5 + 5 + 0 - 5 + 10, 10 + 0 - 5 + 0 + 0 - 5 + 0 + 0));
            rtcCharSet.CtlCharacterEnd();

            rtcCharSet.CtlCharacterBegin('4');
            rtc.ListJump(new Vector2(0, 10));
            rtc.ListMark(new Vector2(0 + 0, 10 - 5));
            rtc.ListMark(new Vector2(0 + 0 + 5, 10 - 5 + 0));
            rtc.ListJump(new Vector2(0 + 0 + 5 + 0, 10 - 5 + 0 + 5));
            rtc.ListMark(new Vector2(0 + 0 + 5 + 0 + 0, 10 - 5 + 0 + 5 - 10));
            rtc.ListJump(new Vector2(0 + 0 + 5 + 0 + 0 + 5, 10 - 5 + 0 + 5 - 10 + 0));
            rtcCharSet.CtlCharacterEnd();

            rtcCharSet.CtlCharacterBegin('5');
            rtc.ListJump(new Vector2(5, 10));
            rtc.ListMark(new Vector2(5 - 5, 10 + 0));
            rtc.ListMark(new Vector2(5 - 5 + 0, 10 + 0 - 5));
            rtc.ListMark(new Vector2(5 - 5 + 0 + 5, 10 + 0 - 5 + 0));
            rtc.ListMark(new Vector2(5 - 5 + 0 + 5 + 0, 10 + 0 - 5 + 0 - 5));
            rtc.ListMark(new Vector2(5 - 5 + 0 + 5 + 0 - 5, 10 + 0 - 5 + 0 - 5 + 0));
            rtc.ListJump(new Vector2(5 - 5 + 0 + 5 + 0 - 5 + 10, 10 + 0 - 5 + 0 - 5 + 0 + 0));
            rtcCharSet.CtlCharacterEnd();

            rtcCharSet.CtlCharacterBegin('6');
            rtc.ListJump(new Vector2(5, 10));
            rtc.ListMark(new Vector2(5 - 5, 10 + 0));
            rtc.ListMark(new Vector2(5 - 5 + 0, 10 + 0 - 5));
            rtc.ListMark(new Vector2(5 - 5 + 0 + 0, 10 + 0 - 5 - 5));
            rtc.ListMark(new Vector2(5 - 5 + 0 + 0 + 5, 10 + 0 - 5 - 5 + 0));
            rtc.ListMark(new Vector2(5 - 5 + 0 + 0 + 5 + 0, 10 + 0 - 5 - 5 + 0 + 5));
            rtc.ListMark(new Vector2(5 - 5 + 0 + 0 + 5 + 0 - 5, 10 + 0 - 5 - 5 + 0 + 5 + 0));
            rtc.ListJump(new Vector2(5 - 5 + 0 + 0 + 5 + 0 - 5 + 10, 10 + 0 - 5 - 5 + 0 + 5 + 0 - 5));
            rtcCharSet.CtlCharacterEnd();

            rtcCharSet.CtlCharacterBegin('7');
            rtc.ListJump(new Vector2(0, 10));
            rtc.ListMark(new Vector2(0 + 5, 10 + 0));
            rtc.ListMark(new Vector2(0 + 5 + 0, 10 + 0 - 5));
            rtc.ListMark(new Vector2(0 + 5 + 0 + 0, 10 + 0 - 5 - 5));
            rtc.ListJump(new Vector2(0 + 5 + 0 + 0 + 5, 10 + 0 - 5 - 5 + 0));
            rtcCharSet.CtlCharacterEnd();

            rtcCharSet.CtlCharacterBegin('8');
            rtc.ListJump(new Vector2(5, 10));
            rtc.ListMark(new Vector2(5 - 5, 10 + 0));
            rtc.ListMark(new Vector2(5 - 5 + 0, 10 + 0 - 5));
            rtc.ListMark(new Vector2(5 - 5 + 0 + 5, 10 + 0 - 5 + 0));
            rtc.ListMark(new Vector2(5 - 5 + 0 + 5 + 0, 10 + 0 - 5 + 0 + 5));
            rtc.ListJump(new Vector2(5 - 5 + 0 + 5 + 0 + 0, 10 + 0 - 5 + 0 + 5 - 5));
            rtc.ListMark(new Vector2(5 - 5 + 0 + 5 + 0 + 0 + 0, 10 + 0 - 5 + 0 + 5 - 5 - 5));
            rtc.ListMark(new Vector2(5 - 5 + 0 + 5 + 0 + 0 + 0 - 5, 10 + 0 - 5 + 0 + 5 - 5 - 5 + 0));
            rtc.ListMark(new Vector2(5 - 5 + 0 + 5 + 0 + 0 + 0 - 5 + 0, 10 + 0 - 5 + 0 + 5 - 5 - 5 + 0 + 5));
            rtc.ListJump(new Vector2(5 - 5 + 0 + 5 + 0 + 0 + 0 - 5 + 0 + 10, 10 + 0 - 5 + 0 + 5 - 5 - 5 + 0 + 5 - 5));
            rtcCharSet.CtlCharacterEnd();

            rtcCharSet.CtlCharacterBegin('9');
            rtc.ListJump(new Vector2(5, 10));
            rtc.ListMark(new Vector2(5 - 5, 10 + 0));
            rtc.ListMark(new Vector2(5 - 5 + 0, 10 + 0 - 5));
            rtc.ListMark(new Vector2(5 - 5 + 0 + 5, 10 + 0 - 5 + 0));
            rtc.ListMark(new Vector2(5 - 5 + 0 + 5 + 0, 10 + 0 - 5 + 0 + 5));
            rtc.ListJump(new Vector2(5 - 5 + 0 + 5 + 0 + 0, 10 + 0 - 5 + 0 + 5 - 5));
            rtc.ListMark(new Vector2(5 - 5 + 0 + 5 + 0 + 0 + 0, 10 + 0 - 5 + 0 + 5 - 5 - 5));
            rtc.ListMark(new Vector2(5 - 5 + 0 + 5 + 0 + 0 + 0 - 5, 10 + 0 - 5 + 0 + 5 - 5 - 5 + 0));
            rtc.ListJump(new Vector2(5 - 5 + 0 + 5 + 0 + 0 + 0 - 5 + 10, 10 + 0 - 5 + 0 + 5 - 5 - 5 + 0 + 0));
            rtcCharSet.CtlCharacterEnd();

            rtcCharSet.CtlCharacterBegin(';');
            rtc.ListJump(new Vector2(0, 2));
            rtc.ListMark(new Vector2(0 + 2, 2 + 0));
            rtc.ListMark(new Vector2(0 + 2 + 0, 2 + 0 + 2));
            rtc.ListMark(new Vector2(0 + 2 + 0 - 2, 2 + 0 + 2 + 0));
            rtc.ListMark(new Vector2(0 + 2 + 0 - 2 + 0, 2 + 0 + 2 + 0 - 2));
            rtc.ListJump(new Vector2(0 + 2 + 0 - 2 + 0 + 0, 2 + 0 + 2 + 0 - 2 + 4));
            rtc.ListMark(new Vector2(0 + 2 + 0 - 2 + 0 + 0 + 2, 2 + 0 + 2 + 0 - 2 + 4 + 0));
            rtc.ListMark(new Vector2(0 + 2 + 0 - 2 + 0 + 0 + 2 + 0, 2 + 0 + 2 + 0 - 2 + 4 + 0 + 2));
            rtc.ListMark(new Vector2(0 + 2 + 0 - 2 + 0 + 0 + 2 + 0 - 2, 2 + 0 + 2 + 0 - 2 + 4 + 0 + 2 + 0));
            rtc.ListMark(new Vector2(0 + 2 + 0 - 2 + 0 + 0 + 2 + 0 - 2 + 0, 2 + 0 + 2 + 0 - 2 + 4 + 0 + 2 + 0 - 2));
            rtc.ListJump(new Vector2(0 + 2 + 0 - 2 + 0 + 0 + 2 + 0 - 2 + 0 + 5, 2 + 0 + 2 + 0 - 2 + 4 + 0 + 2 + 0 - 2 - 6));
            rtcCharSet.CtlCharacterEnd();

            rtcCharSet.CtlCharacterBegin(' ');
            rtc.ListJump(new Vector2(5, 0));
            rtcCharSet.CtlCharacterEnd();

            rtcCharSet.CtlCharacterBegin('-');
            rtc.ListJump(new Vector2(0, 5));
            rtc.ListMark(new Vector2(0 + 5, 5 + 0));
            rtc.ListJump(new Vector2(0 + 5 + 5, 5 + 0 - 5));
            rtcCharSet.CtlCharacterEnd();
        }