Skip to content

Commit

Permalink
implement #255 feature
Browse files Browse the repository at this point in the history
  • Loading branch information
arkypita committed Feb 1, 2018
1 parent 2dd9f59 commit 1e20997
Show file tree
Hide file tree
Showing 3 changed files with 128 additions and 101 deletions.
207 changes: 107 additions & 100 deletions LaserGRBL/JogForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 18 additions & 1 deletion LaserGRBL/JogForm.cs
Expand Up @@ -16,7 +16,10 @@ public void SetCore(GrblCore core)
{
Core = core;

TbSpeed.Value = (int)Settings.GetObject("Jog Speed", 1000);
UpdateFMax.Enabled = true;
UpdateFMax_Tick(null, null);

TbSpeed.Value = Math.Min((int)Settings.GetObject("Jog Speed", 1000), TbSpeed.Maximum);
TbStep.Value = (int)Settings.GetObject("Jog Step", 10);

TbSpeed_ValueChanged(null, null); //set tooltip
Expand Down Expand Up @@ -60,6 +63,20 @@ private void OnSliderMouseUP(object sender, MouseEventArgs e)
Settings.Save();
}
}

int oldVal;
private void UpdateFMax_Tick(object sender, EventArgs e)
{
int curVal = (int)Math.Min(Core.Configuration.MaxRateX, Core.Configuration.MaxRateY);
if (oldVal != curVal)
{
TbSpeed.Value = Math.Min(TbSpeed.Value, curVal);
TbSpeed.Maximum = curVal;
TbSpeed.LargeChange = curVal / 10;
TbSpeed.SmallChange = curVal / 20;
oldVal = curVal;
}
}
}

public class DirectionButton : UserControls.ImageButton
Expand Down
3 changes: 3 additions & 0 deletions LaserGRBL/JogForm.resx
Expand Up @@ -587,4 +587,7 @@
<metadata name="TT.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 31</value>
</metadata>
<metadata name="UpdateFMax.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>81, 31</value>
</metadata>
</root>

0 comments on commit 1e20997

Please sign in to comment.