Esempio n. 1
0
        public MainForm()
        {
            InitializeComponent();

            MMn.Renderer = new MMnRenderer();

            splitContainer1.FixedPanel       = FixedPanel.Panel1;
            splitContainer1.SplitterDistance = Settings.GetObject("MainForm Splitter Position", 260);
            MnNotifyNewVersion.Checked       = Settings.GetObject("Auto Update", true);
            MnNotifyMinorVersion.Checked     = Settings.GetObject("Auto Update Build", false);
            MnNotifyPreRelease.Checked       = Settings.GetObject("Auto Update Pre", false);

            MnAutoUpdate.DropDown.Closing += MnAutoUpdateDropDown_Closing;

            if (System.Threading.Thread.CurrentThread.Name == null)
            {
                System.Threading.Thread.CurrentThread.Name = "Main Thread";
            }

            using (SplashScreenForm f = new SplashScreenForm())
                f.ShowDialog();

            //build main communication object
            Firmware ftype = Settings.GetObject("Firmware Type", Firmware.Grbl);

            if (ftype == Firmware.Smoothie)
            {
                Core = new SmoothieCore(this, PreviewForm, JogForm);
            }
            else if (ftype == Firmware.Marlin)
            {
                Core = new MarlinCore(this, PreviewForm, JogForm);
            }
            else
            {
                Core = new GrblCore(this, PreviewForm, JogForm);
            }

            ExceptionManager.Core = Core;

            MnGrblConfig.Visible = Core.UIShowGrblConfig;
            MnUnlock.Visible     = Core.UIShowUnlockButtons;

            MnGrbl.Text = Core.Type.ToString();

            Core.MachineStatusChanged += OnMachineStatus;
            Core.OnFileLoaded         += OnFileLoaded;
            Core.OnOverrideChange     += RefreshOverride;
            Core.IssueDetected        += OnIssueDetected;

            PreviewForm.SetCore(Core);
            ConnectionForm.SetCore(Core);
            JogForm.SetCore(Core);

            GitHub.NewVersion += GitHub_NewVersion;

            ColorScheme.CurrentScheme = Settings.GetObject("Color Schema", ColorScheme.Scheme.BlueLaser);;
            RefreshColorSchema();             //include RefreshOverride();
            RefreshFormTitle();
        }
Esempio n. 2
0
        public MainForm()
        {
            InitializeComponent();

            MMn.Renderer = new MMnRenderer();

            splitContainer1.FixedPanel          = FixedPanel.Panel1;
            splitContainer1.SplitterDistance    = (int)Settings.GetObject("MainForm Splitter Position", 260);
            autoUpdateToolStripMenuItem.Checked = (bool)Settings.GetObject("Auto Update", true);

            if (System.Threading.Thread.CurrentThread.Name == null)
            {
                System.Threading.Thread.CurrentThread.Name = "Main Thread";
            }

            using (SplashScreenForm f = new SplashScreenForm())
                f.ShowDialog();

            //build main communication object
            Core = new GrblCore(this);
            Core.MachineStatusChanged += OnMachineStatus;
            Core.OnFileLoaded         += OnFileLoaded;
            Core.OnOverrideChange     += RefreshOverride;

            PreviewForm.SetCore(Core);
            ConnectionForm.SetCore(Core);
            JogForm.SetCore(Core);

            GitHub.NewVersion += GitHub_NewVersion;

            ColorScheme.CurrentScheme = (ColorScheme.Scheme)Settings.GetObject("Color Schema", ColorScheme.Scheme.BlueLaser);;
            RefreshColorSchema();             //include RefreshOverride();
        }
Esempio n. 3
0
        public MainForm()
        {
            InitializeComponent();

            MMn.Renderer = new MMnRenderer();

            splitContainer1.FixedPanel          = FixedPanel.Panel1;
            splitContainer1.SplitterDistance    = (int)Settings.GetObject("MainForm Splitter Position", 260);
            autoUpdateToolStripMenuItem.Checked = (bool)Settings.GetObject("Auto Update", true);

            if (System.Threading.Thread.CurrentThread.Name == null)
            {
                System.Threading.Thread.CurrentThread.Name = "Main Thread";
            }

            using (SplashScreenForm f = new SplashScreenForm())
                f.ShowDialog();

            //build main communication object
            if ((Firmware)Settings.GetObject("Firmware Type", Firmware.Grbl) == Firmware.Smoothie)
            {
                Core = new SmoothieCore(this, PreviewForm);
            }
            else
            {
                Core = new GrblCore(this, PreviewForm);
            }



            MnGrblConfig.Visible = Core.Type != Firmware.Smoothie;
            MnUnlock.Visible     = Core.Type != Firmware.Smoothie;

            MnGrbl.Text = Core.Type == Firmware.Grbl ? "Grbl" : "Smoothie";

            Core.MachineStatusChanged += OnMachineStatus;
            Core.OnFileLoaded         += OnFileLoaded;
            Core.OnOverrideChange     += RefreshOverride;
            Core.IssueDetected        += OnIssueDetected;

            PreviewForm.SetCore(Core);
            ConnectionForm.SetCore(Core);
            JogForm.SetCore(Core);

            GitHub.NewVersion += GitHub_NewVersion;

            ColorScheme.CurrentScheme = (ColorScheme.Scheme)Settings.GetObject("Color Schema", ColorScheme.Scheme.BlueLaser);;
            RefreshColorSchema(); //include RefreshOverride();
            RefreshFormTitle();
        }