├── .gitattributes ├── .gitignore ├── CNC Camera Control ├── CNC Camera Control.sln ├── CNC Camera Control │ ├── CNC Camera Control.csproj │ ├── CNCCameraControl.Designer.cs │ ├── CNCCameraControl.cs │ ├── CNCCameraControl.resx │ └── Properties │ │ └── AssemblyInfo.cs └── readme.md ├── CNC Controls ├── CNC Controls.sln └── CNC Controls │ ├── CNC Controls.csproj │ ├── Comms.cs │ ├── CoolantControl.Designer.cs │ ├── CoolantControl.cs │ ├── CoolantControl.resx │ ├── CoordValueControl.Designer.cs │ ├── CoordValueControl.cs │ ├── CoordValueControl.resx │ ├── DPIControl.Designer.cs │ ├── DPIControl.cs │ ├── DPIControl.resx │ ├── DROBase.Designer.cs │ ├── DROBase.cs │ ├── DROBase.resx │ ├── DROControl.Designer.cs │ ├── DROControl.cs │ ├── DROControl.resx │ ├── FeedControl.Designer.cs │ ├── FeedControl.cs │ ├── FeedControl.resx │ ├── FlowControl.Designer.cs │ ├── FlowControl.cs │ ├── FlowControl.resx │ ├── GCode.cs │ ├── GCodeJob.Designer.cs │ ├── GCodeJob.cs │ ├── GCodeJob.resx │ ├── GrblConfig.Designer.cs │ ├── GrblConfig.cs │ ├── GrblConfig.resx │ ├── GrblCore.cs │ ├── GrblStatusControl.Designer.cs │ ├── GrblStatusControl.cs │ ├── GrblStatusControl.resx │ ├── Interface.cs │ ├── LatheOptions.Designer.cs │ ├── LatheOptions.cs │ ├── LatheOptions.resx │ ├── MDIControl.Designer.cs │ ├── MDIControl.cs │ ├── MDIControl.resx │ ├── MPGPending.cs │ ├── MPGPending.designer.cs │ ├── MPGPending.resx │ ├── OffsetControl.Designer.cs │ ├── OffsetControl.cs │ ├── OffsetControl.resx │ ├── OverrideControl.Designer.cs │ ├── OverrideControl.cs │ ├── OverrideControl.resx │ ├── PIDTunerControl.Designer.cs │ ├── PIDTunerControl.cs │ ├── PIDTunerControl.resx │ ├── PPIControl.Designer.cs │ ├── PPIControl.cs │ ├── PPIControl.resx │ ├── ProfileControl.Designer.cs │ ├── ProfileControl.cs │ ├── ProfileControl.resx │ ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx │ ├── Resources │ └── App.ico │ ├── SDCardControl.Designer.cs │ ├── SDCardControl.cs │ ├── SDCardControl.resx │ ├── SignalsControl.Designer.cs │ ├── SignalsControl.cs │ ├── SignalsControl.resx │ ├── SpindleControl.Designer.cs │ ├── SpindleControl.cs │ ├── SpindleControl.resx │ ├── ThreadData.cs │ ├── ThreadingWizard.Designer.cs │ ├── ThreadingWizard.cs │ ├── ThreadingWizard.resx │ ├── ToolControl.Designer.cs │ ├── ToolControl.cs │ ├── ToolControl.resx │ ├── TurningWizard.Designer.cs │ ├── TurningWizard.cs │ ├── TurningWizard.resx │ ├── UIUtils.cs │ └── WizardConfig.cs ├── Grbl Config App ├── Grbl Config App.sln ├── Grbl Config App │ ├── Grbl Config App.csproj │ ├── Program.cs │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ ├── Resources.resx │ │ ├── Settings.Designer.cs │ │ └── Settings.settings │ ├── UserUI.Designer.cs │ ├── UserUI.cs │ ├── UserUI.resx │ ├── app.config │ └── bin │ │ └── Release │ │ ├── App.config │ │ └── setting_codes_en_US.txt └── readme.md ├── media ├── 5axes.png ├── ConfigApp.png ├── laser.png ├── lathe.png ├── mill.png ├── offsets.png ├── profiles.png ├── threading.png ├── tooltable.png └── turning.png └── readme.md /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows thumbnail cache files 2 | Thumbs.db 3 | ehthumbs.db 4 | ehthumbs_vista.db 5 | 6 | # Folder config file 7 | Desktop.ini 8 | 9 | # Recycle Bin used on file shares 10 | $RECYCLE.BIN/ 11 | 12 | # Windows Installer files 13 | *.cab 14 | *.msi 15 | *.msm 16 | *.msp 17 | 18 | # Windows shortcuts 19 | *.lnk 20 | 21 | # ========================= 22 | # Operating System Files 23 | # ========================= 24 | -------------------------------------------------------------------------------- /CNC Camera Control/CNC Camera Control.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CNC Camera Control", "CNC Camera Control\CNC Camera Control.csproj", "{30585EE1-F72E-4D42-999F-268E3E143B68}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Any CPU = Debug|Any CPU 9 | Release|Any CPU = Release|Any CPU 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {30585EE1-F72E-4D42-999F-268E3E143B68}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 13 | {30585EE1-F72E-4D42-999F-268E3E143B68}.Debug|Any CPU.Build.0 = Debug|Any CPU 14 | {30585EE1-F72E-4D42-999F-268E3E143B68}.Release|Any CPU.ActiveCfg = Release|Any CPU 15 | {30585EE1-F72E-4D42-999F-268E3E143B68}.Release|Any CPU.Build.0 = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /CNC Camera Control/CNC Camera Control/CNC Camera Control.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.30703 7 | 2.0 8 | {30585EE1-F72E-4D42-999F-268E3E143B68} 9 | Library 10 | Properties 11 | CNC_Camera_Control 12 | CNC Camera Control 13 | v3.5 14 | 512 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | pdbonly 27 | true 28 | bin\Release\ 29 | TRACE 30 | prompt 31 | 4 32 | 33 | 34 | 35 | False 36 | C:\Program Files (x86)\AForge.NET\Framework\Release\AForge.Controls.dll 37 | 38 | 39 | False 40 | C:\Program Files (x86)\AForge.NET\Framework\Release\AForge.Video.dll 41 | 42 | 43 | False 44 | C:\Program Files (x86)\AForge.NET\Framework\Release\AForge.Video.DirectShow.dll 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | UserControl 58 | 59 | 60 | CNCCameraControl.cs 61 | 62 | 63 | 64 | 65 | 66 | 67 | CNCCameraControl.cs 68 | 69 | 70 | 71 | 78 | -------------------------------------------------------------------------------- /CNC Camera Control/CNC Camera Control/CNCCameraControl.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace CNC_Camera_Control 2 | { 3 | partial class CNCCameraControl 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.trbCircle = new System.Windows.Forms.TrackBar(); 32 | this.btnMoveOffset = new System.Windows.Forms.Button(); 33 | this.VideoPanel = new System.Windows.Forms.Panel(); 34 | this.videoSourcePlayer = new AForge.Controls.VideoSourcePlayer(); 35 | this.lblCircle = new System.Windows.Forms.Label(); 36 | ((System.ComponentModel.ISupportInitialize)(this.trbCircle)).BeginInit(); 37 | this.VideoPanel.SuspendLayout(); 38 | this.SuspendLayout(); 39 | // 40 | // trbCircle 41 | // 42 | this.trbCircle.Location = new System.Drawing.Point(441, 16); 43 | this.trbCircle.Maximum = 100; 44 | this.trbCircle.Minimum = 5; 45 | this.trbCircle.Name = "trbCircle"; 46 | this.trbCircle.Orientation = System.Windows.Forms.Orientation.Vertical; 47 | this.trbCircle.Size = new System.Drawing.Size(45, 124); 48 | this.trbCircle.TabIndex = 6; 49 | this.trbCircle.Value = 5; 50 | // 51 | // btnMoveOffset 52 | // 53 | this.btnMoveOffset.Location = new System.Drawing.Point(13, 323); 54 | this.btnMoveOffset.Name = "btnMoveOffset"; 55 | this.btnMoveOffset.Size = new System.Drawing.Size(75, 23); 56 | this.btnMoveOffset.TabIndex = 5; 57 | this.btnMoveOffset.Text = "Move offset"; 58 | this.btnMoveOffset.UseVisualStyleBackColor = true; 59 | // 60 | // VideoPanel 61 | // 62 | this.VideoPanel.Controls.Add(this.videoSourcePlayer); 63 | this.VideoPanel.Location = new System.Drawing.Point(13, 16); 64 | this.VideoPanel.Name = "VideoPanel"; 65 | this.VideoPanel.Size = new System.Drawing.Size(406, 301); 66 | this.VideoPanel.TabIndex = 7; 67 | // 68 | // videoSourcePlayer 69 | // 70 | this.videoSourcePlayer.AutoSizeControl = true; 71 | this.videoSourcePlayer.BackColor = System.Drawing.SystemColors.ControlDarkDark; 72 | this.videoSourcePlayer.ForeColor = System.Drawing.Color.White; 73 | this.videoSourcePlayer.Location = new System.Drawing.Point(42, 29); 74 | this.videoSourcePlayer.Name = "videoSourcePlayer"; 75 | this.videoSourcePlayer.Size = new System.Drawing.Size(322, 242); 76 | this.videoSourcePlayer.TabIndex = 2; 77 | this.videoSourcePlayer.VideoSource = null; 78 | // 79 | // lblCircle 80 | // 81 | this.lblCircle.AutoSize = true; 82 | this.lblCircle.Location = new System.Drawing.Point(438, 143); 83 | this.lblCircle.Name = "lblCircle"; 84 | this.lblCircle.Size = new System.Drawing.Size(33, 13); 85 | this.lblCircle.TabIndex = 8; 86 | this.lblCircle.Text = "Circle"; 87 | // 88 | // CNCCameraControl 89 | // 90 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 91 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 92 | this.Controls.Add(this.lblCircle); 93 | this.Controls.Add(this.VideoPanel); 94 | this.Controls.Add(this.trbCircle); 95 | this.Controls.Add(this.btnMoveOffset); 96 | this.Name = "CNCCameraControl"; 97 | this.Size = new System.Drawing.Size(530, 363); 98 | ((System.ComponentModel.ISupportInitialize)(this.trbCircle)).EndInit(); 99 | this.VideoPanel.ResumeLayout(false); 100 | this.ResumeLayout(false); 101 | this.PerformLayout(); 102 | 103 | } 104 | 105 | #endregion 106 | 107 | private System.Windows.Forms.TrackBar trbCircle; 108 | private System.Windows.Forms.Button btnMoveOffset; 109 | private System.Windows.Forms.Panel VideoPanel; 110 | private AForge.Controls.VideoSourcePlayer videoSourcePlayer; 111 | private System.Windows.Forms.Label lblCircle; 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /CNC Camera Control/CNC Camera Control/CNCCameraControl.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * CNCCameraControl.cs - part of CNC Controls library 3 | * 4 | * v0.01 / 2018-09-14 / Io Engineering (Terje Io) 5 | * 6 | */ 7 | 8 | /* 9 | 10 | Copyright (c) 2018, Io Engineering (Terje Io) - parts derived from AForge example code 11 | All rights reserved. 12 | 13 | Redistribution and use in source and binary forms, with or without modification, 14 | are permitted provided that the following conditions are met: 15 | 16 | · Redistributions of source code must retain the above copyright notice, this 17 | list of conditions and the following disclaimer. 18 | 19 | · Redistributions in binary form must reproduce the above copyright notice, this 20 | list of conditions and the following disclaimer in the documentation and/or 21 | other materials provided with the distribution. 22 | 23 | · Neither the name of the copyright holder nor the names of its contributors may 24 | be used to endorse or promote products derived from this software without 25 | specific prior written permission. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 28 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 31 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 34 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | 38 | */ 39 | 40 | using System; 41 | using System.Collections.Generic; 42 | using System.ComponentModel; 43 | using System.Drawing; 44 | using System.Data; 45 | using System.Linq; 46 | using System.Text; 47 | using System.Windows.Forms; 48 | 49 | using AForge.Video; 50 | using AForge.Video.DirectShow; 51 | 52 | namespace CNC_Camera_Control 53 | { 54 | public partial class CNCCameraControl : UserControl 55 | { 56 | private int cpct = 20; 57 | 58 | public enum MoveMode 59 | { 60 | XAxisFirst = 1, 61 | YAxisFirst = 2, 62 | BothAxes = 3 63 | } 64 | 65 | public delegate void MoveOffsetHandler (MoveMode Mode, double XOffset, double YOffset); 66 | public event MoveOffsetHandler MoveOffset; 67 | 68 | private SolidBrush brush = null; 69 | private Pen pen = null; 70 | 71 | public CNCCameraControl() 72 | { 73 | InitializeComponent(); 74 | 75 | this.brush = new SolidBrush(Color.Red); 76 | this.pen = new Pen(brush); 77 | 78 | trbCircle.ValueChanged += new EventHandler(trbCircle_ValueChanged); 79 | btnMoveOffset.Click += new EventHandler(btnMoveOffset_Click); 80 | videoSourcePlayer.NewFrame += new AForge.Controls.VideoSourcePlayer.NewFrameHandler(videoSourcePlayer_NewFrame); 81 | 82 | XOffset = YOffset = 0.0; 83 | Mode = MoveMode.BothAxes; 84 | } 85 | 86 | public double XOffset { get; set; } 87 | public double YOffset { get; set; } 88 | public MoveMode Mode { get; set; } 89 | 90 | void trbCircle_ValueChanged(object sender, EventArgs e) 91 | { 92 | cpct = trbCircle.Value; 93 | } 94 | 95 | void btnMoveOffset_Click(object sender, EventArgs e) 96 | { 97 | if (MoveOffset != null) 98 | MoveOffset(Mode, XOffset, YOffset); 99 | } 100 | 101 | public void SelectVideoSource() 102 | { 103 | VideoCaptureDeviceForm form = null; 104 | 105 | if (videoSourcePlayer.VideoSource == null) 106 | { 107 | form = new VideoCaptureDeviceForm(); 108 | 109 | if (form.ShowDialog(this) == DialogResult.OK) 110 | OpenVideoSource(form.VideoDevice); 111 | } 112 | } 113 | 114 | private void OpenVideoSource(IVideoSource source) 115 | { 116 | this.Cursor = Cursors.WaitCursor; 117 | 118 | CloseCurrentVideoSource(); 119 | 120 | videoSourcePlayer.VideoSource = source; 121 | videoSourcePlayer.Start(); 122 | 123 | this.Cursor = Cursors.Default; 124 | } 125 | 126 | public void CloseCurrentVideoSource() 127 | { 128 | if (videoSourcePlayer.VideoSource != null) 129 | { 130 | videoSourcePlayer.SignalToStop(); 131 | 132 | // wait ~ 3 seconds 133 | for (int i = 0; i < 30; i++) 134 | { 135 | if (!videoSourcePlayer.IsRunning) 136 | break; 137 | System.Threading.Thread.Sleep(100); 138 | } 139 | 140 | if (videoSourcePlayer.IsRunning) 141 | videoSourcePlayer.Stop(); 142 | 143 | videoSourcePlayer.VideoSource = null; 144 | } 145 | } 146 | 147 | private void videoSourcePlayer_NewFrame(object sender, ref Bitmap image) 148 | { 149 | Graphics g = Graphics.FromImage(image); 150 | 151 | Point center = new Point((int)(g.VisibleClipBounds.Width / 2.0f), (int)(g.VisibleClipBounds.Height / 2.0f)); 152 | 153 | g.DrawLine(this.pen, g.VisibleClipBounds.X, center.Y, g.VisibleClipBounds.Width, center.Y); 154 | g.DrawLine(this.pen, center.X, g.VisibleClipBounds.Y, center.X, g.VisibleClipBounds.Height); 155 | g.DrawEllipse(this.pen, center.X - cpct, center.Y - cpct, cpct * 2, cpct * 2); 156 | g.Dispose(); 157 | } 158 | 159 | } 160 | } 161 | -------------------------------------------------------------------------------- /CNC Camera Control/CNC Camera Control/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("CNC Camera Control")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Io Engineering")] 12 | [assembly: AssemblyProduct("CNC Camera Control")] 13 | [assembly: AssemblyCopyright("Copyright © 2018")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("cad879c4-72fc-47eb-9109-f627d3ccc44f")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /CNC Camera Control/readme.md: -------------------------------------------------------------------------------- 1 | ## GRBL Camera Control 2 | 3 | This control is based on the [AForge libraries](http://www.aforgenet.com/framework/downloads.html). 4 | It should be added to a non-modal window in order to allow jogging and/or MDI-based movement from the main application. 5 | 6 | The main application should subscribe to the MoveOffset event and send the appropriate commands to GRBL. 7 | 8 | Currently there are three configuration parameters available: 9 | 10 | XOffset, Yoffset and Mode. Mode should be set to one of the values defined by the enum MoveMode. 11 | 12 | Please note that this version very basic, more functionality will be added later. 13 | -------------------------------------------------------------------------------- /CNC Controls/CNC Controls.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CNC Controls", "CNC Controls\CNC Controls.csproj", "{288C05F8-20D7-4436-8E91-A1E306A4D7F6}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Any CPU = Debug|Any CPU 9 | Debug|x86 = Debug|x86 10 | Release|Any CPU = Release|Any CPU 11 | Release|x86 = Release|x86 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {288C05F8-20D7-4436-8E91-A1E306A4D7F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {288C05F8-20D7-4436-8E91-A1E306A4D7F6}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {288C05F8-20D7-4436-8E91-A1E306A4D7F6}.Debug|x86.ActiveCfg = Debug|x86 17 | {288C05F8-20D7-4436-8E91-A1E306A4D7F6}.Debug|x86.Build.0 = Debug|x86 18 | {288C05F8-20D7-4436-8E91-A1E306A4D7F6}.Release|Any CPU.ActiveCfg = Release|Any CPU 19 | {288C05F8-20D7-4436-8E91-A1E306A4D7F6}.Release|Any CPU.Build.0 = Release|Any CPU 20 | {288C05F8-20D7-4436-8E91-A1E306A4D7F6}.Release|x86.ActiveCfg = Release|x86 21 | {288C05F8-20D7-4436-8E91-A1E306A4D7F6}.Release|x86.Build.0 = Release|x86 22 | EndGlobalSection 23 | GlobalSection(SolutionProperties) = preSolution 24 | HideSolutionNode = FALSE 25 | EndGlobalSection 26 | EndGlobal 27 | -------------------------------------------------------------------------------- /CNC Controls/CNC Controls/CoolantControl.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace CNC_Controls 2 | { 3 | partial class CoolantControl 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.groupBox1 = new System.Windows.Forms.GroupBox(); 32 | this.chkFlood = new System.Windows.Forms.CheckBox(); 33 | this.chkMist = new System.Windows.Forms.CheckBox(); 34 | this.groupBox1.SuspendLayout(); 35 | this.SuspendLayout(); 36 | // 37 | // groupBox1 38 | // 39 | this.groupBox1.Controls.Add(this.chkFlood); 40 | this.groupBox1.Controls.Add(this.chkMist); 41 | this.groupBox1.Location = new System.Drawing.Point(3, 3); 42 | this.groupBox1.Name = "groupBox1"; 43 | this.groupBox1.Size = new System.Drawing.Size(210, 65); 44 | this.groupBox1.TabIndex = 25; 45 | this.groupBox1.TabStop = false; 46 | this.groupBox1.Text = "Coolant"; 47 | // 48 | // chkFlood 49 | // 50 | this.chkFlood.AutoSize = true; 51 | this.chkFlood.Location = new System.Drawing.Point(21, 19); 52 | this.chkFlood.Name = "chkFlood"; 53 | this.chkFlood.Size = new System.Drawing.Size(52, 17); 54 | this.chkFlood.TabIndex = 0; 55 | this.chkFlood.TabStop = false; 56 | this.chkFlood.Text = "Flood"; 57 | this.chkFlood.UseVisualStyleBackColor = true; 58 | // 59 | // chkMist 60 | // 61 | this.chkMist.AutoSize = true; 62 | this.chkMist.Location = new System.Drawing.Point(21, 42); 63 | this.chkMist.Name = "chkMist"; 64 | this.chkMist.Size = new System.Drawing.Size(45, 17); 65 | this.chkMist.TabIndex = 0; 66 | this.chkMist.TabStop = false; 67 | this.chkMist.Text = "Mist"; 68 | this.chkMist.UseVisualStyleBackColor = true; 69 | // 70 | // CoolantControl 71 | // 72 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 73 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 74 | this.Controls.Add(this.groupBox1); 75 | this.Name = "CoolantControl"; 76 | this.Size = new System.Drawing.Size(216, 73); 77 | this.groupBox1.ResumeLayout(false); 78 | this.groupBox1.PerformLayout(); 79 | this.ResumeLayout(false); 80 | 81 | } 82 | 83 | #endregion 84 | 85 | private System.Windows.Forms.GroupBox groupBox1; 86 | private System.Windows.Forms.CheckBox chkFlood; 87 | private System.Windows.Forms.CheckBox chkMist; 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /CNC Controls/CNC Controls/CoolantControl.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * CoolantControl.cs - part of CNC Controls library 3 | * 4 | * 2018-09-23 / Io Engineering (Terje Io) 5 | * 6 | */ 7 | 8 | /* 9 | 10 | Copyright (c) 2018, Io Engineering (Terje Io) 11 | All rights reserved. 12 | 13 | Redistribution and use in source and binary forms, with or without modification, 14 | are permitted provided that the following conditions are met: 15 | 16 | · Redistributions of source code must retain the above copyright notice, this 17 | list of conditions and the following disclaimer. 18 | 19 | · Redistributions in binary form must reproduce the above copyright notice, this 20 | list of conditions and the following disclaimer in the documentation and/or 21 | other materials provided with the distribution. 22 | 23 | · Neither the name of the copyright holder nor the names of its contributors may 24 | be used to endorse or promote products derived from this software without 25 | specific prior written permission. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 28 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 31 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 34 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | 38 | */ 39 | 40 | using System; 41 | using System.Collections.Generic; 42 | using System.ComponentModel; 43 | using System.Drawing; 44 | using System.Data; 45 | using System.Linq; 46 | using System.Text; 47 | using System.Windows.Forms; 48 | 49 | namespace CNC_Controls 50 | { 51 | public partial class CoolantControl : UserControl 52 | { 53 | public bool silent = false; 54 | 55 | public delegate void CommandGeneratedHandler(string command); 56 | public event CommandGeneratedHandler CommandGenerated; 57 | 58 | public CoolantControl() 59 | { 60 | InitializeComponent(); 61 | 62 | this.chkFlood.Tag = ((char)GrblConstants.CMD_COOLANT_FLOOD_OVR_TOGGLE).ToString(); 63 | this.chkFlood.CheckedChanged += new EventHandler(chkCoolant_CheckedChanged); 64 | 65 | this.chkMist.Tag = ((char)GrblConstants.CMD_COOLANT_MIST_OVR_TOGGLE).ToString(); 66 | this.chkMist.CheckedChanged += new EventHandler(chkMist_CheckedChanged); 67 | } 68 | 69 | public bool EnableControl 70 | { 71 | get { return this.chkFlood.Enabled; } 72 | set 73 | { 74 | this.chkFlood.Enabled = this.chkMist.Enabled = value; 75 | } 76 | } 77 | 78 | public bool MistOn 79 | { 80 | get { return this.chkMist.Checked; } 81 | set { silent = true; this.chkMist.Checked = value; silent = false; } 82 | } 83 | public bool FloodOn 84 | { 85 | get { return this.chkFlood.Checked; } 86 | set { silent = true; this.chkFlood.Checked = value; silent = false; } 87 | } 88 | 89 | public string FloodCommand { get { return string.Format((string)this.chkFlood.Tag, FloodOn ? "1" : "0"); } set { this.chkFlood.Tag = value; } } 90 | public string MistCommand { get { return string.Format((string)this.chkMist.Tag, MistOn ? "1" : "0"); } set { this.chkMist.Tag = value; } } 91 | 92 | void chkCoolant_CheckedChanged(object sender, EventArgs e) 93 | { 94 | if (!silent) 95 | CommandGenerated((string)this.chkFlood.Tag); 96 | } 97 | 98 | void chkMist_CheckedChanged(object sender, EventArgs e) 99 | { 100 | if (!silent) 101 | CommandGenerated((string)this.chkMist.Tag); 102 | } 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /CNC Controls/CNC Controls/CoolantControl.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /CNC Controls/CNC Controls/CoordValueControl.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace CNC_Controls 2 | { 3 | partial class CoordValueControl 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.unit = new System.Windows.Forms.Label(); 32 | this.data = new System.Windows.Forms.TextBox(); 33 | this.label = new System.Windows.Forms.Label(); 34 | this.SuspendLayout(); 35 | // 36 | // unit 37 | // 38 | this.unit.AutoSize = true; 39 | this.unit.Location = new System.Drawing.Point(125, 3); 40 | this.unit.Name = "unit"; 41 | this.unit.Size = new System.Drawing.Size(23, 13); 42 | this.unit.TabIndex = 32; 43 | this.unit.Text = "mm"; 44 | // 45 | // data 46 | // 47 | this.data.Location = new System.Drawing.Point(69, 0); 48 | this.data.Name = "data"; 49 | this.data.Size = new System.Drawing.Size(50, 20); 50 | this.data.TabIndex = 31; 51 | this.data.Text = "0"; 52 | this.data.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; 53 | // 54 | // label 55 | // 56 | this.label.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 57 | this.label.Location = new System.Drawing.Point(29, 3); 58 | this.label.Name = "label"; 59 | this.label.Size = new System.Drawing.Size(34, 13); 60 | this.label.TabIndex = 30; 61 | this.label.Text = "label:"; 62 | this.label.TextAlign = System.Drawing.ContentAlignment.TopRight; 63 | // 64 | // CoordValue 65 | // 66 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 67 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 68 | this.Controls.Add(this.unit); 69 | this.Controls.Add(this.data); 70 | this.Controls.Add(this.label); 71 | this.Name = "CoordValue"; 72 | this.Size = new System.Drawing.Size(175, 20); 73 | this.ResumeLayout(false); 74 | this.PerformLayout(); 75 | 76 | } 77 | 78 | #endregion 79 | 80 | private System.Windows.Forms.Label unit; 81 | private System.Windows.Forms.TextBox data; 82 | private System.Windows.Forms.Label label; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /CNC Controls/CNC Controls/DPIControl.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /CNC Controls/CNC Controls/DROBase.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace CNC_Controls 2 | { 3 | partial class DROBase 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.btnScaled = new System.Windows.Forms.Button(); 32 | this.btnZero = new System.Windows.Forms.Button(); 33 | this.txtReadout = new System.Windows.Forms.TextBox(); 34 | this.lblAxis = new System.Windows.Forms.Label(); 35 | this.SuspendLayout(); 36 | // 37 | // btnScaled 38 | // 39 | this.btnScaled.Enabled = false; 40 | this.btnScaled.FlatAppearance.BorderSize = 0; 41 | this.btnScaled.FlatStyle = System.Windows.Forms.FlatStyle.Flat; 42 | this.btnScaled.Location = new System.Drawing.Point(172, 2); 43 | this.btnScaled.Margin = new System.Windows.Forms.Padding(0); 44 | this.btnScaled.Name = "btnScaled"; 45 | this.btnScaled.Size = new System.Drawing.Size(10, 29); 46 | this.btnScaled.TabIndex = 0; 47 | this.btnScaled.TabStop = false; 48 | this.btnScaled.Text = " "; 49 | this.btnScaled.UseVisualStyleBackColor = true; 50 | // 51 | // btnZero 52 | // 53 | this.btnZero.Font = new System.Drawing.Font("Arial", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 54 | this.btnZero.Location = new System.Drawing.Point(137, 2); 55 | this.btnZero.Name = "btnZero"; 56 | this.btnZero.Size = new System.Drawing.Size(29, 29); 57 | this.btnZero.TabIndex = 0; 58 | this.btnZero.TabStop = false; 59 | this.btnZero.Tag = "?"; 60 | this.btnZero.Text = "0"; 61 | this.btnZero.UseVisualStyleBackColor = true; 62 | // 63 | // txtReadout 64 | // 65 | this.txtReadout.Font = new System.Drawing.Font("Arial Narrow", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 66 | this.txtReadout.Location = new System.Drawing.Point(28, 2); 67 | this.txtReadout.Name = "txtReadout"; 68 | this.txtReadout.ReadOnly = true; 69 | this.txtReadout.Size = new System.Drawing.Size(103, 29); 70 | this.txtReadout.TabIndex = 12; 71 | this.txtReadout.TabStop = false; 72 | this.txtReadout.Tag = "X"; 73 | this.txtReadout.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; 74 | // 75 | // lblAxis 76 | // 77 | this.lblAxis.AutoSize = true; 78 | this.lblAxis.Font = new System.Drawing.Font("Arial Narrow", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 79 | this.lblAxis.Location = new System.Drawing.Point(2, 6); 80 | this.lblAxis.Name = "lblAxis"; 81 | this.lblAxis.Size = new System.Drawing.Size(19, 23); 82 | this.lblAxis.TabIndex = 0; 83 | this.lblAxis.Text = "?"; 84 | // 85 | // DROBase 86 | // 87 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 88 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 89 | this.Controls.Add(this.btnScaled); 90 | this.Controls.Add(this.btnZero); 91 | this.Controls.Add(this.txtReadout); 92 | this.Controls.Add(this.lblAxis); 93 | this.Name = "DROBase"; 94 | this.Size = new System.Drawing.Size(193, 33); 95 | this.ResumeLayout(false); 96 | this.PerformLayout(); 97 | 98 | } 99 | 100 | #endregion 101 | 102 | private System.Windows.Forms.Button btnScaled; 103 | private System.Windows.Forms.Button btnZero; 104 | private System.Windows.Forms.TextBox txtReadout; 105 | private System.Windows.Forms.Label lblAxis; 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /CNC Controls/CNC Controls/DROBase.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * DROBase.cs - part of CNC Controls library 3 | * 4 | * 2018-10-02 / Io Engineering (Terje Io) 5 | * 6 | */ 7 | 8 | /* 9 | 10 | Copyright (c) 2018, Io Engineering (Terje Io) 11 | All rights reserved. 12 | 13 | Redistribution and use in source and binary forms, with or without modification, 14 | are permitted provided that the following conditions are met: 15 | 16 | · Redistributions of source code must retain the above copyright notice, this 17 | list of conditions and the following disclaimer. 18 | 19 | · Redistributions in binary form must reproduce the above copyright notice, this 20 | list of conditions and the following disclaimer in the documentation and/or 21 | other materials provided with the distribution. 22 | 23 | · Neither the name of the copyright holder nor the names of its contributors may 24 | be used to endorse or promote products derived from this software without 25 | specific prior written permission. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 28 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 31 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 34 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | 38 | */ 39 | 40 | using System; 41 | using System.Collections.Generic; 42 | using System.ComponentModel; 43 | using System.Drawing; 44 | using System.Data; 45 | using System.Linq; 46 | using System.Text; 47 | using System.Windows.Forms; 48 | 49 | namespace CNC_Controls 50 | { 51 | public partial class DROBase : UserControl 52 | { 53 | public DROBase() 54 | { 55 | InitializeComponent(); 56 | } 57 | 58 | public string Label { set { this.btnZero.Tag = this.txtReadout.Tag = this.lblAxis.Text = value; } } 59 | public string Value { set { this.txtReadout.Text = value; } } 60 | public bool Scaled { set { this.btnScaled.BackColor = value ? Color.Yellow : this.BackColor; } } 61 | 62 | public TextBox Readout { get { return this.txtReadout; } } 63 | public Button Zero { get { return this.btnZero; } } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /CNC Controls/CNC Controls/DROBase.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /CNC Controls/CNC Controls/DROControl.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /CNC Controls/CNC Controls/FeedControl.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace CNC_Controls 2 | { 3 | partial class FeedControl 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.txtFeedRate = new System.Windows.Forms.TextBox(); 32 | this.lblFeedRrate = new System.Windows.Forms.Label(); 33 | this.groupBox1 = new System.Windows.Forms.GroupBox(); 34 | this.lblRapids = new System.Windows.Forms.Label(); 35 | this.feedOverrideControl = new CNC_Controls.OverrideControl(); 36 | this.rapidsOverrideControl = new CNC_Controls.OverrideControl(); 37 | this.groupBox1.SuspendLayout(); 38 | this.SuspendLayout(); 39 | // 40 | // txtFeedRate 41 | // 42 | this.txtFeedRate.Location = new System.Drawing.Point(6, 19); 43 | this.txtFeedRate.Name = "txtFeedRate"; 44 | this.txtFeedRate.ReadOnly = true; 45 | this.txtFeedRate.Size = new System.Drawing.Size(67, 20); 46 | this.txtFeedRate.TabIndex = 4; 47 | // 48 | // lblFeedRrate 49 | // 50 | this.lblFeedRrate.AutoSize = true; 51 | this.lblFeedRrate.Location = new System.Drawing.Point(79, 22); 52 | this.lblFeedRrate.Name = "lblFeedRrate"; 53 | this.lblFeedRrate.Size = new System.Drawing.Size(44, 13); 54 | this.lblFeedRrate.TabIndex = 3; 55 | this.lblFeedRrate.Text = "mm/min"; 56 | // 57 | // groupBox1 58 | // 59 | this.groupBox1.Controls.Add(this.lblFeedRrate); 60 | this.groupBox1.Controls.Add(this.txtFeedRate); 61 | this.groupBox1.Controls.Add(this.feedOverrideControl); 62 | this.groupBox1.Controls.Add(this.lblRapids); 63 | this.groupBox1.Controls.Add(this.rapidsOverrideControl); 64 | this.groupBox1.Location = new System.Drawing.Point(3, 3); 65 | this.groupBox1.Name = "groupBox1"; 66 | this.groupBox1.Size = new System.Drawing.Size(210, 152); 67 | this.groupBox1.TabIndex = 27; 68 | this.groupBox1.TabStop = false; 69 | this.groupBox1.Text = "Feed rate"; 70 | // 71 | // lblRapids 72 | // 73 | this.lblRapids.AutoSize = true; 74 | this.lblRapids.Location = new System.Drawing.Point(6, 92); 75 | this.lblRapids.Name = "lblRapids"; 76 | this.lblRapids.Size = new System.Drawing.Size(43, 13); 77 | this.lblRapids.TabIndex = 8; 78 | this.lblRapids.Text = "Rapids:"; 79 | // 80 | // feedOverrideControl 81 | // 82 | this.feedOverrideControl.Location = new System.Drawing.Point(30, 29); 83 | this.feedOverrideControl.Name = "feedOverrideControl"; 84 | this.feedOverrideControl.Size = new System.Drawing.Size(174, 61); 85 | this.feedOverrideControl.TabIndex = 5; 86 | // 87 | // rapidsOverrideControl 88 | // 89 | this.rapidsOverrideControl.Location = new System.Drawing.Point(30, 92); 90 | this.rapidsOverrideControl.Name = "rapidsOverrideControl"; 91 | this.rapidsOverrideControl.Size = new System.Drawing.Size(174, 54); 92 | this.rapidsOverrideControl.TabIndex = 6; 93 | // 94 | // FeedControl 95 | // 96 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 97 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 98 | this.Controls.Add(this.groupBox1); 99 | this.Name = "FeedControl"; 100 | this.Size = new System.Drawing.Size(216, 159); 101 | this.groupBox1.ResumeLayout(false); 102 | this.groupBox1.PerformLayout(); 103 | this.ResumeLayout(false); 104 | 105 | } 106 | 107 | #endregion 108 | 109 | private OverrideControl feedOverrideControl; 110 | private System.Windows.Forms.TextBox txtFeedRate; 111 | private System.Windows.Forms.Label lblFeedRrate; 112 | private System.Windows.Forms.GroupBox groupBox1; 113 | private OverrideControl rapidsOverrideControl; 114 | private System.Windows.Forms.Label lblRapids; 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /CNC Controls/CNC Controls/FeedControl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Drawing; 5 | using System.Data; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Windows.Forms; 9 | 10 | namespace CNC_Controls 11 | { 12 | public partial class FeedControl : UserControl 13 | { 14 | public delegate void CommandGeneratedHandler(string command); 15 | public event CommandGeneratedHandler CommandGenerated; 16 | 17 | public FeedControl() 18 | { 19 | InitializeComponent(); 20 | this.feedOverrideControl.ResetCommand = GrblConstants.CMD_FEED_OVR_RESET; 21 | this.feedOverrideControl.FineMinusCommand = GrblConstants.CMD_FEED_OVR_FINE_MINUS; 22 | this.feedOverrideControl.FinePlusCommand = GrblConstants.CMD_FEED_OVR_FINE_PLUS; 23 | this.feedOverrideControl.CoarseMinusCommand = GrblConstants.CMD_FEED_OVR_COARSE_MINUS; 24 | this.feedOverrideControl.CoarsePlusCommand = GrblConstants.CMD_FEED_OVR_COARSE_PLUS; 25 | this.feedOverrideControl.CommandGenerated += new OverrideControl.CommandGeneratedHandler(overrideControl_CommandGenerated); 26 | 27 | this.rapidsOverrideControl.MinusOnly = true; 28 | this.rapidsOverrideControl.ResetCommand = GrblConstants.CMD_RAPID_OVR_RESET; 29 | this.rapidsOverrideControl.FineMinusCommand = GrblConstants.CMD_RAPID_OVR_MEDIUM; 30 | this.rapidsOverrideControl.CoarseMinusCommand = GrblConstants.CMD_RAPID_OVR_LOW; 31 | this.rapidsOverrideControl.CommandGenerated += new OverrideControl.CommandGeneratedHandler(overrideControl_CommandGenerated); 32 | } 33 | 34 | public bool EnableControl 35 | { 36 | get { return this.txtFeedRate.Enabled; } 37 | set 38 | { 39 | this.txtFeedRate.Enabled = value; 40 | } 41 | } 42 | 43 | public double FeedRate { get { return 0; } set { this.txtFeedRate.Text = value.ToString(); } } 44 | public int FeedOverride { set { this.feedOverrideControl.Value = value; } } 45 | public int RapidsOverride { set { this.rapidsOverrideControl.Value = value; } } 46 | 47 | void overrideControl_CommandGenerated(string command) 48 | { 49 | if (CommandGenerated != null) 50 | CommandGenerated(command); 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /CNC Controls/CNC Controls/FeedControl.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /CNC Controls/CNC Controls/FlowControl.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace CNC_Controls 2 | { 3 | partial class FlowControl 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.groupBox1 = new System.Windows.Forms.GroupBox(); 32 | this.chkCoolant = new System.Windows.Forms.CheckBox(); 33 | this.chkExhaust = new System.Windows.Forms.CheckBox(); 34 | this.chkAir = new System.Windows.Forms.CheckBox(); 35 | this.groupBox1.SuspendLayout(); 36 | this.SuspendLayout(); 37 | // 38 | // groupBox1 39 | // 40 | this.groupBox1.Controls.Add(this.chkCoolant); 41 | this.groupBox1.Controls.Add(this.chkExhaust); 42 | this.groupBox1.Controls.Add(this.chkAir); 43 | this.groupBox1.Location = new System.Drawing.Point(0, 0); 44 | this.groupBox1.Name = "groupBox1"; 45 | this.groupBox1.Size = new System.Drawing.Size(210, 77); 46 | this.groupBox1.TabIndex = 24; 47 | this.groupBox1.TabStop = false; 48 | this.groupBox1.Text = "Main"; 49 | // 50 | // chkCoolant 51 | // 52 | this.chkCoolant.AutoSize = true; 53 | this.chkCoolant.Location = new System.Drawing.Point(38, 52); 54 | this.chkCoolant.Name = "chkCoolant"; 55 | this.chkCoolant.Size = new System.Drawing.Size(62, 17); 56 | this.chkCoolant.TabIndex = 3; 57 | this.chkCoolant.Text = "Coolant"; 58 | this.chkCoolant.UseVisualStyleBackColor = true; 59 | // 60 | // chkExhaust 61 | // 62 | this.chkExhaust.AutoSize = true; 63 | this.chkExhaust.Location = new System.Drawing.Point(38, 35); 64 | this.chkExhaust.Name = "chkExhaust"; 65 | this.chkExhaust.Size = new System.Drawing.Size(82, 17); 66 | this.chkExhaust.TabIndex = 2; 67 | this.chkExhaust.Text = "Exhaust fan"; 68 | this.chkExhaust.UseVisualStyleBackColor = true; 69 | // 70 | // chkAir 71 | // 72 | this.chkAir.AutoSize = true; 73 | this.chkAir.Location = new System.Drawing.Point(38, 17); 74 | this.chkAir.Name = "chkAir"; 75 | this.chkAir.Size = new System.Drawing.Size(67, 17); 76 | this.chkAir.TabIndex = 1; 77 | this.chkAir.Text = "Air assist"; 78 | this.chkAir.UseVisualStyleBackColor = true; 79 | // 80 | // FlowControl 81 | // 82 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 83 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 84 | this.Controls.Add(this.groupBox1); 85 | this.Name = "FlowControl"; 86 | this.Size = new System.Drawing.Size(210, 77); 87 | this.groupBox1.ResumeLayout(false); 88 | this.groupBox1.PerformLayout(); 89 | this.ResumeLayout(false); 90 | 91 | } 92 | 93 | #endregion 94 | 95 | private System.Windows.Forms.GroupBox groupBox1; 96 | private System.Windows.Forms.CheckBox chkCoolant; 97 | private System.Windows.Forms.CheckBox chkExhaust; 98 | private System.Windows.Forms.CheckBox chkAir; 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /CNC Controls/CNC Controls/FlowControl.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FlowControl.cs - part of CNC Controls library 3 | * 4 | * v0.01 / 2018-09-14 / Io Engineering (Terje Io) 5 | * 6 | */ 7 | 8 | /* 9 | 10 | Copyright (c) 2018, Io Engineering (Terje Io) 11 | All rights reserved. 12 | 13 | Redistribution and use in source and binary forms, with or without modification, 14 | are permitted provided that the following conditions are met: 15 | 16 | · Redistributions of source code must retain the above copyright notice, this 17 | list of conditions and the following disclaimer. 18 | 19 | · Redistributions in binary form must reproduce the above copyright notice, this 20 | list of conditions and the following disclaimer in the documentation and/or 21 | other materials provided with the distribution. 22 | 23 | · Neither the name of the copyright holder nor the names of its contributors may 24 | be used to endorse or promote products derived from this software without 25 | specific prior written permission. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 28 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 31 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 34 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | 38 | */ 39 | 40 | using System; 41 | using System.Collections.Generic; 42 | using System.ComponentModel; 43 | using System.Drawing; 44 | using System.Data; 45 | using System.Linq; 46 | using System.Text; 47 | using System.Windows.Forms; 48 | 49 | namespace CNC_Controls 50 | { 51 | 52 | public partial class FlowControl : UserControl 53 | { 54 | 55 | public bool Silent = false; 56 | 57 | public delegate void CommandGeneratedHandler(string command); 58 | public event CommandGeneratedHandler CommandGenerated; 59 | 60 | public FlowControl() 61 | { 62 | InitializeComponent(); 63 | 64 | this.chkExhaust.Tag = ((char)GrblConstants.CMD_COOLANT_FLOOD_OVR_TOGGLE).ToString(); 65 | this.chkAir.Tag = ((char)GrblConstants.CMD_COOLANT_MIST_OVR_TOGGLE).ToString(); 66 | this.chkCoolant.Tag = "M125P2Q{0}"; 67 | 68 | this.chkAir.CheckedChanged += new EventHandler(chkAir_CheckedChanged); 69 | this.chkExhaust.CheckedChanged += new EventHandler(chkExhaust_CheckedChanged); 70 | this.chkCoolant.CheckedChanged += new EventHandler(chkCoolant_CheckedChanged); 71 | } 72 | 73 | public bool EnableControl 74 | { 75 | get { return this.chkCoolant.Enabled; } 76 | set { 77 | this.chkCoolant.Enabled = value; 78 | this.chkExhaust.TabStop = value; 79 | this.chkAir.TabStop = value; 80 | } 81 | } 82 | 83 | public bool ExhaustOn { get { return this.chkExhaust.Checked; } set { this.chkExhaust.Checked = value; } } 84 | public bool CoolantOn { get { return this.chkCoolant.Checked; } set { this.chkCoolant.Checked = value; } } 85 | public bool AirAssistOn { get { return this.chkAir.Checked; } set { this.chkAir.Checked = value; } } 86 | 87 | public string ExhaustCommand { get { return string.Format((string)this.chkExhaust.Tag, this.ExhaustOn ? "1" : "0"); } set { this.chkExhaust.Tag = value; } } 88 | public string CoolantCommand { get { return string.Format((string)this.chkCoolant.Tag, this.CoolantOn ? "1" : "0"); } set { this.chkCoolant.Tag = value; } } 89 | public string AirAssistCommand { get { return string.Format((string)this.chkAir.Tag, this.AirAssistOn ? "1" : "0"); } set { this.chkAir.Tag = value; } } 90 | 91 | private void chkExhaust_CheckedChanged(object sender, EventArgs e) 92 | { 93 | if (!Silent && this.chkExhaust.Enabled) 94 | CommandGenerated(this.ExhaustCommand); 95 | } 96 | 97 | void chkCoolant_CheckedChanged(object sender, EventArgs e) 98 | { 99 | if (!Silent) 100 | CommandGenerated(this.CoolantCommand); 101 | } 102 | 103 | void chkAir_CheckedChanged(object sender, EventArgs e) 104 | { 105 | if (!Silent) 106 | CommandGenerated(AirAssistCommand); 107 | } 108 | 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /CNC Controls/CNC Controls/FlowControl.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /CNC Controls/CNC Controls/GrblStatusControl.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace CNC_Controls 2 | { 3 | partial class GrblStatusControl 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.chkCheckMode = new System.Windows.Forms.CheckBox(); 32 | this.txtState = new System.Windows.Forms.TextBox(); 33 | this.lblState = new System.Windows.Forms.Label(); 34 | this.btnUnlock = new System.Windows.Forms.Button(); 35 | this.btnHome = new System.Windows.Forms.Button(); 36 | this.btnReset = new System.Windows.Forms.Button(); 37 | this.SuspendLayout(); 38 | // 39 | // chkCheckMode 40 | // 41 | this.chkCheckMode.AutoSize = true; 42 | this.chkCheckMode.Location = new System.Drawing.Point(126, 6); 43 | this.chkCheckMode.Name = "chkCheckMode"; 44 | this.chkCheckMode.Size = new System.Drawing.Size(57, 17); 45 | this.chkCheckMode.TabIndex = 0; 46 | this.chkCheckMode.TabStop = false; 47 | this.chkCheckMode.Text = "Check"; 48 | this.chkCheckMode.UseVisualStyleBackColor = true; 49 | // 50 | // txtState 51 | // 52 | this.txtState.Location = new System.Drawing.Point(45, 3); 53 | this.txtState.Name = "txtState"; 54 | this.txtState.Size = new System.Drawing.Size(74, 20); 55 | this.txtState.TabIndex = 0; 56 | this.txtState.TabStop = false; 57 | this.txtState.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; 58 | // 59 | // lblState 60 | // 61 | this.lblState.AutoSize = true; 62 | this.lblState.Location = new System.Drawing.Point(7, 6); 63 | this.lblState.Name = "lblState"; 64 | this.lblState.Size = new System.Drawing.Size(32, 13); 65 | this.lblState.TabIndex = 42; 66 | this.lblState.Text = "State"; 67 | // 68 | // btnUnlock 69 | // 70 | this.btnUnlock.Location = new System.Drawing.Point(64, 29); 71 | this.btnUnlock.Name = "btnUnlock"; 72 | this.btnUnlock.Size = new System.Drawing.Size(55, 32); 73 | this.btnUnlock.TabIndex = 0; 74 | this.btnUnlock.TabStop = false; 75 | this.btnUnlock.Text = "Unlock"; 76 | this.btnUnlock.UseVisualStyleBackColor = true; 77 | // 78 | // btnHome 79 | // 80 | this.btnHome.Location = new System.Drawing.Point(3, 29); 81 | this.btnHome.Name = "btnHome"; 82 | this.btnHome.Size = new System.Drawing.Size(55, 32); 83 | this.btnHome.TabIndex = 0; 84 | this.btnHome.TabStop = false; 85 | this.btnHome.Text = "Home"; 86 | this.btnHome.UseVisualStyleBackColor = true; 87 | // 88 | // btnReset 89 | // 90 | this.btnReset.BackColor = System.Drawing.Color.Red; 91 | this.btnReset.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 92 | this.btnReset.ForeColor = System.Drawing.Color.White; 93 | this.btnReset.Location = new System.Drawing.Point(125, 29); 94 | this.btnReset.Name = "btnReset"; 95 | this.btnReset.Size = new System.Drawing.Size(58, 32); 96 | this.btnReset.TabIndex = 0; 97 | this.btnReset.TabStop = false; 98 | this.btnReset.Text = "RESET"; 99 | this.btnReset.UseVisualStyleBackColor = false; 100 | // 101 | // GrblStatusControl 102 | // 103 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 104 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 105 | this.Controls.Add(this.chkCheckMode); 106 | this.Controls.Add(this.txtState); 107 | this.Controls.Add(this.lblState); 108 | this.Controls.Add(this.btnUnlock); 109 | this.Controls.Add(this.btnHome); 110 | this.Controls.Add(this.btnReset); 111 | this.Name = "GrblStatusControl"; 112 | this.Size = new System.Drawing.Size(190, 66); 113 | this.ResumeLayout(false); 114 | this.PerformLayout(); 115 | 116 | } 117 | 118 | #endregion 119 | 120 | private System.Windows.Forms.CheckBox chkCheckMode; 121 | private System.Windows.Forms.TextBox txtState; 122 | private System.Windows.Forms.Label lblState; 123 | private System.Windows.Forms.Button btnUnlock; 124 | private System.Windows.Forms.Button btnHome; 125 | private System.Windows.Forms.Button btnReset; 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /CNC Controls/CNC Controls/GrblStatusControl.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * GrblStatusControl.cs - part of CNC Controls library for Grbl 3 | * 4 | * v0.01 / 2019-05-02 / Io Engineering (Terje Io) 5 | * 6 | */ 7 | 8 | /* 9 | 10 | Copyright (c) 2018-2019, Io Engineering (Terje Io) 11 | All rights reserved. 12 | 13 | Redistribution and use in source and binary forms, with or without modification, 14 | are permitted provided that the following conditions are met: 15 | 16 | · Redistributions of source code must retain the above copyright notice, this 17 | list of conditions and the following disclaimer. 18 | 19 | · Redistributions in binary form must reproduce the above copyright notice, this 20 | list of conditions and the following disclaimer in the documentation and/or 21 | other materials provided with the distribution. 22 | 23 | · Neither the name of the copyright holder nor the names of its contributors may 24 | be used to endorse or promote products derived from this software without 25 | specific prior written permission. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 28 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 31 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 34 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | 38 | */ 39 | 40 | using System; 41 | using System.Collections.Generic; 42 | using System.ComponentModel; 43 | using System.Drawing; 44 | using System.Data; 45 | using System.Linq; 46 | using System.Text; 47 | using System.Windows.Forms; 48 | 49 | namespace CNC_Controls 50 | { 51 | public partial class GrblStatusControl : UserControl 52 | { 53 | private delegate void SetTextCallback(string text, Color color); 54 | private delegate void SetHomeBtnColorCallback(string text); 55 | 56 | private Color HomeButtonColor; 57 | 58 | public GCodeJob GCodeSender; 59 | 60 | public GrblStatusControl() 61 | { 62 | InitializeComponent(); 63 | 64 | this.btnReset.Click += new EventHandler(btnReset_Click); 65 | this.btnHome.Click += new EventHandler(btnHome_Click); 66 | this.btnUnlock.Click += new EventHandler(btnUnlock_Click); 67 | this.chkCheckMode.CheckedChanged += new EventHandler(chkCheckMode_CheckedChanged); 68 | 69 | this.txtState.ReadOnly = true; 70 | this.HomeButtonColor = this.btnHome.BackColor; 71 | } 72 | 73 | public bool HomingEnabled { get; set; } 74 | 75 | void chkCheckMode_CheckedChanged(object sender, EventArgs e) 76 | { 77 | if (((CheckBox)sender).Checked ? GCodeSender.state == GrblStates.Idle : GCodeSender.state == GrblStates.Check) 78 | GCodeSender.SendMDICommand(GCodeSender.state == GrblStates.Idle ? GrblConstants.CMD_CHECK : ((char)GrblConstants.CMD_RESET).ToString()); 79 | } 80 | 81 | void btnUnlock_Click(object sender, EventArgs e) 82 | { 83 | GCodeSender.SendMDICommand(GrblConstants.CMD_UNLOCK); 84 | } 85 | 86 | void btnHome_Click(object sender, EventArgs e) 87 | { 88 | this.btnHome.BackColor = Color.LightSkyBlue; 89 | GCodeSender.SendMDICommand(GrblConstants.CMD_HOMING); 90 | 91 | // G90 G10 L20 P0 X0 Y0 Z0 92 | } 93 | 94 | void btnReset_Click(object sender, EventArgs e) 95 | { 96 | GCodeSender.SendReset(); 97 | } 98 | 99 | public void Enable(bool enable) 100 | { 101 | this.btnHome.Enabled = enable && HomingEnabled; 102 | } 103 | 104 | public void CheckModeEnable(bool enable) 105 | { 106 | this.chkCheckMode.Enabled = enable; 107 | } 108 | 109 | public void setCheckMode(bool check) 110 | { 111 | if (chkCheckMode.Checked != check && GCodeSender.StreamingState == StreamingState.Idle) 112 | chkCheckMode.Checked = check; 113 | } 114 | 115 | public void DisplayState(string s, Color color) 116 | { 117 | if (this.txtState.InvokeRequired) 118 | this.Invoke(new SetTextCallback(DisplayState), new object[] { s, color }); 119 | else 120 | { 121 | this.txtState.Text = s; 122 | this.txtState.BackColor = color; 123 | } 124 | } 125 | 126 | public void SetHomingState(string s) 127 | { 128 | if (this.btnHome.InvokeRequired) 129 | this.Invoke(new SetHomeBtnColorCallback(SetHomingState), new object[] { s }); 130 | else switch (s) 131 | { 132 | case "": 133 | this.btnHome.BackColor = this.HomeButtonColor; 134 | break; 135 | 136 | case "0": 137 | this.btnHome.BackColor = Color.LightYellow; 138 | break; 139 | 140 | case "1": 141 | this.btnHome.BackColor = Color.LightGreen; 142 | break; 143 | } 144 | } 145 | } 146 | } 147 | -------------------------------------------------------------------------------- /CNC Controls/CNC Controls/Interface.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Interface.cs - part of CNC Controls library for Grbl 3 | * 4 | * v0.01 / 2019-05-13 / Io Engineering (Terje Io) 5 | * 6 | */ 7 | 8 | /* 9 | 10 | Copyright (c) 2018-2019, Io Engineering (Terje Io) 11 | All rights reserved. 12 | 13 | Redistribution and use in source and binary forms, with or without modification, 14 | are permitted provided that the following conditions are met: 15 | 16 | · Redistributions of source code must retain the above copyright notice, this 17 | list of conditions and the following disclaimer. 18 | 19 | · Redistributions in binary form must reproduce the above copyright notice, this 20 | list of conditions and the following disclaimer in the documentation and/or 21 | other materials provided with the distribution. 22 | 23 | · Neither the name of the copyright holder nor the names of its contributors may 24 | be used to endorse or promote products derived from this software without 25 | specific prior written permission. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 28 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 31 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 34 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | 38 | */ 39 | 40 | using System; 41 | using System.Collections.Generic; 42 | using System.Linq; 43 | using System.Text; 44 | 45 | namespace CNC_App 46 | { 47 | public enum UIMode 48 | { 49 | Startup = 0, 50 | Shutdown, 51 | Engraving, 52 | Mach3, 53 | GRBL, 54 | GRBLConfig, 55 | Offsets, 56 | PIDTuner, 57 | SDCard, 58 | G76Threading, 59 | Turning, 60 | Facing, 61 | Parting 62 | } 63 | 64 | public interface IRenderer 65 | { 66 | UIMode mode { get; } 67 | void Activate(bool activate, UIMode chgMode); 68 | void CloseFile(); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /CNC Controls/CNC Controls/MDIControl.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace CNC_Controls 2 | { 3 | partial class MDIControl 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.btnSend = new System.Windows.Forms.Button(); 32 | this.lblMDI = new System.Windows.Forms.Label(); 33 | this.txtMDI = new System.Windows.Forms.TextBox(); 34 | this.SuspendLayout(); 35 | // 36 | // btnSend 37 | // 38 | this.btnSend.Location = new System.Drawing.Point(400, 4); 39 | this.btnSend.Name = "btnSend"; 40 | this.btnSend.Size = new System.Drawing.Size(41, 21); 41 | this.btnSend.TabIndex = 0; 42 | this.btnSend.TabStop = false; 43 | this.btnSend.Text = "Send"; 44 | this.btnSend.UseVisualStyleBackColor = true; 45 | // 46 | // lblMDI 47 | // 48 | this.lblMDI.AutoSize = true; 49 | this.lblMDI.Location = new System.Drawing.Point(7, 7); 50 | this.lblMDI.Name = "lblMDI"; 51 | this.lblMDI.Size = new System.Drawing.Size(30, 13); 52 | this.lblMDI.TabIndex = 1; 53 | this.lblMDI.Text = "MDI:"; 54 | // 55 | // txtMDI 56 | // 57 | this.txtMDI.Location = new System.Drawing.Point(43, 4); 58 | this.txtMDI.Name = "txtMDI"; 59 | this.txtMDI.Size = new System.Drawing.Size(350, 20); 60 | this.txtMDI.TabIndex = 1; 61 | // 62 | // MDIControl 63 | // 64 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 65 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 66 | this.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; 67 | this.Controls.Add(this.txtMDI); 68 | this.Controls.Add(this.lblMDI); 69 | this.Controls.Add(this.btnSend); 70 | this.Name = "MDIControl"; 71 | this.Size = new System.Drawing.Size(450, 30); 72 | this.ResumeLayout(false); 73 | this.PerformLayout(); 74 | 75 | } 76 | 77 | #endregion 78 | 79 | private System.Windows.Forms.Button btnSend; 80 | private System.Windows.Forms.Label lblMDI; 81 | private System.Windows.Forms.TextBox txtMDI; 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /CNC Controls/CNC Controls/MDIControl.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * MDIControl.cs - part of CNC Controls library for Grbl 3 | * 4 | * v0.01 / 2018-09-14 / Io Engineering (Terje Io) 5 | * 6 | */ 7 | 8 | /* 9 | 10 | Copyright (c) 2018, Io Engineering (Terje Io) 11 | All rights reserved. 12 | 13 | Redistribution and use in source and binary forms, with or without modification, 14 | are permitted provided that the following conditions are met: 15 | 16 | · Redistributions of source code must retain the above copyright notice, this 17 | list of conditions and the following disclaimer. 18 | 19 | · Redistributions in binary form must reproduce the above copyright notice, this 20 | list of conditions and the following disclaimer in the documentation and/or 21 | other materials provided with the distribution. 22 | 23 | · Neither the name of the copyright holder nor the names of its contributors may 24 | be used to endorse or promote products derived from this software without 25 | specific prior written permission. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 28 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 31 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 34 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | 38 | */ 39 | 40 | using System; 41 | using System.Collections.Generic; 42 | using System.ComponentModel; 43 | using System.Drawing; 44 | using System.Data; 45 | using System.Linq; 46 | using System.Text; 47 | using System.Windows.Forms; 48 | 49 | namespace CNC_Controls 50 | { 51 | public partial class MDIControl : UserControl 52 | { 53 | 54 | public delegate void CommandGeneratedHandler(string command); 55 | public event CommandGeneratedHandler CommandGenerated; 56 | 57 | public MDIControl() 58 | { 59 | 60 | InitializeComponent(); 61 | 62 | this.btnSend.Click += new EventHandler(btnSend_Click); 63 | } 64 | 65 | void btnSend_Click(object sender, EventArgs e) 66 | { 67 | if(this.txtMDI.Text != "") 68 | CommandGenerated(this.txtMDI.Text); 69 | } 70 | 71 | public override string Text { get { return this.txtMDI.Text; } set { this.txtMDI.Text = value; } } 72 | public override bool Focused { get { return this.txtMDI.Focused; } } 73 | 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /CNC Controls/CNC Controls/MDIControl.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /CNC Controls/CNC Controls/MPGPending.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * MPGPending.cs - part of CNC Controls library for Grbl 3 | * 4 | * v0.01 / 2019-05-11 / Io Engineering (Terje Io) 5 | * 6 | */ 7 | 8 | /* 9 | 10 | Copyright (c) 2019, Io Engineering (Terje Io) 11 | All rights reserved. 12 | 13 | Redistribution and use in source and binary forms, with or without modification, 14 | are permitted provided that the following conditions are met: 15 | 16 | · Redistributions of source code must retain the above copyright notice, this 17 | list of conditions and the following disclaimer. 18 | 19 | · Redistributions in binary form must reproduce the above copyright notice, this 20 | list of conditions and the following disclaimer in the documentation and/or 21 | other materials provided with the distribution. 22 | 23 | · Neither the name of the copyright holder nor the names of its contributors may 24 | be used to endorse or promote products derived from this software without 25 | specific prior written permission. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 28 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 31 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 34 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | 38 | */ 39 | 40 | using System; 41 | using System.Collections.Generic; 42 | using System.ComponentModel; 43 | using System.Data; 44 | using System.Drawing; 45 | using System.Linq; 46 | using System.Text; 47 | using System.Windows.Forms; 48 | using CNC_Controls; 49 | using CNC_App; 50 | 51 | namespace CNC_Controls 52 | { 53 | public partial class MPGPending : Form 54 | { 55 | private delegate void CloseCallback(); 56 | 57 | private GrblStatusParameters parameters = new GrblStatusParameters(); 58 | 59 | public MPGPending() 60 | { 61 | InitializeComponent(); 62 | 63 | Cancelled = true; 64 | 65 | this.FormClosing += new FormClosingEventHandler(MPGPending_FormClosing); 66 | Comms.com.DataReceived += new DataReceivedHandler(DataReceived); 67 | } 68 | 69 | public bool Cancelled { get; private set; } 70 | 71 | void MPGPending_FormClosing(object sender, FormClosingEventArgs e) 72 | { 73 | Comms.com.DataReceived -= DataReceived; 74 | } 75 | 76 | private void ClosedDialog() 77 | { 78 | if (this.InvokeRequired) 79 | this.BeginInvoke(new CloseCallback(this.Close), new object[] { }); 80 | else 81 | this.Close(); 82 | } 83 | 84 | private void DataReceived(string data) 85 | { 86 | if (data.Length > 1 && data.Substring(0, 1) == "<") 87 | { 88 | bool parseState = true; 89 | data = data.Remove(data.Length - 1); 90 | 91 | string[] elements = data.Split('|'); 92 | 93 | foreach (string e in elements) 94 | { 95 | string[] pair = e.Split(':'); 96 | 97 | if (parseState) 98 | { 99 | parseState = false; 100 | } 101 | else if (parameters.Set(pair[0], pair[1])) 102 | { 103 | if (pair[0] == "MPG" && pair[1] == "0") 104 | { 105 | Cancelled = false; 106 | this.ClosedDialog(); 107 | } 108 | } 109 | } 110 | } 111 | } 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /CNC Controls/CNC Controls/MPGPending.designer.cs: -------------------------------------------------------------------------------- 1 | namespace CNC_Controls 2 | { 3 | partial class MPGPending 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MPGPending)); 32 | this.label1 = new System.Windows.Forms.Label(); 33 | this.SuspendLayout(); 34 | // 35 | // label1 36 | // 37 | this.label1.AutoSize = true; 38 | this.label1.BackColor = System.Drawing.SystemColors.Control; 39 | this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 40 | this.label1.Location = new System.Drawing.Point(42, 32); 41 | this.label1.Name = "label1"; 42 | this.label1.Size = new System.Drawing.Size(341, 20); 43 | this.label1.TabIndex = 0; 44 | this.label1.Text = "MPG mode active, waiting for it to be disabled..."; 45 | // 46 | // MPGPending 47 | // 48 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 49 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 50 | this.ClientSize = new System.Drawing.Size(447, 87); 51 | this.Controls.Add(this.label1); 52 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 53 | this.MaximizeBox = false; 54 | this.MinimizeBox = false; 55 | this.Name = "MPGPending"; 56 | this.Text = "GCode Sender"; 57 | this.ResumeLayout(false); 58 | this.PerformLayout(); 59 | 60 | } 61 | 62 | #endregion 63 | 64 | private System.Windows.Forms.Label label1; 65 | } 66 | } -------------------------------------------------------------------------------- /CNC Controls/CNC Controls/OverrideControl.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * OverrideControl.cs - part of CNC Controls library 3 | * 4 | * 2018-09-23 / Io Engineering (Terje Io) 5 | * 6 | */ 7 | 8 | /* 9 | 10 | Copyright (c) 2018, Io Engineering (Terje Io) 11 | All rights reserved. 12 | 13 | Redistribution and use in source and binary forms, with or without modification, 14 | are permitted provided that the following conditions are met: 15 | 16 | · Redistributions of source code must retain the above copyright notice, this 17 | list of conditions and the following disclaimer. 18 | 19 | · Redistributions in binary form must reproduce the above copyright notice, this 20 | list of conditions and the following disclaimer in the documentation and/or 21 | other materials provided with the distribution. 22 | 23 | · Neither the name of the copyright holder nor the names of its contributors may 24 | be used to endorse or promote products derived from this software without 25 | specific prior written permission. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 28 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 31 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 34 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | 38 | */ 39 | 40 | using System; 41 | using System.Collections.Generic; 42 | using System.ComponentModel; 43 | using System.Drawing; 44 | using System.Data; 45 | using System.Linq; 46 | using System.Text; 47 | using System.Windows.Forms; 48 | 49 | namespace CNC_Controls 50 | { 51 | public partial class OverrideControl : UserControl 52 | { 53 | public delegate void CommandGeneratedHandler(string command); 54 | public event CommandGeneratedHandler CommandGenerated; 55 | 56 | public OverrideControl() 57 | { 58 | InitializeComponent(); 59 | 60 | this.btnOvReset.Click += new EventHandler(btnOverrideClick); 61 | this.btnOvFineMinus.Click += new EventHandler(btnOverrideClick); 62 | this.btnOvFinePlus.Click += new EventHandler(btnOverrideClick); 63 | this.btnOvCoarseMinus.Click += new EventHandler(btnOverrideClick); 64 | this.btnOvCoarsePlus.Click += new EventHandler(btnOverrideClick); 65 | } 66 | 67 | public byte ResetCommand { set { this.btnOvReset.Tag = ((char)value).ToString(); } } 68 | public byte FinePlusCommand { set { this.btnOvFinePlus.Tag = ((char)value).ToString(); } } 69 | public byte FineMinusCommand { set { this.btnOvFineMinus.Tag = ((char)value).ToString(); } } 70 | public byte CoarsePlusCommand { set { this.btnOvCoarsePlus.Tag = ((char)value).ToString(); } } 71 | public byte CoarseMinusCommand { set { this.btnOvCoarseMinus.Tag = ((char)value).ToString(); } } 72 | 73 | private int cl (Control c) 74 | { 75 | return c.Location.Y + c.Height / 2; 76 | } 77 | 78 | public bool MinusOnly 79 | { 80 | set 81 | { 82 | if (this.btnOvFinePlus.Visible & value == true) 83 | { 84 | this.btnOvFinePlus.Hide(); 85 | this.btnOvCoarsePlus.Hide(); 86 | this.btnOvFineMinus.Location = new Point(this.btnOvFineMinus.Location.X, this.btnOvFineMinus.Location.Y - (cl(this.btnOvFineMinus) - cl(this.txtOverride))); 87 | this.btnOvCoarseMinus.Location = new Point(this.btnOvCoarseMinus.Location.X, this.btnOvCoarseMinus.Location.Y - (cl(this.btnOvCoarseMinus) - cl(this.txtOverride))); 88 | 89 | } 90 | 91 | } 92 | } 93 | 94 | 95 | public int Value { set { this.txtOverride.Text = value.ToString() + "%"; } } 96 | 97 | void btnOverrideClick(object sender, EventArgs e) 98 | { 99 | if (CommandGenerated != null) 100 | CommandGenerated((string)((Button)sender).Tag); 101 | } 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /CNC Controls/CNC Controls/OverrideControl.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /CNC Controls/CNC Controls/PIDTunerControl.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace CNC_Controls 2 | { 3 | partial class PIDTunerControl 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.PIDPlot = new System.Windows.Forms.Panel(); 32 | this.btnGetPIDData = new System.Windows.Forms.Button(); 33 | this.lblTarget = new System.Windows.Forms.Label(); 34 | this.lblActual = new System.Windows.Forms.Label(); 35 | this.lblError = new System.Windows.Forms.Label(); 36 | this.tbError = new System.Windows.Forms.TrackBar(); 37 | ((System.ComponentModel.ISupportInitialize)(this.tbError)).BeginInit(); 38 | this.SuspendLayout(); 39 | // 40 | // PIDPlot 41 | // 42 | this.PIDPlot.BackColor = System.Drawing.SystemColors.ControlLightLight; 43 | this.PIDPlot.Location = new System.Drawing.Point(19, 20); 44 | this.PIDPlot.Name = "PIDPlot"; 45 | this.PIDPlot.Size = new System.Drawing.Size(637, 405); 46 | this.PIDPlot.TabIndex = 0; 47 | // 48 | // btnGetPIDData 49 | // 50 | this.btnGetPIDData.Location = new System.Drawing.Point(19, 445); 51 | this.btnGetPIDData.Name = "btnGetPIDData"; 52 | this.btnGetPIDData.Size = new System.Drawing.Size(75, 23); 53 | this.btnGetPIDData.TabIndex = 1; 54 | this.btnGetPIDData.Text = "Get data"; 55 | this.btnGetPIDData.UseVisualStyleBackColor = true; 56 | // 57 | // lblTarget 58 | // 59 | this.lblTarget.AutoSize = true; 60 | this.lblTarget.ForeColor = System.Drawing.Color.Green; 61 | this.lblTarget.Location = new System.Drawing.Point(660, 20); 62 | this.lblTarget.Name = "lblTarget"; 63 | this.lblTarget.Size = new System.Drawing.Size(38, 13); 64 | this.lblTarget.TabIndex = 2; 65 | this.lblTarget.Text = "Target"; 66 | // 67 | // lblActual 68 | // 69 | this.lblActual.AutoSize = true; 70 | this.lblActual.ForeColor = System.Drawing.Color.Blue; 71 | this.lblActual.Location = new System.Drawing.Point(660, 60); 72 | this.lblActual.Name = "lblActual"; 73 | this.lblActual.Size = new System.Drawing.Size(37, 13); 74 | this.lblActual.TabIndex = 3; 75 | this.lblActual.Text = "Actual"; 76 | // 77 | // lblError 78 | // 79 | this.lblError.AutoSize = true; 80 | this.lblError.ForeColor = System.Drawing.Color.Red; 81 | this.lblError.Location = new System.Drawing.Point(660, 40); 82 | this.lblError.Name = "lblError"; 83 | this.lblError.Size = new System.Drawing.Size(29, 13); 84 | this.lblError.TabIndex = 4; 85 | this.lblError.Text = "Error"; 86 | // 87 | // tbError 88 | // 89 | this.tbError.LargeChange = 50; 90 | this.tbError.Location = new System.Drawing.Point(662, 380); 91 | this.tbError.Maximum = 3000; 92 | this.tbError.Minimum = 1; 93 | this.tbError.Name = "tbError"; 94 | this.tbError.Size = new System.Drawing.Size(200, 45); 95 | this.tbError.SmallChange = 10; 96 | this.tbError.TabIndex = 5; 97 | this.tbError.Value = 2500; 98 | // 99 | // PIDTunerControl 100 | // 101 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 102 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 103 | this.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; 104 | this.Controls.Add(this.tbError); 105 | this.Controls.Add(this.lblError); 106 | this.Controls.Add(this.lblActual); 107 | this.Controls.Add(this.lblTarget); 108 | this.Controls.Add(this.btnGetPIDData); 109 | this.Controls.Add(this.PIDPlot); 110 | this.Margin = new System.Windows.Forms.Padding(0); 111 | this.Name = "PIDTunerControl"; 112 | this.Size = new System.Drawing.Size(871, 511); 113 | ((System.ComponentModel.ISupportInitialize)(this.tbError)).EndInit(); 114 | this.ResumeLayout(false); 115 | this.PerformLayout(); 116 | 117 | } 118 | 119 | #endregion 120 | 121 | private System.Windows.Forms.Panel PIDPlot; 122 | private System.Windows.Forms.Button btnGetPIDData; 123 | private System.Windows.Forms.Label lblTarget; 124 | private System.Windows.Forms.Label lblActual; 125 | private System.Windows.Forms.Label lblError; 126 | private System.Windows.Forms.TrackBar tbError; 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /CNC Controls/CNC Controls/PIDTunerControl.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /CNC Controls/CNC Controls/PPIControl.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /CNC Controls/CNC Controls/ProfileControl.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace CNC_Controls 2 | { 3 | partial class ProfileControl 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.components = new System.ComponentModel.Container(); 32 | this.btnProfile = new System.Windows.Forms.Button(); 33 | this.cmbProfile = new System.Windows.Forms.ComboBox(); 34 | this.lblProfile = new System.Windows.Forms.Label(); 35 | this.mnuProfileContext = new System.Windows.Forms.ContextMenuStrip(this.components); 36 | this.mitAdd = new System.Windows.Forms.ToolStripMenuItem(); 37 | this.mitUpdate = new System.Windows.Forms.ToolStripMenuItem(); 38 | this.mitDelete = new System.Windows.Forms.ToolStripMenuItem(); 39 | this.mnuProfileContext.SuspendLayout(); 40 | this.SuspendLayout(); 41 | // 42 | // btnProfile 43 | // 44 | this.btnProfile.Location = new System.Drawing.Point(196, 3); 45 | this.btnProfile.Name = "btnProfile"; 46 | this.btnProfile.Size = new System.Drawing.Size(24, 23); 47 | this.btnProfile.TabIndex = 29; 48 | this.btnProfile.Text = "..."; 49 | this.btnProfile.UseVisualStyleBackColor = true; 50 | // 51 | // cmbProfile 52 | // 53 | this.cmbProfile.FormattingEnabled = true; 54 | this.cmbProfile.Items.AddRange(new object[] { 55 | ""}); 56 | this.cmbProfile.Location = new System.Drawing.Point(42, 3); 57 | this.cmbProfile.Name = "cmbProfile"; 58 | this.cmbProfile.Size = new System.Drawing.Size(148, 21); 59 | this.cmbProfile.TabIndex = 28; 60 | // 61 | // lblProfile 62 | // 63 | this.lblProfile.AutoSize = true; 64 | this.lblProfile.Location = new System.Drawing.Point(4, 6); 65 | this.lblProfile.Name = "lblProfile"; 66 | this.lblProfile.Size = new System.Drawing.Size(39, 13); 67 | this.lblProfile.TabIndex = 27; 68 | this.lblProfile.Text = "Profile:"; 69 | // 70 | // mnuProfileContext 71 | // 72 | this.mnuProfileContext.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 73 | this.mitAdd, 74 | this.mitUpdate, 75 | this.mitDelete}); 76 | this.mnuProfileContext.Name = "mnuProfileContext"; 77 | this.mnuProfileContext.Size = new System.Drawing.Size(113, 70); 78 | // 79 | // mitAdd 80 | // 81 | this.mitAdd.Name = "mitAdd"; 82 | this.mitAdd.Size = new System.Drawing.Size(112, 22); 83 | this.mitAdd.Text = "Add"; 84 | // 85 | // mitUpdate 86 | // 87 | this.mitUpdate.Name = "mitUpdate"; 88 | this.mitUpdate.Size = new System.Drawing.Size(112, 22); 89 | this.mitUpdate.Text = "Update"; 90 | // 91 | // mitDelete 92 | // 93 | this.mitDelete.Name = "mitDelete"; 94 | this.mitDelete.Size = new System.Drawing.Size(112, 22); 95 | this.mitDelete.Text = "Delete"; 96 | // 97 | // ProfileControl 98 | // 99 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 100 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 101 | this.Controls.Add(this.btnProfile); 102 | this.Controls.Add(this.cmbProfile); 103 | this.Controls.Add(this.lblProfile); 104 | this.Name = "ProfileControl"; 105 | this.Size = new System.Drawing.Size(225, 36); 106 | this.mnuProfileContext.ResumeLayout(false); 107 | this.ResumeLayout(false); 108 | this.PerformLayout(); 109 | 110 | } 111 | 112 | #endregion 113 | 114 | private System.Windows.Forms.Button btnProfile; 115 | private System.Windows.Forms.ComboBox cmbProfile; 116 | private System.Windows.Forms.Label lblProfile; 117 | private System.Windows.Forms.ContextMenuStrip mnuProfileContext; 118 | private System.Windows.Forms.ToolStripMenuItem mitAdd; 119 | private System.Windows.Forms.ToolStripMenuItem mitUpdate; 120 | private System.Windows.Forms.ToolStripMenuItem mitDelete; 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /CNC Controls/CNC Controls/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("CNC Controls")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Io Engineering")] 12 | [assembly: AssemblyProduct("CNC Controls")] 13 | [assembly: AssemblyCopyright("Copyright © 2019 Io Engineering")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("0209bdd1-4b91-475f-9476-f930bba6164d")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.4.0")] 36 | [assembly: AssemblyFileVersion("1.0.4.0")] 37 | -------------------------------------------------------------------------------- /CNC Controls/CNC Controls/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.36460 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace CNC_Controls.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CNC_Controls.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /CNC Controls/CNC Controls/Resources/App.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terjeio/Grbl_CNC_Controls/894ef319b6365c8e1847e85e64e147167c750e90/CNC Controls/CNC Controls/Resources/App.ico -------------------------------------------------------------------------------- /CNC Controls/CNC Controls/SDCardControl.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace CNC_Controls 2 | { 3 | partial class SDCardControl 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); 32 | this.GrblFileView = new System.Windows.Forms.DataGridView(); 33 | this.SettingName = new System.Windows.Forms.DataGridViewTextBoxColumn(); 34 | this.Value = new System.Windows.Forms.DataGridViewTextBoxColumn(); 35 | this.Unit = new System.Windows.Forms.DataGridViewTextBoxColumn(); 36 | ((System.ComponentModel.ISupportInitialize)(this.GrblFileView)).BeginInit(); 37 | this.SuspendLayout(); 38 | // 39 | // GrblFileView 40 | // 41 | this.GrblFileView.AllowUserToAddRows = false; 42 | this.GrblFileView.AllowUserToDeleteRows = false; 43 | this.GrblFileView.AllowUserToResizeRows = false; 44 | this.GrblFileView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; 45 | this.GrblFileView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { 46 | this.SettingName, 47 | this.Value, 48 | this.Unit}); 49 | this.GrblFileView.Location = new System.Drawing.Point(14, 14); 50 | this.GrblFileView.MultiSelect = false; 51 | this.GrblFileView.Name = "GrblFileView"; 52 | this.GrblFileView.ReadOnly = true; 53 | this.GrblFileView.RowHeadersVisible = false; 54 | this.GrblFileView.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; 55 | this.GrblFileView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; 56 | this.GrblFileView.Size = new System.Drawing.Size(392, 485); 57 | this.GrblFileView.TabIndex = 2; 58 | // 59 | // SettingName 60 | // 61 | this.SettingName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; 62 | this.SettingName.DataPropertyName = "Name"; 63 | this.SettingName.HeaderText = "Name"; 64 | this.SettingName.Name = "SettingName"; 65 | this.SettingName.ReadOnly = true; 66 | // 67 | // Value 68 | // 69 | this.Value.DataPropertyName = "Size"; 70 | dataGridViewCellStyle1.NullValue = null; 71 | this.Value.DefaultCellStyle = dataGridViewCellStyle1; 72 | this.Value.HeaderText = "Size"; 73 | this.Value.Name = "Value"; 74 | this.Value.ReadOnly = true; 75 | this.Value.Resizable = System.Windows.Forms.DataGridViewTriState.False; 76 | this.Value.Width = 90; 77 | // 78 | // Unit 79 | // 80 | this.Unit.DataPropertyName = "Invalid"; 81 | this.Unit.HeaderText = "Unit"; 82 | this.Unit.Name = "Unit"; 83 | this.Unit.ReadOnly = true; 84 | this.Unit.Resizable = System.Windows.Forms.DataGridViewTriState.False; 85 | this.Unit.Width = 75; 86 | // 87 | // SDCardControl 88 | // 89 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 90 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 91 | this.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; 92 | this.Controls.Add(this.GrblFileView); 93 | this.Name = "SDCardControl"; 94 | this.Size = new System.Drawing.Size(871, 511); 95 | ((System.ComponentModel.ISupportInitialize)(this.GrblFileView)).EndInit(); 96 | this.ResumeLayout(false); 97 | 98 | } 99 | 100 | #endregion 101 | 102 | private System.Windows.Forms.DataGridView GrblFileView; 103 | private System.Windows.Forms.DataGridViewTextBoxColumn SettingName; 104 | private System.Windows.Forms.DataGridViewTextBoxColumn Value; 105 | private System.Windows.Forms.DataGridViewTextBoxColumn Unit; 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /CNC Controls/CNC Controls/SignalsControl.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * SignalsControl.cs - part of CNC Controls library 3 | * 4 | * 2018-10-03 / Io Engineering (Terje Io) 5 | * 6 | */ 7 | 8 | /* 9 | 10 | Copyright (c) 2018, Io Engineering (Terje Io) 11 | All rights reserved. 12 | 13 | Redistribution and use in source and binary forms, with or without modification, 14 | are permitted provided that the following conditions are met: 15 | 16 | · Redistributions of source code must retain the above copyright notice, this 17 | list of conditions and the following disclaimer. 18 | 19 | · Redistributions in binary form must reproduce the above copyright notice, this 20 | list of conditions and the following disclaimer in the documentation and/or 21 | other materials provided with the distribution. 22 | 23 | · Neither the name of the copyright holder nor the names of its contributors may 24 | be used to endorse or promote products derived from this software without 25 | specific prior written permission. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 28 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 31 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 34 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | 38 | */ 39 | 40 | using System; 41 | using System.Collections.Generic; 42 | using System.ComponentModel; 43 | using System.Drawing; 44 | using System.Data; 45 | using System.Linq; 46 | using System.Text; 47 | using System.Windows.Forms; 48 | 49 | namespace CNC_Controls 50 | { 51 | public partial class SignalsControl : UserControl 52 | { 53 | Color LEDOn = Color.Red, LEDOff = Color.LightGray; 54 | 55 | private const string baseSignals = "HSRDP"; 56 | 57 | public SignalsControl() 58 | { 59 | InitializeComponent(); 60 | this.Config("XYZ" + SignalsControl.baseSignals); 61 | this.Set(""); 62 | } 63 | 64 | public void setLatheMode() 65 | { 66 | this.Config("XZ" + SignalsControl.baseSignals); 67 | this.Set(""); 68 | } 69 | 70 | public void setNumAxes(int numAxes) 71 | { 72 | if (numAxes <= 3 || numAxes > 6) 73 | return; 74 | 75 | string axes = "XYZ"; 76 | 77 | for (int axis = 3; axis < numAxes; axis++) 78 | axes += GrblInfo.AxisLetters.Substring(axis, 1); 79 | 80 | this.Config(axes + SignalsControl.baseSignals); 81 | this.Set(""); 82 | } 83 | 84 | public void Config(string signals) 85 | { 86 | foreach (Control c in this.groupBox.Controls) 87 | if(c.Tag != null) 88 | c.Visible = signals.Contains(((string)c.Tag)[0]); 89 | } 90 | 91 | public void Set (string signals) 92 | { 93 | foreach (Control c in this.groupBox.Controls) 94 | if (c.GetType() == typeof(Button) && c.Visible) 95 | c.BackColor = signals.Contains(((string)c.Tag)[0]) ? LEDOn : LEDOff; 96 | } 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /CNC Controls/CNC Controls/SignalsControl.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /CNC Controls/CNC Controls/SpindleControl.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace CNC_Controls 2 | { 3 | partial class SpindleControl 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.groupBox1 = new System.Windows.Forms.GroupBox(); 32 | this.overrideControl = new CNC_Controls.OverrideControl(); 33 | this.txtRPM = new System.Windows.Forms.TextBox(); 34 | this.lblRPM = new System.Windows.Forms.Label(); 35 | this.rbSpindleCCW = new System.Windows.Forms.RadioButton(); 36 | this.rbSpindleCW = new System.Windows.Forms.RadioButton(); 37 | this.rbSpindleOff = new System.Windows.Forms.RadioButton(); 38 | this.groupBox1.SuspendLayout(); 39 | this.SuspendLayout(); 40 | // 41 | // groupBox1 42 | // 43 | this.groupBox1.Controls.Add(this.overrideControl); 44 | this.groupBox1.Controls.Add(this.txtRPM); 45 | this.groupBox1.Controls.Add(this.lblRPM); 46 | this.groupBox1.Controls.Add(this.rbSpindleCCW); 47 | this.groupBox1.Controls.Add(this.rbSpindleCW); 48 | this.groupBox1.Controls.Add(this.rbSpindleOff); 49 | this.groupBox1.Location = new System.Drawing.Point(3, 3); 50 | this.groupBox1.Name = "groupBox1"; 51 | this.groupBox1.Size = new System.Drawing.Size(210, 130); 52 | this.groupBox1.TabIndex = 26; 53 | this.groupBox1.TabStop = false; 54 | this.groupBox1.Text = "Spindle"; 55 | // 56 | // overrideControl 57 | // 58 | this.overrideControl.Location = new System.Drawing.Point(30, 61); 59 | this.overrideControl.Name = "overrideControl"; 60 | this.overrideControl.Size = new System.Drawing.Size(174, 61); 61 | this.overrideControl.TabIndex = 5; 62 | // 63 | // txtRPM 64 | // 65 | this.txtRPM.Location = new System.Drawing.Point(48, 42); 66 | this.txtRPM.Name = "txtRPM"; 67 | this.txtRPM.Size = new System.Drawing.Size(67, 20); 68 | this.txtRPM.TabIndex = 0; 69 | // 70 | // lblRPM 71 | // 72 | this.lblRPM.AutoSize = true; 73 | this.lblRPM.Location = new System.Drawing.Point(11, 45); 74 | this.lblRPM.Name = "lblRPM"; 75 | this.lblRPM.Size = new System.Drawing.Size(31, 13); 76 | this.lblRPM.TabIndex = 3; 77 | this.lblRPM.Text = "RPM"; 78 | // 79 | // rbSpindleCCW 80 | // 81 | this.rbSpindleCCW.AutoSize = true; 82 | this.rbSpindleCCW.Location = new System.Drawing.Point(112, 19); 83 | this.rbSpindleCCW.Name = "rbSpindleCCW"; 84 | this.rbSpindleCCW.Size = new System.Drawing.Size(50, 17); 85 | this.rbSpindleCCW.TabIndex = 0; 86 | this.rbSpindleCCW.Text = "CCW"; 87 | this.rbSpindleCCW.UseVisualStyleBackColor = true; 88 | // 89 | // rbSpindleCW 90 | // 91 | this.rbSpindleCW.AutoSize = true; 92 | this.rbSpindleCW.Location = new System.Drawing.Point(62, 19); 93 | this.rbSpindleCW.Name = "rbSpindleCW"; 94 | this.rbSpindleCW.Size = new System.Drawing.Size(43, 17); 95 | this.rbSpindleCW.TabIndex = 0; 96 | this.rbSpindleCW.Text = "CW"; 97 | this.rbSpindleCW.UseVisualStyleBackColor = true; 98 | // 99 | // rbSpindleOff 100 | // 101 | this.rbSpindleOff.AutoSize = true; 102 | this.rbSpindleOff.Location = new System.Drawing.Point(16, 19); 103 | this.rbSpindleOff.Name = "rbSpindleOff"; 104 | this.rbSpindleOff.Size = new System.Drawing.Size(39, 17); 105 | this.rbSpindleOff.TabIndex = 0; 106 | this.rbSpindleOff.Text = "Off"; 107 | this.rbSpindleOff.UseVisualStyleBackColor = true; 108 | // 109 | // SpindleControl 110 | // 111 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 112 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 113 | this.Controls.Add(this.groupBox1); 114 | this.Name = "SpindleControl"; 115 | this.Size = new System.Drawing.Size(216, 136); 116 | this.groupBox1.ResumeLayout(false); 117 | this.groupBox1.PerformLayout(); 118 | this.ResumeLayout(false); 119 | 120 | } 121 | 122 | #endregion 123 | 124 | private System.Windows.Forms.GroupBox groupBox1; 125 | private System.Windows.Forms.RadioButton rbSpindleOff; 126 | private System.Windows.Forms.Label lblRPM; 127 | private System.Windows.Forms.RadioButton rbSpindleCCW; 128 | private System.Windows.Forms.RadioButton rbSpindleCW; 129 | private System.Windows.Forms.TextBox txtRPM; 130 | private OverrideControl overrideControl; 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /CNC Controls/CNC Controls/UIUtils.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * UIUtils.cs - part of CNC Controls library 3 | * 4 | * v0.01 / 2019-05-14 / Io Engineering (Terje Io) 5 | * 6 | */ 7 | 8 | /* 9 | 10 | Copyright (c) 2018-2019, Io Engineering (Terje Io) 11 | All rights reserved. 12 | 13 | Redistribution and use in source and binary forms, with or without modification, 14 | are permitted provided that the following conditions are met: 15 | 16 | · Redistributions of source code must retain the above copyright notice, this 17 | list of conditions and the following disclaimer. 18 | 19 | · Redistributions in binary form must reproduce the above copyright notice, this 20 | list of conditions and the following disclaimer in the documentation and/or 21 | other materials provided with the distribution. 22 | 23 | · Neither the name of the copyright holder nor the names of its contributors may 24 | be used to endorse or promote products derived from this software without 25 | specific prior written permission. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 28 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 31 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 34 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | 38 | */ 39 | 40 | using System; 41 | using System.Collections.Generic; 42 | using System.Linq; 43 | using System.Text; 44 | using System.Windows.Forms; 45 | using System.Drawing; 46 | 47 | namespace CNC_Controls 48 | { 49 | class UIUtils 50 | { 51 | public static void ProcessMask(Control control, KeyPressEventArgs e, int precision) 52 | { 53 | int dp = control.Text.IndexOf("."), cp = control is TextBox ? ((TextBox)control).SelectionStart : ((ComboBox)control).SelectionStart; 54 | bool has_dp = control is TextBox ? ((TextBox)control).SelectedText.Contains('.') : ((ComboBox)control).SelectedText.Contains('.'); 55 | bool allow_sign = precision < 0; 56 | if (allow_sign) 57 | precision = -precision; 58 | 59 | e.Handled = (dp >= 0 && dp < cp && control.Text.Length - dp > precision && char.IsDigit(e.KeyChar) && !has_dp) || 60 | !(char.IsDigit(e.KeyChar) || 61 | char.IsControl(e.KeyChar) || 62 | (dp >= 0 && control.Text.Length - dp > precision && char.IsDigit(e.KeyChar) && !has_dp) || 63 | (precision > 0 && e.KeyChar == '.' && (dp == -1 || has_dp)) || 64 | (allow_sign && cp == 0 && e.KeyChar == '-' && !control.Text.StartsWith("-"))); 65 | 66 | } 67 | 68 | private static void wField_KeyPress(object sender, KeyPressEventArgs e) 69 | { 70 | int precision = ((String)((Control)sender).Tag).Contains('.') ? ((String)((Control)sender).Tag).Substring(((String)((Control)sender).Tag).LastIndexOf('.')).Length - 1 : 0; 71 | 72 | UIUtils.ProcessMask((Control)sender, e, precision); 73 | } 74 | 75 | public static void SetMask(Control control, String format) 76 | { 77 | control.Tag = format; 78 | if (control is TextBox) 79 | ((TextBox)control).MaxLength = format.Length; 80 | else if (control is ComboBox) 81 | ((ComboBox)control).MaxLength = format.Length; 82 | control.KeyPress += new KeyPressEventHandler(UIUtils.wField_KeyPress); 83 | } 84 | 85 | public static void GroupBoxCaptionBold(GroupBox groupBox) 86 | { 87 | foreach (Control c in groupBox.Controls) 88 | c.Font = groupBox.Parent.Font; 89 | 90 | groupBox.Font = new Font(groupBox.Font.Name, groupBox.Font.SizeInPoints, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 91 | } 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /Grbl Config App/Grbl Config App.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Grbl Config App", "Grbl Config App\Grbl Config App.csproj", "{CF54391A-56A0-4F61-95C7-307C0D822A75}" 5 | EndProject 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CNC Controls", "..\CNC Controls\CNC Controls\CNC Controls.csproj", "{288C05F8-20D7-4436-8E91-A1E306A4D7F6}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Debug|Mixed Platforms = Debug|Mixed Platforms 12 | Debug|x86 = Debug|x86 13 | Release|Any CPU = Release|Any CPU 14 | Release|Mixed Platforms = Release|Mixed Platforms 15 | Release|x86 = Release|x86 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {CF54391A-56A0-4F61-95C7-307C0D822A75}.Debug|Any CPU.ActiveCfg = Debug|x86 19 | {CF54391A-56A0-4F61-95C7-307C0D822A75}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 20 | {CF54391A-56A0-4F61-95C7-307C0D822A75}.Debug|Mixed Platforms.Build.0 = Debug|x86 21 | {CF54391A-56A0-4F61-95C7-307C0D822A75}.Debug|x86.ActiveCfg = Debug|x86 22 | {CF54391A-56A0-4F61-95C7-307C0D822A75}.Debug|x86.Build.0 = Debug|x86 23 | {CF54391A-56A0-4F61-95C7-307C0D822A75}.Release|Any CPU.ActiveCfg = Release|x86 24 | {CF54391A-56A0-4F61-95C7-307C0D822A75}.Release|Mixed Platforms.ActiveCfg = Release|x86 25 | {CF54391A-56A0-4F61-95C7-307C0D822A75}.Release|Mixed Platforms.Build.0 = Release|x86 26 | {CF54391A-56A0-4F61-95C7-307C0D822A75}.Release|x86.ActiveCfg = Release|x86 27 | {CF54391A-56A0-4F61-95C7-307C0D822A75}.Release|x86.Build.0 = Release|x86 28 | {288C05F8-20D7-4436-8E91-A1E306A4D7F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 29 | {288C05F8-20D7-4436-8E91-A1E306A4D7F6}.Debug|Any CPU.Build.0 = Debug|Any CPU 30 | {288C05F8-20D7-4436-8E91-A1E306A4D7F6}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU 31 | {288C05F8-20D7-4436-8E91-A1E306A4D7F6}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 32 | {288C05F8-20D7-4436-8E91-A1E306A4D7F6}.Debug|x86.ActiveCfg = Debug|Any CPU 33 | {288C05F8-20D7-4436-8E91-A1E306A4D7F6}.Release|Any CPU.ActiveCfg = Release|Any CPU 34 | {288C05F8-20D7-4436-8E91-A1E306A4D7F6}.Release|Any CPU.Build.0 = Release|Any CPU 35 | {288C05F8-20D7-4436-8E91-A1E306A4D7F6}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 36 | {288C05F8-20D7-4436-8E91-A1E306A4D7F6}.Release|Mixed Platforms.Build.0 = Release|Any CPU 37 | {288C05F8-20D7-4436-8E91-A1E306A4D7F6}.Release|x86.ActiveCfg = Release|Any CPU 38 | EndGlobalSection 39 | GlobalSection(SolutionProperties) = preSolution 40 | HideSolutionNode = FALSE 41 | EndGlobalSection 42 | EndGlobal 43 | -------------------------------------------------------------------------------- /Grbl Config App/Grbl Config App/Grbl Config App.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | x86 6 | 8.0.30703 7 | 2.0 8 | {CF54391A-56A0-4F61-95C7-307C0D822A75} 9 | WinExe 10 | Properties 11 | Grbl_Config_App 12 | Grbl Config App 13 | v4.0 14 | 15 | 16 | 512 17 | 18 | 19 | x86 20 | true 21 | full 22 | false 23 | bin\Debug\ 24 | DEBUG;TRACE 25 | prompt 26 | 4 27 | 28 | 29 | x86 30 | pdbonly 31 | true 32 | bin\Release\ 33 | TRACE 34 | prompt 35 | 4 36 | 37 | 38 | true 39 | bin\Debug\ 40 | DEBUG;TRACE 41 | full 42 | AnyCPU 43 | prompt 44 | false 45 | false 46 | false 47 | 48 | 49 | bin\Release\ 50 | TRACE 51 | true 52 | pdbonly 53 | AnyCPU 54 | prompt 55 | false 56 | false 57 | false 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | Form 74 | 75 | 76 | UserUI.cs 77 | 78 | 79 | 80 | 81 | UserUI.cs 82 | 83 | 84 | ResXFileCodeGenerator 85 | Resources.Designer.cs 86 | Designer 87 | 88 | 89 | True 90 | Resources.resx 91 | True 92 | 93 | 94 | 95 | SettingsSingleFileGenerator 96 | Settings.Designer.cs 97 | 98 | 99 | True 100 | Settings.settings 101 | True 102 | 103 | 104 | 105 | 106 | {288C05F8-20D7-4436-8E91-A1E306A4D7F6} 107 | CNC Controls 108 | 109 | 110 | 111 | 118 | -------------------------------------------------------------------------------- /Grbl Config App/Grbl Config App/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Windows.Forms; 5 | 6 | namespace Grbl_Config_App 7 | { 8 | static class Program 9 | { 10 | /// 11 | /// The main entry point for the application. 12 | /// 13 | [STAThread] 14 | static void Main() 15 | { 16 | Application.EnableVisualStyles(); 17 | Application.SetCompatibleTextRenderingDefault(false); 18 | Application.Run(new UserUI()); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Grbl Config App/Grbl Config App/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Grbl Config App")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Io Engineering")] 12 | [assembly: AssemblyProduct("Grbl Config App")] 13 | [assembly: AssemblyCopyright("Copyright © 2019 Io Engineering")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("79c692ce-2f4c-4ff6-bf48-8d209a890c62")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.1.0")] 36 | [assembly: AssemblyFileVersion("1.0.1.0")] 37 | -------------------------------------------------------------------------------- /Grbl Config App/Grbl Config App/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.36392 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Grbl_Config_App.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Grbl_Config_App.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Grbl Config App/Grbl Config App/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /Grbl Config App/Grbl Config App/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.36392 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Grbl_Config_App.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Grbl Config App/Grbl Config App/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Grbl Config App/Grbl Config App/UserUI.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace Grbl_Config_App 2 | { 3 | partial class UserUI 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.grblConfig = new CNC_Controls.GrblConfig(); 32 | this.SuspendLayout(); 33 | // 34 | // grblConfig 35 | // 36 | this.grblConfig.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; 37 | this.grblConfig.Location = new System.Drawing.Point(9, 9); 38 | this.grblConfig.Margin = new System.Windows.Forms.Padding(0); 39 | this.grblConfig.Name = "grblConfig"; 40 | this.grblConfig.Size = new System.Drawing.Size(875, 515); 41 | this.grblConfig.TabIndex = 0; 42 | // 43 | // UserUI 44 | // 45 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 46 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 47 | this.ClientSize = new System.Drawing.Size(887, 529); 48 | this.Controls.Add(this.grblConfig); 49 | this.Name = "UserUI"; 50 | this.Text = "Grbl Configuration App"; 51 | this.ResumeLayout(false); 52 | 53 | } 54 | 55 | #endregion 56 | 57 | private CNC_Controls.GrblConfig grblConfig; 58 | } 59 | } 60 | 61 | -------------------------------------------------------------------------------- /Grbl Config App/Grbl Config App/UserUI.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * UserUI.cs - configuration tool for Grbl 3 | * 4 | * v0.01 / 2019-04-29 / Io Engineering (Terje Io) 5 | * 6 | */ 7 | 8 | /* 9 | 10 | Copyright (c) 2018-2019, Io Engineering (Terje Io) 11 | All rights reserved. 12 | 13 | Redistribution and use in source and binary forms, with or without modification, 14 | are permitted provided that the following conditions are met: 15 | 16 | · Redistributions of source code must retain the above copyright notice, this 17 | list of conditions and the following disclaimer. 18 | 19 | · Redistributions in binary form must reproduce the above copyright notice, this 20 | list of conditions and the following disclaimer in the documentation and/or 21 | other materials provided with the distribution. 22 | 23 | · Neither the name of the copyright holder nor the names of its contributors may 24 | be used to endorse or promote products derived from this software without 25 | specific prior written permission. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 28 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 31 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 34 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | 38 | */ 39 | 40 | using System; 41 | using System.Collections.Generic; 42 | using System.ComponentModel; 43 | using System.Data; 44 | using System.Drawing; 45 | using System.Linq; 46 | using System.IO; 47 | using System.Xml; 48 | using System.Text; 49 | using CNC_Controls; 50 | using CNC_App; 51 | 52 | using System.Windows.Forms; 53 | 54 | namespace Grbl_Config_App 55 | { 56 | public partial class UserUI : Form 57 | { 58 | private Comms com = null; 59 | 60 | public UserUI() 61 | { 62 | string PortParams = ""; 63 | 64 | InitializeComponent(); 65 | 66 | try 67 | { 68 | XmlDocument config = new XmlDocument(); 69 | 70 | config.Load(Application.StartupPath + "\\App.config"); 71 | 72 | foreach (XmlNode N in config.SelectNodes("Config/*")) 73 | { 74 | switch (N.Name) 75 | { 76 | case "PortParams": 77 | PortParams = N.InnerText; 78 | break; 79 | } 80 | } 81 | } 82 | catch 83 | { 84 | MessageBox.Show("Config file not found or invalid.", this.Text); 85 | System.Environment.Exit(1); 86 | } 87 | 88 | #if DEBUG 89 | PortParams = "com29:115200,N,8,1,P"; 90 | #endif 91 | 92 | new SerialComms(PortParams, Comms.ResetMode.None); 93 | 94 | if (!Comms.com.IsOpen) 95 | { 96 | this.com = null; 97 | MessageBox.Show("Unable to open serial port!", this.Text); 98 | System.Environment.Exit(2); 99 | } 100 | 101 | GrblLanguage.language = "en_US"; 102 | 103 | GrblInfo.Get(); 104 | GrblSettings.Load(); 105 | 106 | this.Text += ", Grbl version " + GrblInfo.Version; 107 | } 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /Grbl Config App/Grbl Config App/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Grbl Config App/Grbl Config App/bin/Release/App.config: -------------------------------------------------------------------------------- 1 | 2 | com22:115200,N,8,1,P 3 | 4 | -------------------------------------------------------------------------------- /Grbl Config App/readme.md: -------------------------------------------------------------------------------- 1 | ## GRBL Config Application 2 | 3 | An example application for the CNC Controls library, can be used for easy configuration of Grbl. 4 | The settings parameters along with their formats etc are stored in the setting_codes_en_US.txt file, please note this is a tab separated file. 5 | 6 | The App.config file has a setting for the serial port to use. 7 | -------------------------------------------------------------------------------- /media/5axes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terjeio/Grbl_CNC_Controls/894ef319b6365c8e1847e85e64e147167c750e90/media/5axes.png -------------------------------------------------------------------------------- /media/ConfigApp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terjeio/Grbl_CNC_Controls/894ef319b6365c8e1847e85e64e147167c750e90/media/ConfigApp.png -------------------------------------------------------------------------------- /media/laser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terjeio/Grbl_CNC_Controls/894ef319b6365c8e1847e85e64e147167c750e90/media/laser.png -------------------------------------------------------------------------------- /media/lathe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terjeio/Grbl_CNC_Controls/894ef319b6365c8e1847e85e64e147167c750e90/media/lathe.png -------------------------------------------------------------------------------- /media/mill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terjeio/Grbl_CNC_Controls/894ef319b6365c8e1847e85e64e147167c750e90/media/mill.png -------------------------------------------------------------------------------- /media/offsets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terjeio/Grbl_CNC_Controls/894ef319b6365c8e1847e85e64e147167c750e90/media/offsets.png -------------------------------------------------------------------------------- /media/profiles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terjeio/Grbl_CNC_Controls/894ef319b6365c8e1847e85e64e147167c750e90/media/profiles.png -------------------------------------------------------------------------------- /media/threading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terjeio/Grbl_CNC_Controls/894ef319b6365c8e1847e85e64e147167c750e90/media/threading.png -------------------------------------------------------------------------------- /media/tooltable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terjeio/Grbl_CNC_Controls/894ef319b6365c8e1847e85e64e147167c750e90/media/tooltable.png -------------------------------------------------------------------------------- /media/turning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terjeio/Grbl_CNC_Controls/894ef319b6365c8e1847e85e64e147167c750e90/media/turning.png -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | ## GRBL CNC Controls 2 | 3 | 4 | This project will most likely be archived, it is/will be superseded by the new [Grbl GCode Sender](https://github.com/terjeio/Grbl-GCode-Sender) project \(unless that fails testing\). 5 | 6 | --- 7 | 8 | A collection of .NET controls written in C# that I use to build my GCode senders, including a camera control based on [AForge libraries](http://www.aforgenet.com/framework/downloads.html). 9 | 10 | #### New controls added (preview version - likely to be modified, needs testing): 11 | 12 | ![Offsets](media/offsets.png) 13 | 14 | Offsets management (G54+). 15 |

