Пример #1
0
        private static void DrawByMarker(IRtc rtc, ILaser laser, IMarker marker)
        {
            #region load from sirius file
            var dlg = new OpenFileDialog();
            dlg.Filter = "sirius data files (*.sirius)|*.sirius|dxf cad files (*.dxf)|*.dxf|All Files (*.*)|*.*";
            dlg.Title  = "Open to data file";
            DialogResult result = dlg.ShowDialog();
            if (result != DialogResult.OK)
            {
                return;
            }
            string    ext = Path.GetExtension(dlg.FileName);
            IDocument doc = null;
            if (0 == string.Compare(ext, ".dxf", true))
            {
                doc = DocumentSerializer.OpenDxf(dlg.FileName);
            }
            else if (0 == string.Compare(ext, ".sirius", true))
            {
                doc = DocumentSerializer.OpenSirius(dlg.FileName);
            }
            #endregion

            Debug.Assert(null != doc);
            marker.Ready(doc, rtc, laser);
            marker.Offsets.Clear();
            marker.Offsets.Add((0, 0, 0));
            marker.Start();
        }
Пример #2
0
        private void btnStart_Click(object sender, EventArgs e)
        {
            if (DialogResult.Yes != MessageBox.Show($"Do you really want to start ?", "WARNING!!! LASER", MessageBoxButtons.YesNo, MessageBoxIcon.Question))
            {
                return;
            }

            if (0 == this.marker.Offsets.Count)
            {
                this.marker.Offsets.Add(Offset.Zero);///기본 오프셋 추가
            }
            listBox1.Items.Add($"{DateTime.Now.ToString()} : trying to start ...");
            marker?.Start();
        }
Пример #3
0
        private static bool DrawByMarker(IRtc rtc, ILaser laser, IMarker marker, IMotor motor)
        {
            #region load from sirius file
            var dlg = new OpenFileDialog();
            dlg.Filter = "sirius data files (*.sirius)|*.sirius|dxf cad files (*.dxf)|*.dxf|All Files (*.*)|*.*";
            dlg.Title  = "Open to data file";
            DialogResult result = dlg.ShowDialog();
            if (result != DialogResult.OK)
            {
                return(false);
            }
            string    ext = Path.GetExtension(dlg.FileName);
            IDocument doc = null;
            if (0 == string.Compare(ext, ".dxf", true))
            {
                doc = DocumentSerializer.OpenDxf(dlg.FileName);
            }
            else if (0 == string.Compare(ext, ".sirius", true))
            {
                doc = DocumentSerializer.OpenSirius(dlg.FileName);
            }
            #endregion

            Debug.Assert(null != doc);
            // 마커 가공 준비
            marker.Ready(new MarkerArgDefault()
            {
                Document = doc,
                Rtc      = rtc,
                Laser    = laser,
                MotorZ   = motor,
            });
            // 하나의 오프셋 정보 추가
            marker.MarkerArg.Offsets.Clear();
            marker.MarkerArg.Offsets.Add(Offset.Zero);
            // 가공 시작
            return(marker.Start());
        }