예제 #1
0
 private void RefreshColorSchema()
 {
     MMn.BackColor = BackColor = StatusBar.BackColor = ColorScheme.FormBackColor;
     MMn.ForeColor = ForeColor = ColorScheme.FormForeColor;
     blueLaserToolStripMenuItem.Checked = ColorScheme.CurrentScheme == ColorScheme.Scheme.BlueLaser;
     redLaserToolStripMenuItem.Checked  = ColorScheme.CurrentScheme == ColorScheme.Scheme.RedLaser;
     darkToolStripMenuItem.Checked      = ColorScheme.CurrentScheme == ColorScheme.Scheme.Dark;
     hackerToolStripMenuItem.Checked    = ColorScheme.CurrentScheme == ColorScheme.Scheme.Hacker;
     nightyToolStripMenuItem.Checked    = ColorScheme.CurrentScheme == ColorScheme.Scheme.Nighty;
     TTLinkToNews.LinkColor             = ColorScheme.LinkColor;
     TTLinkToNews.VisitedLinkColor      = ColorScheme.VisitedLinkColor;
     ConnectionForm.OnColorChange();
     PreviewForm.OnColorChange();
     RefreshOverride();
 }
예제 #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
            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.Grbl;
            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();
        }
예제 #3
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            UpdateTimer.Enabled = true;


            if (Settings.GetObject("Auto Update", true))
            {
                GitHub.CheckVersion(false);
            }

            SuspendLayout();
            //restore last size and position
            Object[]        msp   = Settings.GetObject <Object[]>("Mainform Size and Position", null);
            FormWindowState state = msp == null ? FormWindowState.Maximized : (FormWindowState)msp[2] != FormWindowState.Minimized ? (FormWindowState)msp[2] : FormWindowState.Maximized;

            if (state == FormWindowState.Normal)
            {
                WindowState = state; Size = (Size)msp[0]; Location = (Point)msp[1];
            }
            ResumeLayout();

            ManageMessage();


            if (args != null && args.Length == 1)
            {
                string filename = args[0];
                if (System.IO.File.Exists(filename))
                {
                    Application.DoEvents();

                    if (System.IO.Path.GetExtension(filename).ToLower() == ".zbn")                     //zipped button
                    {
                        PreviewForm.ImportButton(filename);
                    }
                    else
                    {
                        Core.OpenFile(this, filename, false);
                    }
                }
            }
        }
예제 #4
0
            public CustomButtonIB(GrblCore Core, LaserGRBL.CustomButton cb, PreviewForm form)
            {
                // TODO: Complete member initialization
                this.Core = Core;
                this.cb   = cb;
                this.form = form;
                this.tt   = new ToolTip();

                Image = cb.Image;
                Tag   = cb;

                //ContextMenuStrip = MNRemEditCB;
                SizingMode  = UserControls.ImageButton.SizingModes.FixedSize;
                BorderStyle = BorderStyle.FixedSingle;
                Size        = new Size(49, 49);
                tt.SetToolTip(this, cb.ToolTip);


                cms = new ContextMenuStrip();
                cms.Items.Add("Remove button", null, RemoveButton_Click);
                cms.Items.Add("Edit button", null, EditButton_Click);

                this.ContextMenuStrip = cms;
            }
예제 #5
0
 public SmoothieCore(System.Windows.Forms.Control syncroObject, PreviewForm cbform, JogForm jogform) : base(syncroObject, cbform, jogform)
 {
 }
예제 #6
0
        public MainForm()
        {
            InitializeComponent();

            MnOrtur.Visible = false;
            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 if (ftype == Firmware.VigoWork)
            {
                Core = new VigoCore(this, PreviewForm, JogForm);
            }
            else
            {
                Core = new GrblCore(this, PreviewForm, JogForm);
            }
            ExceptionManager.Core = Core;

            if (true)             //use multi instance trigger
            {
                SincroStart.StartListen(Core);
                MultipleInstanceTimer.Enabled = true;
            }

            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();
        }
예제 #7
0
 public MarlinCore(System.Windows.Forms.Control syncroObject, PreviewForm cbform) : base(syncroObject, cbform)
 {
 }