16 | 17 | ![Tools](media/tooltable.png) 18 | 19 | GrblHAL can be configured with an internal tool table stored in EEPROM, this control can be used to manage that. 20 |

21 | 22 | ![Turning](media/turning.png) 23 | 24 | Turning wizard for lathes, note that vanilla grbl does not support CSS, [grblHAL](https://github.com/terjeio/grblHAL) does. 25 |

26 | 27 | 28 | ![Threading](media/threading.png) 29 | 30 | Threading wizard for lathes, requires a grbl port with G76 support such as [grblHAL](https://github.com/terjeio/grblHAL) compiled with a [driver](https://github.com/terjeio/grblHAL/tree/master/drivers/MSP432) supporting spindle synced motion \(under initial testing - NOT verified ok yet\). 31 | This wizard is based on FreeBasic code by [Stephan Brunker](https://www.sourceforge.net/p/mach3threadinghelper), ported to C# and adapted for this project. 32 |

33 | 34 | ![Profiles](media/profiles.png) 35 | 36 | For the lathe wizards profiles may be defined. 37 |
38 | 39 | Lathe wizards for facing and parting are in the pipeline... 40 | 41 |
42 | 43 | #### An application for configuring GRBL utilizing some of the controls is included as a separate project 44 | 45 | ![Config App UI](media/ConfigApp.png) 46 | 47 | The data entry fields are dynamically created according to a config file and facilitates easy configuration of GRBL. 48 | 49 | 50 | #### Some examples of GCode senders built on top of the library: 51 | 52 | ![Mill](media/mill.png) 53 | 54 | For plain 3-axis mill/router with grblHAL driver supporting manual tool change. 55 |

56 | 57 | ![Lathe](media/lathe.png) 58 | 59 | For lathe with grblHAL driver supporting spindle synced motion (driver is work in progress). 60 |

61 | 62 | ![5 Axes](media/5axes.png) 63 | 64 | For 5-axis configured grblHAL driver supporting SD card streaming. 65 |

66 | 67 | ![CO2 laser](media/laser.png) 68 | 69 | For custom driver and controller (not published) supporting CO2 laser engraving and cutting. 70 | 71 | --- 72 | 73 | #### NOTE: 74 | 75 | I do not plan (for the time beeing) to release any of my GCode senders based on the controls libray. Currently I have made one for my CO2 laser, one for my mini mill/router and one for my lathe to complement the [MPG/DRO pendant](https://github.com/terjeio/GRBL_MPG_DRO_BoosterPack). 76 | --------------------------------------------------------------------------------