Esempio n. 1
0
        public void LoadGCodeOrSTL(string file)
        {
            if (!File.Exists(file))
            {
                return;
            }
            FileInfo f = new FileInfo(file);

            Title = f.Name;
            fileHistory.Save(file);
            UpdateHistory();
            if (file.EndsWith(".stl"))
            {
                if (MessageBox.Show("Do you want to slice the STL-File? No adds it to the object grid.", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    slicer.RunSlice(file); // Slice it and load
                }
                else
                {
                    stlComposer1.openAndAddObject(file);
                }
            }
            else
            {
                editor.setContent(0, System.IO.File.ReadAllText(file));
                tab.SelectTab(tabGCode);
                editor.selectContent(0);
            }
        }