コード例 #1
0
        private void TryOpenGCode(string path)
        {
            try
            {
                StreamReader sr = new StreamReader(path);

                try
                {
                    GParser.Reset();
                    List<GCodeCommand> Commands = GParser.Parse(sr);

                    GCodePreview prev = new GCodePreview(Commands, this, path);

                    HeightMapUpdated += prev.HeightMapUpdated;

                    prev.Show();
                    prev.BringToFront();
                }

                catch (Exception ex)
                {
                    MessageBox.Show(string.Format("Error while parsing file {0}\n{1}", path, ex.Message));
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(string.Format("Error while opening file {0}\n{1}", path, ex.Message));
            }
        }
コード例 #2
0
        private void openFileDialogGCode_FileOk(object sender, CancelEventArgs e)
        {
            foreach (string path in openFileDialogGCode.FileNames)
            {
                try
                {
                    StreamReader sr = new StreamReader(path);

                    try
                    {
                        GParser.Reset();
                        List<GCodeCommand> Commands = GParser.Parse(sr);

                        GCodePreview prev = new GCodePreview(Commands, this, path);

                        HeightMapUpdated += prev.HeightMapUpdated;

                        prev.Show();
                        prev.BringToFront();
                    }

                    catch (Exception ex)
                    {
                        MessageBox.Show(string.Format("Error while parsing file {0}\n{1}", path, ex.Message));
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(string.Format("Error while opening file {0}\n{1}", path, ex.Message));
                }
            }
        }
コード例 #3
0
        private void TryOpenGCode(string path)
        {
            try
            {
                StreamReader sr = new StreamReader(path);

                try
                {
                    GParser.Reset();
                    List <GCodeCommand> Commands = GParser.Parse(sr);

                    GCodePreview prev = new GCodePreview(Commands, this, path);

                    HeightMapUpdated += prev.HeightMapUpdated;

                    prev.Show();
                    prev.BringToFront();
                }

                catch (Exception ex)
                {
                    MessageBox.Show(string.Format("Error while parsing file {0}\n{1}", path, ex.Message));
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(string.Format("Error while opening file {0}\n{1}", path, ex.Message));
            }
        }
コード例 #4
0
        private void openFileDialogGCode_FileOk(object sender, CancelEventArgs e)
        {
            foreach (string path in openFileDialogGCode.FileNames)
            {
                try
                {
                    StreamReader sr = new StreamReader(path);

                    try
                    {
                        GParser.Reset();
                        List <GCodeCommand> Commands = GParser.Parse(sr);

                        GCodePreview prev = new GCodePreview(Commands, this, path);

                        HeightMapUpdated += prev.HeightMapUpdated;

                        prev.Show();
                        prev.BringToFront();
                    }

                    catch (Exception ex)
                    {
                        MessageBox.Show(string.Format("Error while parsing file {0}\n{1}", path, ex.Message));
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(string.Format("Error while opening file {0}\n{1}", path, ex.Message));
                }
            }
        }