private static bool DrawByMarker(IDocument doc, IRtc rtc, ILaser laser) { var marker = new MarkerDefault(0); marker.Name = "marker #1"; //가공 완료 이벤트 핸들러 등록 marker.OnFinished += Marker_OnFinished; var markerArg = new MarkerArgDefault() { Document = doc, Rtc = rtc, Laser = laser, }; // 하나의 오프셋 정보(0,0 및 회전각도 0) 를 추가한다. markerArg.Offsets.Add(Offset.Zero); bool success = true; // 마커에 가공 문서(doc)및 rtc, laser 정보를 전달하고 가공 준비를 실시한다. success &= marker.Ready(markerArg); // 가공을 시작한다. success &= marker.Start(); return(success); }
private static bool DrawByMarkerWithOffset(IDocument doc, IRtc rtc, ILaser laser) { var marker = new MarkerDefault(0); marker.Name = "marker #2"; //가공 완료 이벤트 핸들러 등록 marker.OnFinished += Marker_OnFinished; var markerArg = new MarkerArgDefault() { Document = doc, Rtc = rtc, Laser = laser, }; // 9개의 오프셋 정보를 추가한다 markerArg.Offsets.Clear(); markerArg.Offsets.Add(new Offset(-20.0f, 20.0f, -90f)); markerArg.Offsets.Add(new Offset(0.0f, 20.0f, 0.0f)); markerArg.Offsets.Add(new Offset(20.0f, 20.0f, 90.0f)); markerArg.Offsets.Add(new Offset(-20.0f, 0.0f, -180.0f)); markerArg.Offsets.Add(new Offset(0.0f, 0.0f, 0.0f)); markerArg.Offsets.Add(new Offset(20.0f, 0.0f, 180.0f)); markerArg.Offsets.Add(new Offset(-20.0f, -20.0f, -270.0f)); markerArg.Offsets.Add(new Offset(0.0f, -20.0f, 0.0f)); markerArg.Offsets.Add(new Offset(20.0f, -20.0f, 270.0f)); bool success = true; // 마커에 가공 문서(doc)및 rtc, laser 정보를 전달하고 가공 준비를 실시한다. success &= marker.Ready(markerArg); // 가공을 시작한다. success &= marker.Start(); return(success); }
/// <summary> /// 레이어 안에 있는 모든 객체들을 마킹하기 /// </summary> /// <param name="laser"></param> /// <param name="rtc"></param> /// <param name="doc"></param> private static bool Draw(ILaser laser, IRtc rtc, IDocument doc) { var markerArg = new MarkerArgDefault() { Document = doc, Rtc = rtc, Laser = laser, }; bool success = true; success &= rtc.ListBegin(laser); foreach (var layer in doc.Layers) { success &= layer.Mark(markerArg); // or //foreach (var entity in layer) //{ // var markerable = entity as IMarkerable; // if (null != markerable) // success &= markerable.Mark(markerArg); //} if (!success) { break; } } if (success) { success &= rtc.ListEnd(); success &= rtc.ListExecute(true); } return(success); }
private void lblMarker_Click(object sender, EventArgs e) { //마커 대화상자 창을 띄운다 var marker = this.siriusEditorForm1.Marker; var markerArg = new MarkerArgDefault() { Document = this.siriusEditorForm1.Document, Rtc = this.siriusEditorForm1.Rtc, Laser = this.siriusEditorForm1.Laser, }; marker.Ready(markerArg); var form = new MotfMarkerForm(marker); form.ShowDialog(this); }
private static bool MarkToDate(ILaser laser, IRtc rtc) { if (rtc.CtlGetStatus(RtcStatus.Busy)) { return(false); } date.FontName = "normal.cxf"; date.Width = 3.0f; date.CapHeight = 3.0f; date.LetterSpacing = 0.2f; date.WordSpacing = 2.0f; date.Align = Alignment.LeftMiddle; date.LetterSpace = LetterSpaceWay.Fixed; date.Location = Vector2.Zero; date.DateFormat = DateFormat.Day; date.IsLeadingWithZero = true; date.Angle = 90; date.Location = new Vector2(0, 10); //data 생성 date.Regen(); date.RegisterCharacterSetIntoRtc(rtc); bool success = true; var rtcCharSet = rtc as IRtcCharacterSet; success &= rtc.ListBegin(laser, ListType.Single); success &= rtc.ListJump(Vector2.Zero); var markerArg = new MarkerArgDefault() { Rtc = rtc, Laser = laser, }; success &= date.Mark(markerArg); success &= rtc.ListJump(new Vector2(10, 0)); if (success) { success &= rtc.ListEnd(); success &= rtc.ListExecute(false); } return(success); }
private static bool MarkToSerial(ILaser laser, IRtc rtc) { if (rtc.CtlGetStatus(RtcStatus.Busy)) { return(false); } serial.FontName = "normal.cxf"; serial.Width = 2.0f; serial.CapHeight = 2.0f; serial.LetterSpacing = 0.2f; serial.WordSpacing = 2.0f; serial.Align = Alignment.LeftMiddle; serial.LetterSpace = LetterSpaceWay.Fixed; serial.Location = Vector2.Zero; serial.NumOfDigits = 4; serial.SerialFormat = SerialFormat.LeadingWithZero; serial.Angle = -90; serial.Location = new Vector2(0, 10); //data 생성 serial.Regen(); serial.RegisterCharacterSetIntoRtc(rtc); bool success = true; var rtcCharSet = rtc as IRtcCharacterSet; success &= rtc.ListBegin(laser, ListType.Single); success &= rtc.ListJump(new Vector2(0, 0)); var markerArg = new MarkerArgDefault() { Rtc = rtc, Laser = laser, }; success &= serial.Mark(markerArg); if (success) { success &= rtc.ListEnd(); success &= rtc.ListExecute(false); } return(success); }
/// <summary> /// 레이어 안에 있는 모든 객체들을 마킹하기 (3x3 의 나선 객체가 마킹됨) /// </summary> /// <param name="rtc"></param> /// <param name="doc"></param> private static bool DrawForFieldCorrection(ILaser laser, IRtc rtc, IDocument doc) { bool success = true; var markerArg = new MarkerArgDefault() { Document = doc, Rtc = rtc, Laser = laser, IsEnablePens = true, //문서(doc) 내부에 사전에 생성된 10개의 펜 집합(Pens)을 사용하므로 이를 활성화 }; success &= rtc.ListBegin(laser); // 레이어 순회 foreach (var layer in doc.Layers) { //레이어 가공 success &= layer.Mark(markerArg); // or // 직접 하나씩 처리방법. 레이어 내의 개체들을 순회 //foreach (var entity in layer) //{ // var markerable = entity as IMarkerable; // // 해당 개체가 레이저 가공이 가능한지 여부를 판별 // if (null != markerable) // success &= markerable.Mark(markerArg); // 레이저 가공 실시 // if (!success) // break; //} if (!success) { break; } } if (success) { success &= rtc.ListEnd(); success &= rtc.ListExecute(true); } return(success); }
private static bool MarkToTime(ILaser laser, IRtc rtc) { if (rtc.CtlGetStatus(RtcStatus.Busy)) { return(false); } time.FontName = "Daum_Regular.ttf"; time.Width = 2.0f; time.CapHeight = 3.0f; time.Align = Alignment.LeftMiddle; time.Location = Vector2.Zero; time.TimeFormat = TimeFormat.Minutes; time.IsLeadingWithZero = true; time.Angle = 180; time.Location = new Vector2(0, 10); //data 생성 time.Regen(); time.RegisterCharacterSetIntoRtc(rtc); bool success = true; var rtcCharSet = rtc as IRtcCharacterSet; success &= rtc.ListBegin(laser, ListType.Single); success &= rtc.ListJump(Vector2.Zero); var markerArg = new MarkerArgDefault() { Rtc = rtc, Laser = laser, }; success &= time.Mark(markerArg); if (success) { success &= rtc.ListEnd(); success &= rtc.ListExecute(false); } return(success); }
/// <summary> /// 지정된 문서(Document)를 지정된 RTC 제어기로 가공하기 /// </summary> /// <param name="laser"></param> /// <param name="rtc"></param> /// <param name="doc"></param> static void DoBegin(ILaser laser, IRtc rtc, IDocument doc) { var timer = Stopwatch.StartNew(); var markerArg = new MarkerArgDefault() { Document = doc, Rtc = rtc, Laser = laser, }; bool success = true; success &= rtc.ListBegin(laser); //레이어를 순회 foreach (var layer in doc.Layers) { success &= layer.Mark(markerArg); // or //레이어 내의 개체(Entity)들을 순회 //foreach (var entity in layer) //{ // var markerable = entity as IMarkerable; // //레이저 가공이 가능한 개체(markerable)인지를 판단 // if (null != markerable) // success &= markerable.Mark(markerArg); // 해당 개체(Entity) 가공 // if (!success) // break; //} if (!success) { break; } } if (success) { success &= rtc.ListEnd(); success &= rtc.ListExecute(true); } Console.WriteLine($"Processing time = {timer.ElapsedMilliseconds / 1000.0:F3}s"); }