Exemplo n.º 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));
            }
        }
Exemplo n.º 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));
                }
            }
        }
Exemplo n.º 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));
            }
        }
Exemplo n.º 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));
                }
            }
        }