diff --git a/LaserGRBL/AssemblyInfo.cs b/LaserGRBL/AssemblyInfo.cs index 6ab6ff135..9edb1a542 100644 --- a/LaserGRBL/AssemblyInfo.cs +++ b/LaserGRBL/AssemblyInfo.cs @@ -31,5 +31,5 @@ // È possibile specificare tutti i valori oppure impostare valori predefiniti per i numeri relativi alla revisione e alla build // utilizzando l'asterisco (*) come descritto di seguito: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion ("2.8.47")] +[assembly: AssemblyVersion ("2.8.48")] [assembly: NeutralResourcesLanguageAttribute("en")] diff --git a/LaserGRBL/GrblCore.cs b/LaserGRBL/GrblCore.cs index 3b6a92945..8f7306a7e 100644 --- a/LaserGRBL/GrblCore.cs +++ b/LaserGRBL/GrblCore.cs @@ -212,13 +212,13 @@ public object Clone() private int mCurF; private int mCurS; - private int mCurOvFeed; + private int mCurOvLinear; private int mCurOvRapids; - private int mCurOvSpindle; + private int mCurOvPower; - private int mTarOvFeed; + private int mTarOvLinear; private int mTarOvRapids; - private int mTarOvSpindle; + private int mTarOvPower; private decimal mLoopCount = 1; @@ -265,8 +265,8 @@ public GrblCore(System.Windows.Forms.Control syncroObject) mSentPtr = mSent; mQueuePtr = mQueue; - mCurOvFeed = mCurOvRapids = mCurOvSpindle = 100; - mTarOvFeed = mTarOvRapids = mTarOvSpindle = 100; + mCurOvLinear = mCurOvRapids = mCurOvPower = 100; + mTarOvLinear = mTarOvRapids = mTarOvPower = 100; if (!Settings.ExistObject("Hotkey Setup")) Settings.SetObject("Hotkey Setup", new HotKeysManager()); mHotKeyManager = (HotKeysManager)Settings.GetObject("Hotkey Setup", null); @@ -278,6 +278,34 @@ public GrblCore(System.Windows.Forms.Control syncroObject) CSVD.LoadAppropriateSettings(GrblVersion); //load setting for last known version } + internal void HotKeyOverride(HotKeysManager.HotKey.Actions action) + { + + switch (action) + { + case HotKeysManager.HotKey.Actions.OverridePowerDefault: + mTarOvPower = 100; break; + case HotKeysManager.HotKey.Actions.OverridePowerUp: + mTarOvPower = Math.Min(mTarOvPower + 1, 200); break; + case HotKeysManager.HotKey.Actions.OverridePowerDown: + mTarOvPower = Math.Max(mTarOvPower - 1, 10); break; + case HotKeysManager.HotKey.Actions.OverrideLinearDefault: + mTarOvLinear = 100; break; + case HotKeysManager.HotKey.Actions.OverrideLinearUp: + mTarOvLinear = Math.Min(mTarOvLinear + 1, 200); break; + case HotKeysManager.HotKey.Actions.OverrideLinearDown: + mTarOvLinear = Math.Max(mTarOvLinear - 1, 10); break; + case HotKeysManager.HotKey.Actions.OverrideRapidDefault: + mTarOvRapids = 100; break; + case HotKeysManager.HotKey.Actions.OverrideRapidUp: + mTarOvRapids = Math.Min(mTarOvRapids * 2, 100); break; + case HotKeysManager.HotKey.Actions.OverrideRapidDown: + mTarOvRapids = Math.Max(mTarOvRapids / 2, 25); break; + default: + break; + } + } + public GrblConf Configuration { get { return (GrblConf)Settings.GetObject("Grbl Configuration", new GrblConf()); } @@ -869,8 +897,8 @@ private void InternalReset(bool grbl) ClearQueue(true); mBuffer = 0; mTP.JobEnd(); - mCurOvFeed = mCurOvRapids = mCurOvSpindle = 100; - mTarOvFeed = mTarOvRapids = mTarOvSpindle = 100; + mCurOvLinear = mCurOvRapids = mCurOvPower = 100; + mTarOvLinear = mTarOvRapids = mTarOvPower = 100; if (grbl) SendImmediate(24); @@ -1230,8 +1258,8 @@ private void OnStartupMessage() //resetta tutto, così funziona anche nel caso d ClearQueue(false); mBuffer = 0; mTP.JobEnd(); - mCurOvFeed = mCurOvRapids = mCurOvSpindle = 100; - mTarOvFeed = mTarOvRapids = mTarOvSpindle = 100; + mCurOvLinear = mCurOvRapids = mCurOvPower = 100; + mTarOvLinear = mTarOvRapids = mTarOvPower = 100; } RiseOverrideChanged(); } @@ -1466,26 +1494,26 @@ private bool HasIncomingData() public void ManageOverrides() { - if (mTarOvFeed == 100 && mCurOvFeed != 100) //devo fare un reset + if (mTarOvLinear == 100 && mCurOvLinear != 100) //devo fare un reset SendImmediate(144); - else if (mTarOvFeed - mCurOvFeed >= 10) //devo fare un bigstep + + else if (mTarOvLinear - mCurOvLinear >= 10) //devo fare un bigstep + SendImmediate(145); - else if (mCurOvFeed - mTarOvFeed >= 10) //devo fare un bigstep - + else if (mCurOvLinear - mTarOvLinear >= 10) //devo fare un bigstep - SendImmediate(146); - else if (mTarOvFeed - mCurOvFeed >= 1) //devo fare uno smallstep + + else if (mTarOvLinear - mCurOvLinear >= 1) //devo fare uno smallstep + SendImmediate(147); - else if (mCurOvFeed - mTarOvFeed >= 1) //devo fare uno smallstep - + else if (mCurOvLinear - mTarOvLinear >= 1) //devo fare uno smallstep - SendImmediate(148); - if (mTarOvSpindle == 100 && mCurOvSpindle != 100) //devo fare un reset + if (mTarOvPower == 100 && mCurOvPower != 100) //devo fare un reset SendImmediate(153); - else if (mTarOvSpindle - mCurOvSpindle >= 10) //devo fare un bigstep + + else if (mTarOvPower - mCurOvPower >= 10) //devo fare un bigstep + SendImmediate(154); - else if (mCurOvSpindle - mTarOvSpindle >= 10) //devo fare un bigstep - + else if (mCurOvPower - mTarOvPower >= 10) //devo fare un bigstep - SendImmediate(155); - else if (mTarOvSpindle - mCurOvSpindle >= 1) //devo fare uno smallstep + + else if (mTarOvPower - mCurOvPower >= 1) //devo fare uno smallstep + SendImmediate(156); - else if (mCurOvSpindle - mTarOvSpindle >= 1) //devo fare uno smallstep - + else if (mCurOvPower - mTarOvPower >= 1) //devo fare uno smallstep - SendImmediate(157); if (mTarOvRapids == 100 && mCurOvRapids != 100) @@ -1511,28 +1539,28 @@ private void ParseOverrides(string data) private void ChangeOverrides(int feed, int rapids, int spindle) { - bool notify = (feed != mCurOvFeed || rapids != mCurOvRapids || spindle != mCurOvSpindle); - mCurOvFeed = feed; + bool notify = (feed != mCurOvLinear || rapids != mCurOvRapids || spindle != mCurOvPower); + mCurOvLinear = feed; mCurOvRapids = rapids; - mCurOvSpindle = spindle; + mCurOvPower = spindle; if (notify) RiseOverrideChanged(); } public int OverrideG1 - { get { return mCurOvFeed; } } + { get { return mCurOvLinear; } } public int OverrideG0 { get { return mCurOvRapids; } } public int OverrideS - { get { return mCurOvSpindle; } } + { get { return mCurOvPower; } } public int TOverrideG1 { - get { return mTarOvFeed; } - set { mTarOvFeed = value; } + get { return mTarOvLinear; } + set { mTarOvLinear = value; } } public int TOverrideG0 @@ -1543,8 +1571,8 @@ public int TOverrideG0 public int TOverrideS { - get { return mTarOvSpindle; } - set { mTarOvSpindle = value; } + get { return mTarOvPower; } + set { mTarOvPower = value; } } private void ParseMachineStatus(string data) diff --git a/LaserGRBL/HotKeysManager.cs b/LaserGRBL/HotKeysManager.cs index ad866c38f..b851914ae 100644 --- a/LaserGRBL/HotKeysManager.cs +++ b/LaserGRBL/HotKeysManager.cs @@ -17,10 +17,13 @@ public class HotKey : ICloneable public enum Actions { ConnectDisconnect = 10, Connect = 11, Disconnect = 12, - OpenFile = 20, ReopenLastFile = 21, SaveFile = 22, ExecuteFile = 23, + OpenFile = 20, ReopenLastFile = 21, SaveFile = 22, ExecuteFile = 23, AbortFile = 24, HelpOnline = 30, Reset = 100, Homing = 101, Unlock = 102, PauseJob = 103, ResumeJob = 104, SetNewZero = 105, JogHome = 1000, JogN = 1001, JogNE = 1002, JogE = 1003, JogSE = 1004, JogS = 1005, JogSW = 1006, JogW = 1007, JogNW = 1008, + OverridePowerDefault = 1100, OverridePowerUp = 1101, OverridePowerDown = 1102, + OverrideLinearDefault = 1110, OverrideLinearUp = 1111, OverrideLinearDown = 1112, + OverrideRapidDefault = 1120, OverrideRapidUp = 1121, OverrideRapidDown = 1122, CustomButton1 = 2000, CustomButton2 = 2001, CustomButton3 = 2002, CustomButton4 = 2003, CustomButton5 = 2004, CustomButton6 = 2005, CustomButton7 = 2006, CustomButton8 = 2007, CustomButton9 = 2008, CustomButton10 = 2009 } @@ -80,48 +83,84 @@ public object Clone() public HotKeysManager() { - Add(new HotKey(HotKey.Actions.ConnectDisconnect, Keys.F12)); - Add(new HotKey(HotKey.Actions.Connect, Keys.None)); - Add(new HotKey(HotKey.Actions.Disconnect, Keys.None)); - - Add(new HotKey(HotKey.Actions.OpenFile, Keys.Control | Keys.O)); - Add(new HotKey(HotKey.Actions.ReopenLastFile, Keys.Control | Keys.R)); - Add(new HotKey(HotKey.Actions.SaveFile, Keys.Control | Keys.S)); - Add(new HotKey(HotKey.Actions.ExecuteFile, Keys.F5)); - - Add(new HotKey(HotKey.Actions.HelpOnline, Keys.Control | Keys.F1)); - - Add(new HotKey(HotKey.Actions.Reset, Keys.Control | Keys.X)); - Add(new HotKey(HotKey.Actions.Homing, Keys.Control | Keys.H)); - Add(new HotKey(HotKey.Actions.Unlock, Keys.Control | Keys.U)); - Add(new HotKey(HotKey.Actions.PauseJob, Keys.F6)); - Add(new HotKey(HotKey.Actions.ResumeJob, Keys.F7)); - Add(new HotKey(HotKey.Actions.SetNewZero, Keys.Control | Keys.Z)); - - Add(new HotKey(HotKey.Actions.JogHome, Keys.NumPad5)); - Add(new HotKey(HotKey.Actions.JogN, Keys.NumPad8)); - Add(new HotKey(HotKey.Actions.JogNE, Keys.NumPad9)); - Add(new HotKey(HotKey.Actions.JogE, Keys.NumPad6)); - Add(new HotKey(HotKey.Actions.JogSE, Keys.NumPad3)); - Add(new HotKey(HotKey.Actions.JogS, Keys.NumPad2)); - Add(new HotKey(HotKey.Actions.JogSW, Keys.NumPad1)); - Add(new HotKey(HotKey.Actions.JogW, Keys.NumPad4)); - Add(new HotKey(HotKey.Actions.JogNW, Keys.NumPad7)); - - Add(new HotKey(HotKey.Actions.CustomButton1, Keys.Control | Keys.D1)); - Add(new HotKey(HotKey.Actions.CustomButton2, Keys.Control | Keys.D2)); - Add(new HotKey(HotKey.Actions.CustomButton3, Keys.Control | Keys.D3)); - Add(new HotKey(HotKey.Actions.CustomButton4, Keys.Control | Keys.D4)); - Add(new HotKey(HotKey.Actions.CustomButton5, Keys.Control | Keys.D5)); - Add(new HotKey(HotKey.Actions.CustomButton6, Keys.Control | Keys.D6)); - Add(new HotKey(HotKey.Actions.CustomButton7, Keys.Control | Keys.D7)); - Add(new HotKey(HotKey.Actions.CustomButton8, Keys.Control | Keys.D8)); - Add(new HotKey(HotKey.Actions.CustomButton9, Keys.Control | Keys.D9)); - Add(new HotKey(HotKey.Actions.CustomButton10, Keys.Control | Keys.D0)); + + } + + private void AddAllFeatures() + { + AddNew(new HotKey(HotKey.Actions.ConnectDisconnect, Keys.F12)); + AddNew(new HotKey(HotKey.Actions.Connect, Keys.None)); + AddNew(new HotKey(HotKey.Actions.Disconnect, Keys.None)); + + AddNew(new HotKey(HotKey.Actions.OpenFile, Keys.Control | Keys.O)); + AddNew(new HotKey(HotKey.Actions.ReopenLastFile, Keys.Control | Keys.R)); + AddNew(new HotKey(HotKey.Actions.SaveFile, Keys.Control | Keys.S)); + AddNew(new HotKey(HotKey.Actions.ExecuteFile, Keys.F5)); + AddNew(new HotKey(HotKey.Actions.AbortFile, Keys.Control | Keys.F5)); + + AddNew(new HotKey(HotKey.Actions.HelpOnline, Keys.Control | Keys.F1)); + + AddNew(new HotKey(HotKey.Actions.Reset, Keys.Control | Keys.X)); + AddNew(new HotKey(HotKey.Actions.Homing, Keys.Control | Keys.H)); + AddNew(new HotKey(HotKey.Actions.Unlock, Keys.Control | Keys.U)); + AddNew(new HotKey(HotKey.Actions.PauseJob, Keys.F6)); + AddNew(new HotKey(HotKey.Actions.ResumeJob, Keys.F7)); + AddNew(new HotKey(HotKey.Actions.SetNewZero, Keys.Control | Keys.Z)); + + AddNew(new HotKey(HotKey.Actions.JogHome, Keys.NumPad5)); + AddNew(new HotKey(HotKey.Actions.JogN, Keys.NumPad8)); + AddNew(new HotKey(HotKey.Actions.JogNE, Keys.NumPad9)); + AddNew(new HotKey(HotKey.Actions.JogE, Keys.NumPad6)); + AddNew(new HotKey(HotKey.Actions.JogSE, Keys.NumPad3)); + AddNew(new HotKey(HotKey.Actions.JogS, Keys.NumPad2)); + AddNew(new HotKey(HotKey.Actions.JogSW, Keys.NumPad1)); + AddNew(new HotKey(HotKey.Actions.JogW, Keys.NumPad4)); + AddNew(new HotKey(HotKey.Actions.JogNW, Keys.NumPad7)); + + AddNew(new HotKey(HotKey.Actions.OverridePowerDefault, Keys.None)); + AddNew(new HotKey(HotKey.Actions.OverridePowerUp, Keys.None)); + AddNew(new HotKey(HotKey.Actions.OverridePowerDown, Keys.None)); + + AddNew(new HotKey(HotKey.Actions.OverrideLinearDefault, Keys.None)); + AddNew(new HotKey(HotKey.Actions.OverrideLinearUp, Keys.None)); + AddNew(new HotKey(HotKey.Actions.OverrideLinearDown, Keys.None)); + + AddNew(new HotKey(HotKey.Actions.OverrideRapidDefault, Keys.None)); + AddNew(new HotKey(HotKey.Actions.OverrideRapidUp, Keys.None)); + AddNew(new HotKey(HotKey.Actions.OverrideRapidDown, Keys.None)); + + AddNew(new HotKey(HotKey.Actions.CustomButton1, Keys.Control | Keys.D1)); + AddNew(new HotKey(HotKey.Actions.CustomButton2, Keys.Control | Keys.D2)); + AddNew(new HotKey(HotKey.Actions.CustomButton3, Keys.Control | Keys.D3)); + AddNew(new HotKey(HotKey.Actions.CustomButton4, Keys.Control | Keys.D4)); + AddNew(new HotKey(HotKey.Actions.CustomButton5, Keys.Control | Keys.D5)); + AddNew(new HotKey(HotKey.Actions.CustomButton6, Keys.Control | Keys.D6)); + AddNew(new HotKey(HotKey.Actions.CustomButton7, Keys.Control | Keys.D7)); + AddNew(new HotKey(HotKey.Actions.CustomButton8, Keys.Control | Keys.D8)); + AddNew(new HotKey(HotKey.Actions.CustomButton9, Keys.Control | Keys.D9)); + AddNew(new HotKey(HotKey.Actions.CustomButton10, Keys.Control | Keys.D0)); + } + + private void AddNew(HotKey toadd) + { + foreach (HotKey hk in this) + if (hk.Action == toadd.Action) + return; + + Add(toadd); } public void Init(GrblCore core) - { mCore = core; } + { + mCore = core; + AddAllFeatures(); + Sort(CompareKey); + } + + private int CompareKey(HotKey x, HotKey y) + { + return x.Action - y.Action; + } internal bool ManageHotKeys(Keys keys) { @@ -157,6 +196,8 @@ private bool PerformAction(HotKey.Actions action) mCore.SaveProgram(); break; case HotKey.Actions.ExecuteFile: mCore.RunProgram(); break; + case HotKey.Actions.AbortFile: + mCore.AbortProgram(); break; case HotKey.Actions.HelpOnline: mCore.HelpOnLine(); break; case HotKey.Actions.Reset: @@ -189,6 +230,16 @@ private bool PerformAction(HotKey.Actions action) mCore.Jog(GrblCore.JogDirection.W); break; case HotKey.Actions.JogNW: mCore.Jog(GrblCore.JogDirection.NW); break; + case HotKey.Actions.OverridePowerDefault: + case HotKey.Actions.OverridePowerUp: + case HotKey.Actions.OverridePowerDown: + case HotKey.Actions.OverrideLinearDefault: + case HotKey.Actions.OverrideLinearUp: + case HotKey.Actions.OverrideLinearDown: + case HotKey.Actions.OverrideRapidDefault: + case HotKey.Actions.OverrideRapidUp: + case HotKey.Actions.OverrideRapidDown: + mCore.HotKeyOverride(action); break; case HotKey.Actions.CustomButton1: mCore.HKCustomButton(0); break; case HotKey.Actions.CustomButton2: diff --git a/LaserGRBL/HotkeyManagerForm.Designer.cs b/LaserGRBL/HotkeyManagerForm.Designer.cs index 7b0b82cc0..4cdc7aabc 100644 --- a/LaserGRBL/HotkeyManagerForm.Designer.cs +++ b/LaserGRBL/HotkeyManagerForm.Designer.cs @@ -189,9 +189,9 @@ private void InitializeComponent() private System.Windows.Forms.GroupBox GB; private System.Windows.Forms.Button BtnCancel; private MyDatagridView DGV; - private System.Windows.Forms.DataGridViewTextBoxColumn Action; - private System.Windows.Forms.DataGridViewTextBoxColumn Shortcut; private System.Windows.Forms.Button BtnSave; private System.Windows.Forms.Label LblConnect; + private System.Windows.Forms.DataGridViewTextBoxColumn Action; + private System.Windows.Forms.DataGridViewTextBoxColumn Shortcut; } } \ No newline at end of file diff --git a/LaserGRBL/MainForm.Designer.cs b/LaserGRBL/MainForm.Designer.cs index 839bfcdce..78bce906d 100644 --- a/LaserGRBL/MainForm.Designer.cs +++ b/LaserGRBL/MainForm.Designer.cs @@ -146,9 +146,9 @@ private void InitializeComponent() this.TTLEstimated, this.TTTEstimated, this.spring1, - this.TTOvG0, - this.TTOvG1, this.TTOvS, + this.TTOvG1, + this.TTOvG0, this.spacer, this.TTLStatus, this.TTTStatus}); diff --git a/LaserGRBL/MainForm.resx b/LaserGRBL/MainForm.resx index e4c1e1b07..dd5b89cae 100644 --- a/LaserGRBL/MainForm.resx +++ b/LaserGRBL/MainForm.resx @@ -148,7 +148,7 @@ ConnectionForm - LaserGRBL.ConnectLogForm, LaserGRBL, Version=2.8.46.0, Culture=neutral, PublicKeyToken=null + LaserGRBL.ConnectLogForm, LaserGRBL, Version=2.8.47.0, Culture=neutral, PublicKeyToken=null splitContainer1.Panel1 @@ -175,7 +175,7 @@ JogForm - LaserGRBL.JogForm, LaserGRBL, Version=2.8.46.0, Culture=neutral, PublicKeyToken=null + LaserGRBL.JogForm, LaserGRBL, Version=2.8.47.0, Culture=neutral, PublicKeyToken=null splitContainer1.Panel1 @@ -217,7 +217,7 @@ PreviewForm - LaserGRBL.PreviewForm, LaserGRBL, Version=2.8.46.0, Culture=neutral, PublicKeyToken=null + LaserGRBL.PreviewForm, LaserGRBL, Version=2.8.47.0, Culture=neutral, PublicKeyToken=null splitContainer1.Panel2 @@ -297,16 +297,16 @@ 205, 19 - + False - - 60, 19 + + 55, 19 - - G0: 100% + + S: 100% - + False @@ -321,16 +321,16 @@ False - + False - - 55, 19 + + 60, 19 - - S: 100% + + G0: 100% - + False diff --git a/LaserGRBL/UserControls/LabelTB.Designer.cs b/LaserGRBL/UserControls/LabelTB.Designer.cs index dc20cb5e9..6e0d8b1fe 100644 --- a/LaserGRBL/UserControls/LabelTB.Designer.cs +++ b/LaserGRBL/UserControls/LabelTB.Designer.cs @@ -28,28 +28,33 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LabelTB)); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.TB = new System.Windows.Forms.TrackBar(); this.Lbl = new System.Windows.Forms.Label(); + this.BtnReset = new System.Windows.Forms.PictureBox(); this.tableLayoutPanel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.TB)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.BtnReset)).BeginInit(); this.SuspendLayout(); // // tableLayoutPanel1 // this.tableLayoutPanel1.AutoSize = true; this.tableLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.tableLayoutPanel1.ColumnCount = 2; + this.tableLayoutPanel1.ColumnCount = 3; this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); this.tableLayoutPanel1.Controls.Add(this.TB, 1, 0); this.tableLayoutPanel1.Controls.Add(this.Lbl, 0, 0); + this.tableLayoutPanel1.Controls.Add(this.BtnReset, 2, 0); this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.RowCount = 1; this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel1.Size = new System.Drawing.Size(252, 51); + this.tableLayoutPanel1.Size = new System.Drawing.Size(280, 51); this.tableLayoutPanel1.TabIndex = 0; // // TB @@ -76,6 +81,18 @@ private void InitializeComponent() this.Lbl.TabIndex = 7; this.Lbl.Text = "Text"; // + // BtnReset + // + this.BtnReset.Dock = System.Windows.Forms.DockStyle.Fill; + this.BtnReset.Image = ((System.Drawing.Image)(resources.GetObject("BtnReset.Image"))); + this.BtnReset.Location = new System.Drawing.Point(255, 3); + this.BtnReset.Name = "BtnReset"; + this.BtnReset.Size = new System.Drawing.Size(22, 45); + this.BtnReset.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; + this.BtnReset.TabIndex = 8; + this.BtnReset.TabStop = false; + this.BtnReset.Click += new System.EventHandler(this.BtnReset_Click); + // // LabelTB // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -84,10 +101,11 @@ private void InitializeComponent() this.BackColor = System.Drawing.SystemColors.ControlLightLight; this.Controls.Add(this.tableLayoutPanel1); this.Name = "LabelTB"; - this.Size = new System.Drawing.Size(252, 51); + this.Size = new System.Drawing.Size(280, 51); this.tableLayoutPanel1.ResumeLayout(false); this.tableLayoutPanel1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.TB)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.BtnReset)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -96,7 +114,9 @@ private void InitializeComponent() private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; private System.Windows.Forms.TrackBar TB; private System.Windows.Forms.Label Lbl; - + #endregion + + private System.Windows.Forms.PictureBox BtnReset; } } diff --git a/LaserGRBL/UserControls/LabelTB.cs b/LaserGRBL/UserControls/LabelTB.cs index 9c359c051..1a517fb83 100644 --- a/LaserGRBL/UserControls/LabelTB.cs +++ b/LaserGRBL/UserControls/LabelTB.cs @@ -18,6 +18,7 @@ public LabelTB(GrblCore core, int function) InitializeComponent(); Core = core; fun = function; + TB.DoubleClick += TB_DoubleClick; if (function == 0) { @@ -58,6 +59,11 @@ public LabelTB(GrblCore core, int function) RefreshText(); } + private void TB_DoubleClick(object sender, EventArgs e) + { + TB.Value = 100; + } + private void TB_ValueChanged(object sender, EventArgs e) { if (fun == 0) @@ -94,5 +100,14 @@ private void TB_MouseUp(object sender, MouseEventArgs e) Core.ManageOverrides(); } + private void BtnReset_Click(object sender, EventArgs e) + { + if (fun == 0) + TB.Value = 2; + if (fun == 1) + TB.Value = 100; + if (fun == 2) + TB.Value = 100; + } } } diff --git a/LaserGRBL/UserControls/LabelTB.resx b/LaserGRBL/UserControls/LabelTB.resx index 7080a7d11..cb11f1351 100644 --- a/LaserGRBL/UserControls/LabelTB.resx +++ b/LaserGRBL/UserControls/LabelTB.resx @@ -117,4 +117,36 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 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 + RK5CYII= + + \ No newline at end of file diff --git a/setup.iss b/setup.iss index de6b696cd..4ecece512 100644 --- a/setup.iss +++ b/setup.iss @@ -2,7 +2,7 @@ ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! #define MyAppName "LaserGRBL" -#define MyAppVersion "2.8.47" +#define MyAppVersion "2.8.48" #define MyAppVersionName "Rhydon" #define MyAppPublisher "LaserGRBL" #define MyAppURL "http://lasergrbl.com"