예제 #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));
                }
            }
        }